Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Change Deploy and Update CallFlags #2653

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/neo/SmartContract/Native/ContractManagement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ public IEnumerable<ContractState> ListContracts(DataCache snapshot)
return snapshot.Find(listContractsPrefix).Select(kvp => kvp.Value.GetInteroperable<ContractState>());
}

[ContractMethod(RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify)]
[ContractMethod(RequiredCallFlags = CallFlags.All)]
private ContractTask<ContractState> Deploy(ApplicationEngine engine, byte[] nefFile, byte[] manifest)
{
return Deploy(engine, nefFile, manifest, StackItem.Null);
}

[ContractMethod(RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify)]
[ContractMethod(RequiredCallFlags = CallFlags.All)]
private async ContractTask<ContractState> Deploy(ApplicationEngine engine, byte[] nefFile, byte[] manifest, StackItem data)
{
if (engine.ScriptContainer is not Transaction tx)
Expand Down Expand Up @@ -200,13 +200,13 @@ private async ContractTask<ContractState> Deploy(ApplicationEngine engine, byte[
return contract;
}

[ContractMethod(RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify)]
[ContractMethod(RequiredCallFlags = CallFlags.All)]
private ContractTask Update(ApplicationEngine engine, byte[] nefFile, byte[] manifest)
{
return Update(engine, nefFile, manifest, StackItem.Null);
}

[ContractMethod(RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify)]
[ContractMethod(RequiredCallFlags = CallFlags.All)]
private ContractTask Update(ApplicationEngine engine, byte[] nefFile, byte[] manifest, StackItem data)
{
if (nefFile is null && manifest is null) throw new ArgumentException();
Expand Down