Skip to content

Commit

Permalink
Payloads: add doc to CalculateNetworkFee method of NotaryAssisted att…
Browse files Browse the repository at this point in the history
…ribute

Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Mar 6, 2024
1 parent 6da4ae2 commit acec1b0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Neo/Network/P2P/Payloads/NotaryAssisted.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ public override bool Verify(DataCache snapshot, Transaction tx)
return tx.Signers.Any(p => p.Account.Equals(notaryH));
}

/// <summary>
/// Calculates the network fee needed to pay for NotaryAssisted attribute. According to the
/// https://github.com/neo-project/neo/issues/1573#issuecomment-704874472, network fee consists of
/// the base Notary service fee per key multiplied by the expected number of transactions that should
/// be collected by the service to complete Notary request increased by one (for Notary node witness
/// itself).
/// </summary>
/// <param name="snapshot">The snapshot used to read data.</param>
/// <param name="tx">The transaction to calculate.</param>
/// <returns>The network fee of the NotaryAssisted attribute.</returns>
public override long CalculateNetworkFee(DataCache snapshot, Transaction tx)
{
return (NKeys + 1) * base.CalculateNetworkFee(snapshot, tx);
Expand Down

0 comments on commit acec1b0

Please sign in to comment.