Skip to content

Conversation

@erikzhang
Copy link
Member

No description provided.

ContractMethodDescriptor md = oracleContract.Manifest.Abi.GetMethod(ContractBasicMethod.Verify, ContractBasicMethod.VerifyPCount)!;
engine.LoadContract(oracleContract, md, CallFlags.None);
if (engine.Execute() != VMState.HALT) return null;
engine.Execute(); //FAULT is impossible
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that not checking the execution status is not a good idea; it makes it less resilient to failures

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/neo-project/neo/blob/ed22ef2c2d65826c7191dba33ba1d3dd8d85cb92/src/Neo/SmartContract/Native/OracleContract.cs#L267-L271

It's impossible to fail.

And, if you return null, it fails here:

var txSign = responseTx.Sign(account.GetKey(), _system.Settings.Network);

private void AddSignItem(Contract contract, KeyPair key)
{
if (!Tx.GetScriptHashesForVerifying(null).Contains(contract.ScriptHash))
if (!Tx.GetScriptHashesForVerifying(null!).Contains(contract.ScriptHash))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants