From 5326fc587a95af5d2c5ee408e1258784d29a6fc8 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 13 Jul 2020 13:39:36 +0300 Subject: [PATCH] core: rename Neo.Crypto.CheckMultisig to Neo.Crypto.CheckMultisigWithECDsaSecp256r1 Part of #918 --- .docker/wallets/wallet1.json | 4 ++-- .docker/wallets/wallet1_solo.json | 8 ++++---- .docker/wallets/wallet2.json | 4 ++-- .docker/wallets/wallet3.json | 4 ++-- .docker/wallets/wallet4.json | 4 ++-- pkg/consensus/testdata/wallet1.json | 4 ++-- pkg/consensus/testdata/wallet2.json | 4 ++-- pkg/consensus/testdata/wallet3.json | 4 ++-- pkg/consensus/testdata/wallet4.json | 4 ++-- pkg/core/interop/crypto/ecdsa.go | 5 +++-- pkg/core/interop/crypto/ecdsa_test.go | 2 +- pkg/core/interop/crypto/interop.go | 8 ++++---- pkg/core/interops.go | 2 +- pkg/core/util_test.go | 6 +++--- pkg/rpc/server/testdata/testblocks.acc | Bin 6810 -> 6810 bytes pkg/smartcontract/contract.go | 2 +- pkg/smartcontract/contract_test.go | 2 +- pkg/vm/contract_checks.go | 2 +- pkg/wallet/account_test.go | 4 ++-- pkg/wallet/testdata/wallet1.json | 4 ++-- pkg/wallet/testdata/wallet2.json | 4 ++-- 21 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.docker/wallets/wallet1.json b/.docker/wallets/wallet1.json index 70b704d22..de29bf7c7 100644 --- a/.docker/wallets/wallet1.json +++ b/.docker/wallets/wallet1.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/.docker/wallets/wallet1_solo.json b/.docker/wallets/wallet1_solo.json index 9ff04b908..97f745b1b 100644 --- a/.docker/wallets/wallet1_solo.json +++ b/.docker/wallets/wallet1_solo.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", @@ -44,11 +44,11 @@ "isDefault": false }, { - "address": "NYqxsNMHxDg3T19APYP27mBZFfauC4zngR", + "address": "NVNvVRW5Q5naSx2k2iZm7xRgtRNGuZppAK", "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEQtBMHOzuw==", + "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEQtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/.docker/wallets/wallet2.json b/.docker/wallets/wallet2.json index c7d21fdf9..92e2114af 100644 --- a/.docker/wallets/wallet2.json +++ b/.docker/wallets/wallet2.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/.docker/wallets/wallet3.json b/.docker/wallets/wallet3.json index 4b272e774..f48127972 100644 --- a/.docker/wallets/wallet3.json +++ b/.docker/wallets/wallet3.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/.docker/wallets/wallet4.json b/.docker/wallets/wallet4.json index b40a05bf0..1cbad5ad9 100644 --- a/.docker/wallets/wallet4.json +++ b/.docker/wallets/wallet4.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/pkg/consensus/testdata/wallet1.json b/pkg/consensus/testdata/wallet1.json index 70b704d22..de29bf7c7 100644 --- a/pkg/consensus/testdata/wallet1.json +++ b/pkg/consensus/testdata/wallet1.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/pkg/consensus/testdata/wallet2.json b/pkg/consensus/testdata/wallet2.json index c7d21fdf9..92e2114af 100644 --- a/pkg/consensus/testdata/wallet2.json +++ b/pkg/consensus/testdata/wallet2.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYKEHagXJ3mDLdga1FoyTGRtPdJgPz6Gb8sjEFwZvRu7ncD9PVZfHtMzL", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/pkg/consensus/testdata/wallet3.json b/pkg/consensus/testdata/wallet3.json index 4b272e774..f48127972 100644 --- a/pkg/consensus/testdata/wallet3.json +++ b/pkg/consensus/testdata/wallet3.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYLjn1Zw3RQmP3CkDxoZvYtMpu7ZUdjHnvu7wPuohUcXWCMh9vY661R8A", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/pkg/consensus/testdata/wallet4.json b/pkg/consensus/testdata/wallet4.json index b40a05bf0..1cbad5ad9 100644 --- a/pkg/consensus/testdata/wallet4.json +++ b/pkg/consensus/testdata/wallet4.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYLbYYg9jUgzJQpKhpvNExa2UEgtp4356XPg56pHuCpE7gQmj84ESNjYW", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/pkg/core/interop/crypto/ecdsa.go b/pkg/core/interop/crypto/ecdsa.go index a2e54dd29..c8598b2e1 100644 --- a/pkg/core/interop/crypto/ecdsa.go +++ b/pkg/core/interop/crypto/ecdsa.go @@ -30,8 +30,9 @@ func ECDSASecp256r1Verify(ic *interop.Context, v *vm.VM) error { return nil } -// ECDSACheckMultisig checks multiple ECDSA signatures at once. -func ECDSACheckMultisig(ic *interop.Context, v *vm.VM) error { +// ECDSASecp256r1CheckMultisig checks multiple ECDSA signatures at once using +// Secp256r1 elliptic curve. +func ECDSASecp256r1CheckMultisig(ic *interop.Context, v *vm.VM) error { msg := getMessage(ic, v.Estack().Pop().Item()) hashToCheck := hash.Sha256(msg).BytesBE() pkeys, err := v.Estack().PopSigElements() diff --git a/pkg/core/interop/crypto/ecdsa_test.go b/pkg/core/interop/crypto/ecdsa_test.go index a628966a9..4261d0014 100644 --- a/pkg/core/interop/crypto/ecdsa_test.go +++ b/pkg/core/interop/crypto/ecdsa_test.go @@ -57,7 +57,7 @@ func subSlice(arr []stackitem.Item, indices []int) []stackitem.Item { func initCHECKMULTISIGVM(t *testing.T, n int, ik, is []int) *vm.VM { buf := make([]byte, 5) buf[0] = byte(opcode.SYSCALL) - binary.LittleEndian.PutUint32(buf[1:], ecdsaCheckMultisigID) + binary.LittleEndian.PutUint32(buf[1:], ecdsaSecp256r1CheckMultisigID) v := vm.New() v.GasLimit = -1 diff --git a/pkg/core/interop/crypto/interop.go b/pkg/core/interop/crypto/interop.go index a920bd02c..77dc58479 100644 --- a/pkg/core/interop/crypto/interop.go +++ b/pkg/core/interop/crypto/interop.go @@ -8,8 +8,8 @@ import ( var ( ecdsaSecp256r1VerifyID = emit.InteropNameToID([]byte("Neo.Crypto.VerifyWithECDsaSecp256r1")) - ecdsaCheckMultisigID = emit.InteropNameToID([]byte("Neo.Crypto.ECDsaCheckMultiSig")) - sha256ID = emit.InteropNameToID([]byte("Neo.Crypto.SHA256")) + ecdsaSecp256r1CheckMultisigID = emit.InteropNameToID([]byte("Neo.Crypto.CheckMultisigWithECDsaSecp256r1")) + sha256ID = emit.InteropNameToID([]byte("Neo.Crypto.SHA256")) ) // GetInterop returns interop getter for crypto-related stuff. @@ -22,10 +22,10 @@ func GetInterop(ic *interop.Context) func(uint32) *vm.InteropFuncPrice { return ECDSASecp256r1Verify(ic, v) }, } - case ecdsaCheckMultisigID: + case ecdsaSecp256r1CheckMultisigID: return &vm.InteropFuncPrice{ Func: func(v *vm.VM) error { - return ECDSACheckMultisig(ic, v) + return ECDSASecp256r1CheckMultisig(ic, v) }, } case sha256ID: diff --git a/pkg/core/interops.go b/pkg/core/interops.go index 20642e919..815d44a3a 100644 --- a/pkg/core/interops.go +++ b/pkg/core/interops.go @@ -139,7 +139,7 @@ var systemInterops = []interop.Function{ var neoInterops = []interop.Function{ {Name: "Neo.Crypto.VerifyWithECDsaSecp256r1", Func: crypto.ECDSASecp256r1Verify, Price: crypto.ECDSAVerifyPrice}, - {Name: "Neo.Crypto.ECDsaCheckMultiSig", Func: crypto.ECDSACheckMultisig, Price: 0}, + {Name: "Neo.Crypto.CheckMultisigWithECDsaSecp256r1", Func: crypto.ECDSASecp256r1CheckMultisig, Price: 0}, {Name: "Neo.Crypto.SHA256", Func: crypto.Sha256, Price: 1000000}, {Name: "Neo.Native.Deploy", Func: native.Deploy, Price: 0, AllowedTriggers: trigger.Application, RequiredFlags: smartcontract.AllowModifyStates}, diff --git a/pkg/core/util_test.go b/pkg/core/util_test.go index de438e42c..4a42db8a7 100644 --- a/pkg/core/util_test.go +++ b/pkg/core/util_test.go @@ -21,14 +21,14 @@ func TestGenesisBlockMainNet(t *testing.T) { // have been changed. Consequently, hash of the genesis block has been changed. // Update expected genesis block hash for better times. // Old hash is "d42561e3d30e15be6400b6df2f328e02d2bf6354c41dce433bc57687c82144bf" - expect := "dba446947a90b2862ef050703b44828ad8b02d11978f8ef59bd3e1c97aabf6e5" + expect := "94e61af2441145cc251752707a58107850328a48bb095fd175ca2f8513ab5676" assert.Equal(t, expect, block.Hash().StringLE()) } func TestGetConsensusAddressMainNet(t *testing.T) { var ( - consensusAddr = "NWNnqYniJyFh1qx5KyBeTV4uq5ewvNrAuD" - consensusScript = "72c3d9b3bbf776698694cd2c73fa597a10c31294" + consensusAddr = "NiVihDFvZacZhujTWkBhRz32UDuNRp416f" + consensusScript = "f7b4d00143932f3b6243cfc06cb4a68f22c739e2" ) cfg, err := config.Load("../../config", netmode.MainNet) diff --git a/pkg/rpc/server/testdata/testblocks.acc b/pkg/rpc/server/testdata/testblocks.acc index 11776cb49434c76944907a3185433fe487bf217d..98d85b7a05bb61d788373df0815e6339f00fd117 100644 GIT binary patch delta 2905 zcmaLXc|6oxAHeZ3#+Dz-zJ!_V(GZCwenMG8+1D^6%O#XGb4j+CFf(KcLzc3KQZiX5 zOLkFQ+m#txmXR$cPoCTBx&PF2UgvfGIsd)S_k1#yGnLVd5C|mY@c6MDPbQkm8lLlx z2)>x4C_||IQ#o9wCH*dfjjEL;OUPLR68MJp({dS!e3+R#4`cJQ1Xl0UcTB{U2HKrK z>_3_kSR@(+&_N(SHpG#WSQ5H~w~pT0?G4sVeE%w30Z&I`rUSqs>3a()Ns?`RPmZc- zpiQ!kA_mg?&P&{U4l8t@XntG4SvZn7YKKuma^o4@zC}hPcyXo(UQ^ClOudz?bx(sM z4gm4?TJD8We_zx^TN093vPzwBH&6+5Gz0T5;XX>H1xd=Xr|(QXp%2J^G556W0I`W# z=4>@G>Bu|q@jIizh@S&MLocg-?c%v?bedaaA)4yE7ZCVh0r@zbWTv#pGwniG#}rp9 zU>_Rau`KEiHDnlj+qo6GDh7|+9zJ0}U+V8J3xJhf_%354r7w$6=pvgP%|&pP$@6n{ zsf)tilIk|*c{rNY!W*8g!d+FX*lJc0End7~YDv=JhzezbU9n?*W{Kkh5Kt_MK2eG* zX|<9bVg>u}BS0X~-|%4-puF6_a>d$0MSp#f1Vy4Z#)t2DcjK5V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=Z<-c)Mz zTvzc@6`@wr%Mx?Q51hQ`JoHi6r;1w6k0KL(0PhC~sE`TWPIIoC4BP8D=HuO-#@zK6vIjqvJEenw+RMqY zkDHNX`4@Q8TBJ4r`l^ba==akoq8D_27N)geIgcMmdz<4^5=}2GvQCapIk3}mRa0kr zkBDn;n0C)LayBZ{J>CT~+%5(6`@G+~9{`_pc&L9pk+E`GTF1}A{^HmLJ?w|lSTj1m z8n*oHS&eQ%g{P61`$$1n<+LVxFCAcaZSXNUL4xQ9-MmzO`Cy^{0oUFTl!Bt9PhCtL z|4_LTi5{gbix=rWj*H43jX(F7cLBnDy>+hz^{EhweBp;M=l>NBhQuIntW?dcvh6QX zN;kwBzf|eM&N43#3^lO|-)fQ!@LAO$0nq?B zSE!?-fmG6bHT$=mMz*d@OsA~M<48C1TQw`_o`g$=g=L%%gMGAPV5KeEU%p8Ue#ZMd z5_Qu#4mkXCK!dHA+>#KlAYsvfehI_s~WW0J2FRBC|-e^4sZ0oGa357-36Tt1afm zW0UmeD`}1h!dZE-8RQFFPWr(+$MjQB`}7I#kPD%N%(@Hhe!!M$eBQspr6RAOD2_w2 zpTar?$?;M{haD>MFHy85go%${8tzQ=-Odm)2enufMGpKSyqof0&+tJ?%zZVJ@O=%9 z0W4K<-sL8}a~JM4DwaG`o8hbA%Vik)KQOxDrsFIh-CT+5XghyMBpK%}(d6f*%ktQ{ zwV4Ni`aUVX9=E#-YOAld<&Y!{Wuv|E$`oPp3lLr^&bx$OS`Sg**qaPW(t5Sa#t(V^Kw)@@&go-+C^1wCt&Bk z4dh2=axdt3?zK!GKz5Zv*{6(cM&+^*f$o`j$*bX(N&4^}w#>Hqk<4+{zrt6=g`ocd D(^NA% diff --git a/pkg/smartcontract/contract.go b/pkg/smartcontract/contract.go index 6f55f08c7..0b12dc3ba 100644 --- a/pkg/smartcontract/contract.go +++ b/pkg/smartcontract/contract.go @@ -30,7 +30,7 @@ func CreateMultiSigRedeemScript(m int, publicKeys keys.PublicKeys) ([]byte, erro } emit.Int(buf.BinWriter, int64(len(publicKeys))) emit.Opcode(buf.BinWriter, opcode.PUSHNULL) - emit.Syscall(buf.BinWriter, "Neo.Crypto.ECDsaCheckMultiSig") + emit.Syscall(buf.BinWriter, "Neo.Crypto.CheckMultisigWithECDsaSecp256r1") return buf.Bytes(), nil } diff --git a/pkg/smartcontract/contract_test.go b/pkg/smartcontract/contract_test.go index 4ea1dae87..889def6be 100644 --- a/pkg/smartcontract/contract_test.go +++ b/pkg/smartcontract/contract_test.go @@ -34,5 +34,5 @@ func TestCreateMultiSigRedeemScript(t *testing.T) { assert.Equal(t, opcode.PUSH3, opcode.Opcode(br.ReadB())) assert.Equal(t, opcode.PUSHNULL, opcode.Opcode(br.ReadB())) assert.Equal(t, opcode.SYSCALL, opcode.Opcode(br.ReadB())) - assert.Equal(t, emit.InteropNameToID([]byte("Neo.Crypto.ECDsaCheckMultiSig")), br.ReadU32LE()) + assert.Equal(t, emit.InteropNameToID([]byte("Neo.Crypto.CheckMultisigWithECDsaSecp256r1")), br.ReadU32LE()) } diff --git a/pkg/vm/contract_checks.go b/pkg/vm/contract_checks.go index 92b12da1f..cd2f83b52 100644 --- a/pkg/vm/contract_checks.go +++ b/pkg/vm/contract_checks.go @@ -11,7 +11,7 @@ import ( var ( verifyInteropID = emit.InteropNameToID([]byte("Neo.Crypto.VerifyWithECDsaSecp256r1")) - multisigInteropID = emit.InteropNameToID([]byte("Neo.Crypto.ECDsaCheckMultiSig")) + multisigInteropID = emit.InteropNameToID([]byte("Neo.Crypto.CheckMultisigWithECDsaSecp256r1")) ) func getNumOfThingsFromInstr(instr opcode.Opcode, param []byte) (int, bool) { diff --git a/pkg/wallet/account_test.go b/pkg/wallet/account_test.go index 836718b8d..84225b413 100644 --- a/pkg/wallet/account_test.go +++ b/pkg/wallet/account_test.go @@ -113,13 +113,13 @@ func TestAccount_ConvertMultisig(t *testing.T) { t.Run("1/1 multisig", func(t *testing.T) { pubs := convertPubs(t, hexs[:1]) require.NoError(t, a.ConvertMultisig(1, pubs)) - require.Equal(t, "NYqxsNMHxDg3T19APYP27mBZFfauC4zngR", a.Address) + require.Equal(t, "NVNvVRW5Q5naSx2k2iZm7xRgtRNGuZppAK", a.Address) }) t.Run("3/4 multisig", func(t *testing.T) { pubs := convertPubs(t, hexs) require.NoError(t, a.ConvertMultisig(3, pubs)) - require.Equal(t, "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", a.Address) + require.Equal(t, "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", a.Address) }) } diff --git a/pkg/wallet/testdata/wallet1.json b/pkg/wallet/testdata/wallet1.json index 70b704d22..de29bf7c7 100644 --- a/pkg/wallet/testdata/wallet1.json +++ b/pkg/wallet/testdata/wallet1.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0", diff --git a/pkg/wallet/testdata/wallet2.json b/pkg/wallet/testdata/wallet2.json index 753d75b45..df0fff3ec 100644 --- a/pkg/wallet/testdata/wallet2.json +++ b/pkg/wallet/testdata/wallet2.json @@ -19,11 +19,11 @@ "isDefault": false }, { - "address": "Nbb1qkwcwNSBs9pAnrVVrnFbWnbWBk91U2", + "address": "NUVPACMnKFhpuHjsRjhUvXz1XhqfGZYVtY", "key": "6PYN7LvaWqBNw7Xb7a52LSbPnP91kyuzYi3HncGvQwQoYAY2W8DncTgpux", "label": "", "contract": { - "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBMHOzuw==", + "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFAtBE43vrw==", "parameters": [ { "name": "parameter0",