cli: use CalledByEntry as default cosigner's scope

This commit is contained in:
Anna Shaleva 2021-04-19 11:52:28 +03:00
parent 8f14c61c34
commit 2a144d0420
2 changed files with 4 additions and 4 deletions

View file

@ -289,7 +289,7 @@ func NewCommands() []cli.Command {
- 'CustomContracts' - define valid custom contract hashes for witness check. - 'CustomContracts' - define valid custom contract hashes for witness check.
- 'CustomGroups' - define custom pubkey for group members. - '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 specified, no array is passed. Note that scopes are properly handled by
neo-go RPC server only. C# implementation does not support scopes capability. neo-go RPC server only. C# implementation does not support scopes capability.
@ -926,7 +926,7 @@ func parseCosigner(c string) (transaction.Signer, error) {
var ( var (
err error err error
res = transaction.Signer{ res = transaction.Signer{
Scopes: transaction.Global, Scopes: transaction.CalledByEntry,
} }
) )
data := strings.SplitN(c, ":", 2) data := strings.SplitN(c, ":", 2)

View file

@ -74,11 +74,11 @@ func TestParseCosigner(t *testing.T) {
testCases := map[string]transaction.Signer{ testCases := map[string]transaction.Signer{
acc.StringLE(): { acc.StringLE(): {
Account: acc, Account: acc,
Scopes: transaction.Global, Scopes: transaction.CalledByEntry,
}, },
"0x" + acc.StringLE(): { "0x" + acc.StringLE(): {
Account: acc, Account: acc,
Scopes: transaction.Global, Scopes: transaction.CalledByEntry,
}, },
acc.StringLE() + ":Global": { acc.StringLE() + ":Global": {
Account: acc, Account: acc,