*: support customisable NotaryServiceFeePerKey value

* Add corresponding methods to Notary contract.
* Extend RPC Client API.
* Adjust tests.
This commit is contained in:
AnnaShaleva 2022-03-01 13:10:54 +03:00
parent 26b76ed858
commit 92282c70cb
14 changed files with 157 additions and 48 deletions

View file

@ -878,7 +878,11 @@ func (c *Client) CalculateNotaryFee(nKeys uint8) (int64, error) {
if err != nil {
return 0, fmt.Errorf("failed to get FeePerByte: %w", err)
}
return int64((nKeys+1))*transaction.NotaryServiceFeePerKey + // fee for NotaryAssisted attribute
feePerKey, err := c.GetNotaryServiceFeePerKey()
if err != nil {
return 0, fmt.Errorf("failed to get NotaryServiceFeePerKey: %w", err)
}
return int64((nKeys+1))*feePerKey + // fee for NotaryAssisted attribute
fee.Opcode(baseExecFee, // Notary node witness
opcode.PUSHDATA1, opcode.RET, // invocation script
opcode.PUSH0, opcode.SYSCALL, opcode.RET) + // System.Contract.CallNative