Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Add data parameter when deploy and update contract #837

Merged
merged 6 commits into from
Nov 19, 2021

Conversation

ZhangTao1596
Copy link
Contributor

Let user be able to deploy or update contract with data.

neo-cli/CLI/MainService.Contracts.cs Outdated Show resolved Hide resolved
neo-cli/CLI/MainService.Contracts.cs Outdated Show resolved Hide resolved
neo-cli/CLI/MainService.Contracts.cs Outdated Show resolved Hide resolved
@shargon
Copy link
Member

shargon commented Nov 17, 2021

tested?

shargon
shargon previously approved these changes Nov 17, 2021
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

Good for me if it's tested

@superboyiii
Copy link
Member

Tested OK

superboyiii
superboyiii previously approved these changes Nov 18, 2021
@superboyiii
Copy link
Member

superboyiii commented Nov 18, 2021

Maybe we can check ContractManagement.GetContract(scriptHash).Manifest.Abi.GetMethod("update", -1).Parameters if it contains data to avoid error when input data param but no data param in update method of smart contract. The error msg is too long now since it printed all the script of new contract.

neo> update 0xd46a4f256e998b601738d7d975b210a4663695f8 TestNetFee.nef TestNetFee.manifest.json NhjUv7db6Tx9uibF4xYrQe4seACYL4asUo NhjUv7db6Tx9uibF4xYrQe4seACYL4asUo
Error: Failed execution for 'DagLeyJuYW1lIjoiVGVzdE5ldEZlZSIsImdyb3VwcyI6W10sImZlYXR1cmVzIjp7fSwic3VwcG9ydGVkc3RhbmRhcmRzIjpbIk5FUC0xNyJdLCJhYmkiOnsibWV0aG9kcyI6W3sibmFtZSI6InZlcmlmeSIsInBhcmFtZXRlcnMiOltdLCJyZXR1cm50eXBlIjoiQm9vbGVhbiIsIm9mZnNldCI6MTMsInNhZmUiOmZhbHNlfSx7Im5hbWUiOiJnZXRQYXltZW50U3RhdHVzIiwicGFyYW1ldGVycyI6W10sInJldHVybnR5cGUiOiJCb29sZWFuIiwib2Zmc2V0IjoxNiwic2FmZSI6ZmFsc2V9LHsibmFtZSI6ImVuYWJsZVBheW1lbn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snXZ1zgXYIuZbiVPatRBYn1bUg=='

superboyiii
superboyiii previously approved these changes Nov 18, 2021
Copy link
Member

@superboyiii superboyiii left a comment

Choose a reason for hiding this comment

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

Tested OK.

@superboyiii superboyiii merged commit 24bd2cc into neo-project:master Nov 19, 2021
@ZhangTao1596 ZhangTao1596 deleted the deploy-update-with-data branch November 19, 2021 06:42
ZhangTao1596 added a commit to ZhangTao1596/neo-node that referenced this pull request Nov 19, 2021
@ZhangTao1596 ZhangTao1596 restored the deploy-update-with-data branch November 19, 2021 07:48
@ZhangTao1596 ZhangTao1596 deleted the deploy-update-with-data branch November 19, 2021 07:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants