From 2a144d0420dfc90962c0f52ddd0a46534d95c3c1 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 19 Apr 2021 11:52:28 +0300 Subject: [PATCH 1/2] cli: use CalledByEntry as default cosigner's scope --- cli/smartcontract/smart_contract.go | 4 ++-- cli/smartcontract/smart_contract_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index d7f7224fb..ee87784f1 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -289,7 +289,7 @@ func NewCommands() []cli.Command { - 'CustomContracts' - define valid custom contract hashes for witness check. - 'CustomGroups' - define custom pubkey for group members. - If no scopes were specified, 'Global' used as default. If no signers were + If no scopes were specified, 'CalledByEntry' used as default. If no signers were specified, no array is passed. Note that scopes are properly handled by neo-go RPC server only. C# implementation does not support scopes capability. @@ -926,7 +926,7 @@ func parseCosigner(c string) (transaction.Signer, error) { var ( err error res = transaction.Signer{ - Scopes: transaction.Global, + Scopes: transaction.CalledByEntry, } ) data := strings.SplitN(c, ":", 2) diff --git a/cli/smartcontract/smart_contract_test.go b/cli/smartcontract/smart_contract_test.go index 89af4f7be..e00ea71ec 100644 --- a/cli/smartcontract/smart_contract_test.go +++ b/cli/smartcontract/smart_contract_test.go @@ -74,11 +74,11 @@ func TestParseCosigner(t *testing.T) { testCases := map[string]transaction.Signer{ acc.StringLE(): { Account: acc, - Scopes: transaction.Global, + Scopes: transaction.CalledByEntry, }, "0x" + acc.StringLE(): { Account: acc, - Scopes: transaction.Global, + Scopes: transaction.CalledByEntry, }, acc.StringLE() + ":Global": { Account: acc, From 8f4257639eaccbb4e589a31ecbd9c23bcfab8c05 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 19 Apr 2021 11:53:01 +0300 Subject: [PATCH 2/2] rpc: use CalledByEntry as default cosigner's scope --- pkg/rpc/request/param.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/rpc/request/param.go b/pkg/rpc/request/param.go index 00713a6df..33ddfbea1 100644 --- a/pkg/rpc/request/param.go +++ b/pkg/rpc/request/param.go @@ -224,9 +224,9 @@ func (p Param) GetSignerWithWitness() (SignerWithWitness, error) { return c, nil } -// GetSignersWithWitnesses returns a slice of SignerWithWitness with global scope from -// array of Uint160 or array of serialized transaction.Signer stored in the -// parameter. +// GetSignersWithWitnesses returns a slice of SignerWithWitness with CalledByEntry +// scope from array of Uint160 or array of serialized transaction.Signer stored +// in the parameter. func (p Param) GetSignersWithWitnesses() ([]transaction.Signer, []transaction.Witness, error) { hashes, err := p.GetArray() if err != nil { @@ -243,7 +243,7 @@ func (p Param) GetSignersWithWitnesses() ([]transaction.Signer, []transaction.Wi } signers[i] = transaction.Signer{ Account: u, - Scopes: transaction.Global, + Scopes: transaction.CalledByEntry, } } if err != nil {