Centralize _initialize call#2052
Conversation
|
@chenzhitong please take a look to this solution, I think that verification it's quite important to replicate the logic around modules. |
|
We've played a little with neo-project/neo-modules#378 and I think this is really needed to do it right. |
|
|
Can it be solved by creating mocked |
Take a look at neo-project/neo-modules#378 (comment), I don't think we can make anything useful without real |
This reverts commit 7dd3717.
|
Can you provide some code on how you plan to call it? I want to see if there are other ways. |
|
|
I didn't find where it calls |
|
We want to add a var tx = new Transaction{ Witnesses =[new Witness ]}
var witnessIndex = 0
if (Helper.TryCreateVerifyEngine(tx, snapshot.clone(), scriptHash, witnessIndex, MaxVerificationGas), out ApplicationEngine engine)
{
JObject json = new JObject();
json["script"] = Convert.ToBase64String(contract.Script);
json["state"] = engine.Execute();
json["gasconsumed"] = new BigDecimal(engine.GasConsumed, NativeContract.GAS.Decimals).ToString();
json["exception"] = GetExceptionMessage(engine.FaultException);
} |
|
Maybe add a method
|
@shargon what do you think? |
I will do it |
|
@erikzhang @Tommo-L please take a look |
Co-authored-by: Erik Zhang <erik@neo.org>
|
Maybe we should modify |
I think that it's ok like this because |
|
@superboyiii tested? |
Tested on my local within Native contract's methods. It works well. |
* Allow to get Verification Result outside core * Use index * Return IEnumerable * Clean code * Revert "Return IEnumerable" This reverts commit 7dd3717. * LoadContract solution * Remove constant * Reuse call * Refactor * Move to LoadContract * Remove double check * Update src/neo/SmartContract/ApplicationEngine.cs Co-authored-by: Erik Zhang <erik@neo.org> * Move to else * Fix LoadContract * Update Helper.cs * Remove empty line * Add packParameters * Use LoadContract in CallContractInternal Co-authored-by: Erik Zhang <erik@neo.org>
* Allow to get Verification Result outside core * Use index * Return IEnumerable * Clean code * Revert "Return IEnumerable" This reverts commit 7dd3717. * LoadContract solution * Remove constant * Reuse call * Refactor * Move to LoadContract * Remove double check * Update src/neo/SmartContract/ApplicationEngine.cs Co-authored-by: Erik Zhang <erik@neo.org> * Move to else * Fix LoadContract * Update Helper.cs * Remove empty line * Add packParameters * Use LoadContract in CallContractInternal Co-authored-by: Erik Zhang <erik@neo.org>

Close #2047