Skip to content

Commit

Permalink
Fix calnetfee (#2520)
Browse files Browse the repository at this point in the history
  • Loading branch information
bettybao1209 authored Jul 17, 2021
1 parent 82779ad commit c602a21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/neo/Wallets/Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,13 @@ public long CalculateNetworkFee(DataCache snapshot, Transaction tx)
var contract = NativeContract.ContractManagement.GetContract(snapshot, hash);
if (contract is null)
throw new ArgumentException($"The smart contract or address {hash} is not found");
var md = contract.Manifest.Abi.GetMethod("verify", 0);
var md = contract.Manifest.Abi.GetMethod("verify", -1);
if (md is null)
throw new ArgumentException($"The smart contract {contract.Hash} haven't got verify method without arguments");
throw new ArgumentException($"The smart contract {contract.Hash} haven't got verify method");
if (md.ReturnType != ContractParameterType.Boolean)
throw new ArgumentException("The verify method doesn't return boolean value.");
if (md.Parameters.Length > 0 && invocationScript is null)
throw new ArgumentException("The verify method requires parameters that need to be passed via the witness' invocation script.");

// Empty verification and non-empty invocation scripts
var invSize = invocationScript != null ? invocationScript.GetVarSize() : Array.Empty<byte>().GetVarSize();
Expand Down

0 comments on commit c602a21

Please sign in to comment.