core: rename Neo.Crypto.CheckSig interop

This commit is contained in:
Anna Shaleva 2021-05-11 16:32:09 +03:00
parent af16c3e009
commit 366e79b9b8
44 changed files with 283 additions and 289 deletions

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==", "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==", "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
@ -45,7 +45,7 @@
}, },
{ {
"address": "NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF", "address": "NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUF7zmyl", "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7", "address": "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275",
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk", "key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BdHR2qg==", "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk", "key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NQP81vKVRmwZHveX8C9Rbf2qejSpT1W1Eu", "address": "NdypBhqkz2CMMnwxBgvoC9X2XjKF5axgKo",
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK", "key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBdHR2qg==", "script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK", "key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NLA34vf8eXGGUhRjVaYe5f8YsyYHTehbDZ", "address": "NPrB7BmTMYxf9UVroJp4RQExM9tqKmsHTz",
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a", "key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBdHR2qg==", "script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a", "key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -22,7 +22,7 @@ import (
const ( const (
// nftOwnerAddr is the owner of NFT-ND HASHY token (../examples/nft-nd/nft.go) // nftOwnerAddr is the owner of NFT-ND HASHY token (../examples/nft-nd/nft.go)
nftOwnerAddr = "NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S" nftOwnerAddr = "NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB"
nftOwnerWallet = "../examples/my_wallet.json" nftOwnerWallet = "../examples/my_wallet.json"
nftOwnerPass = "qwerty" nftOwnerPass = "qwerty"
) )

View file

@ -52,7 +52,7 @@ func TestNEP17Balance(t *testing.T) {
}) })
t.Run("all accounts", func(t *testing.T) { t.Run("all accounts", func(t *testing.T) {
e.Run(t, cmdbase...) e.Run(t, cmdbase...)
addr1, err := address.StringToUint160("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo") addr1, err := address.StringToUint160("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
require.NoError(t, err) require.NoError(t, err)
e.checkNextLine(t, "^Account "+address.Uint160ToString(addr1)) e.checkNextLine(t, "^Account "+address.Uint160ToString(addr1))
e.checkNextLine(t, "^\\s*GAS:\\s+GasToken \\("+e.Chain.UtilityTokenHash().StringLE()+"\\)") e.checkNextLine(t, "^\\s*GAS:\\s+GasToken \\("+e.Chain.UtilityTokenHash().StringLE()+"\\)")
@ -134,7 +134,7 @@ func TestNEP17Transfer(t *testing.T) {
require.Equal(t, big.NewInt(1), b) require.Equal(t, big.NewInt(1), b)
hVerify := deployVerifyContract(t, e) hVerify := deployVerifyContract(t, e)
const validatorDefault = "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo" const validatorDefault = "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn"
t.Run("default address", func(t *testing.T) { t.Run("default address", func(t *testing.T) {
e.In.WriteString("one\r") e.In.WriteString("one\r")

Binary file not shown.

View file

@ -1,31 +1,30 @@
{ {
"version" : "3.0", "version": "3.0",
"extra" : { "accounts": [
"Tokens" : null
},
"accounts" : [
{ {
"lock" : false, "address": "Nfyz4KcsgYepRJw1W5C2uKCi6QWKf7v6gG",
"isdefault" : false, "key": "6PYVjvHy8n4suq81uxkWqriiffKWFpTFPve57HdzWdDhpYUUYRUTai1jZS",
"key" : "6PYRjaxsdSrW8zBzPynkC9uJRHpkhFHiQTuYY33gNL1wTimTbpN8S8eCNc", "label": "kek",
"address" : "NUSEsqon6PikQA5mDFaV4njemF9Su8JEmf", "contract": {
"contract" : { "script": "DCECl3UyEIq6T5RRIXS6z4tNdZPTzQ7NvXyx7FwK05d9UyZBVuezJw==",
"parameters" : [ "parameters": [
{ {
"type" : "Signature", "name": "parameter0",
"name" : "parameter0" "type": "Signature"
} }
], ],
"script" : "DCECl3UyEIq6T5RRIXS6z4tNdZPTzQ7NvXyx7FwK05d9UyZBdHR2qg==", "deployed": false
"deployed" : false
}, },
"label" : "kek" "lock": false,
"isdefault": false
} }
], ],
"scrypt" : { "scrypt": {
"r" : 8, "n": 16384,
"p" : 8, "r": 8,
"n" : 16384 "p": 8
},
"extra": {
"Tokens": null
} }
} }

View file

@ -1,34 +1,38 @@
{ {
"extra" : {
"Tokens" : null
},
"scrypt" : { "scrypt" : {
"r" : 8,
"p" : 8, "p" : 8,
"r" : 8,
"n" : 16384 "n" : 16384
}, },
"version" : "3.0", "version" : "3.0",
"accounts" : [ "accounts" : [
{ {
"address" : "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
"label" : "",
"lock" : false,
"contract" : { "contract" : {
"parameters" : [ "parameters" : [
{ {
"type" : "Signature", "name" : "parameter0",
"name" : "parameter0" "type" : "Signature"
} }
], ],
"script" : "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==", "deployed" : false,
"deployed" : false "script" : "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw=="
}, },
"lock" : false,
"key" : "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label" : "",
"isdefault" : true, "isdefault" : true,
"key" : "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL" "address" : "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn"
}, },
{ {
"label" : "",
"address" : "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"isdefault" : false, "isdefault" : false,
"key" : "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "address" : "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"lock" : false,
"contract" : { "contract" : {
"deployed" : false,
"script" : "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
"parameters" : [ "parameters" : [
{ {
"name" : "parameter0", "name" : "parameter0",
@ -42,43 +46,39 @@
"type" : "Signature", "type" : "Signature",
"name" : "parameter2" "name" : "parameter2"
} }
], ]
"deployed" : false,
"script" : "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl"
}, },
"lock" : false "label" : "",
"key" : "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY"
}, },
{ {
"address" : "NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF", "key" : "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label" : "", "label" : "",
"contract" : { "contract" : {
"script" : "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUF7zmyl",
"deployed" : false,
"parameters" : [ "parameters" : [
{ {
"name" : "parameter0", "name" : "parameter0",
"type" : "Signature" "type" : "Signature"
} }
], ]
"deployed" : false,
"script" : "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUF7zmyl"
}, },
"lock" : false, "lock" : false,
"isdefault" : false, "address" : "NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF",
"key" : "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL" "isdefault" : false
}, },
{ {
"label" : "acc",
"key" : "6PYUFXrqXyKKPYeG8y3GcjSi9VcJec8E6nHmREbVjCUnrtbJbB3pEfTiLx",
"lock" : false,
"contract" : { "contract" : {
"parameters" : [], "parameters" : [],
"script" : "VwEAEdsgQFcAA0BXAQR4eXp7VBTAcAwOT25ORVAxMVBheW1lbnRoUEGVAW9hIUA=", "deployed" : true,
"deployed" : true "script" : "VwEAEdsgQFcAA0BXAQR4eXp7VBTAcAwOT25ORVAxMVBheW1lbnRoUEGVAW9hIUA="
}, },
"lock" : false,
"isdefault" : false,
"key" : "6PYVxVpeNjxGDFTTG61ARGy6mCz6fQsGm9qW2tsFW3ox1zM6KpCoWSE4PB",
"address" : "NaZjSxmRZ4ErG2QEXCQMjjJfvAxMPiutmi", "address" : "NaZjSxmRZ4ErG2QEXCQMjjJfvAxMPiutmi",
"label" : "acc" "isdefault" : false
} }
], ]
"extra" : { }
"Tokens" : null
}
}

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==", "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -309,7 +309,7 @@ func TestWalletDump(t *testing.T) {
w := new(wallet.Wallet) w := new(wallet.Wallet)
require.NoError(t, json.Unmarshal([]byte(rawStr), w)) require.NoError(t, json.Unmarshal([]byte(rawStr), w))
require.Equal(t, 1, len(w.Accounts)) require.Equal(t, 1, len(w.Accounts))
require.Equal(t, "NUSEsqon6PikQA5mDFaV4njemF9Su8JEmf", w.Accounts[0].Address) require.Equal(t, "Nfyz4KcsgYepRJw1W5C2uKCi6QWKf7v6gG", w.Accounts[0].Address)
t.Run("with decrypt", func(t *testing.T) { t.Run("with decrypt", func(t *testing.T) {
cmd = append(cmd, "--decrypt") cmd = append(cmd, "--decrypt")
@ -324,7 +324,7 @@ func TestWalletDump(t *testing.T) {
w := new(wallet.Wallet) w := new(wallet.Wallet)
require.NoError(t, json.Unmarshal([]byte(rawStr), w)) require.NoError(t, json.Unmarshal([]byte(rawStr), w))
require.Equal(t, 1, len(w.Accounts)) require.Equal(t, 1, len(w.Accounts))
require.Equal(t, "NUSEsqon6PikQA5mDFaV4njemF9Su8JEmf", w.Accounts[0].Address) require.Equal(t, "Nfyz4KcsgYepRJw1W5C2uKCi6QWKf7v6gG", w.Accounts[0].Address)
}) })
} }
@ -334,7 +334,7 @@ func TestDumpKeys(t *testing.T) {
pubRegex := "^0[23][a-hA-H0-9]{64}$" pubRegex := "^0[23][a-hA-H0-9]{64}$"
t.Run("all", func(t *testing.T) { t.Run("all", func(t *testing.T) {
e.Run(t, cmd...) e.Run(t, cmd...)
e.checkNextLine(t, "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo") e.checkNextLine(t, "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
e.checkNextLine(t, pubRegex) e.checkNextLine(t, pubRegex)
e.checkNextLine(t, "^\\s*$") e.checkNextLine(t, "^\\s*$")
e.checkNextLine(t, "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6") e.checkNextLine(t, "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6")
@ -347,7 +347,7 @@ func TestDumpKeys(t *testing.T) {
e.checkEOF(t) e.checkEOF(t)
}) })
t.Run("simple signature", func(t *testing.T) { t.Run("simple signature", func(t *testing.T) {
cmd := append(cmd, "--address", "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo") cmd := append(cmd, "--address", "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
e.Run(t, cmd...) e.Run(t, cmd...)
e.checkNextLine(t, "simple signature contract") e.checkNextLine(t, "simple signature contract")
e.checkNextLine(t, pubRegex) e.checkNextLine(t, pubRegex)

View file

@ -1,30 +1,30 @@
{ {
"version" : "3.0", "version": "3.0",
"scrypt" : { "accounts": [
"p" : 8,
"r" : 8,
"n" : 16384
},
"accounts" : [
{ {
"isdefault" : false, "address": "NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB",
"contract" : { "key": "6PYMKWG2sqfBJ3imGiDyzhiBMviFYgPGQhgehGALkvySJ9kvn4V4FVsceQ",
"parameters" : [ "label": "my_account",
"contract": {
"script": "DCEDhEhWuuSSNuCc7nLsxQhI8nFlt+UfY3oP0/UkYmdH7G5BVuezJw==",
"parameters": [
{ {
"name" : "parameter0", "name": "parameter0",
"type" : "Signature" "type": "Signature"
} }
], ],
"script" : "DCEDhEhWuuSSNuCc7nLsxQhI8nFlt+UfY3oP0/UkYmdH7G5BdHR2qg==", "deployed": false
"deployed" : false
}, },
"key" : "6PYUz1rNSwDf9ad1vxYbJyK93GrnnPBhr819HgSefMvgU1H9QxqVVCZQtN", "lock": false,
"lock" : false, "isdefault": false
"label" : "my_account",
"address" : "NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S"
} }
], ],
"extra" : { "scrypt": {
"Tokens" : null "n": 16384,
"r": 8,
"p": 8
},
"extra": {
"Tokens": null
} }
} }

View file

@ -35,7 +35,7 @@ var (
// contractOwner is a special address that can perform some management // contractOwner is a special address that can perform some management
// functions on this contract like updating/destroying it and can also // functions on this contract like updating/destroying it and can also
// be used for contract address verification. // be used for contract address verification.
contractOwner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S") contractOwner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
) )
// Symbol returns token symbol, it's HASHY. // Symbol returns token symbol, it's HASHY.

View file

@ -7,7 +7,7 @@ import (
var ( var (
// Check if the invoker of the contract is the specified owner // Check if the invoker of the contract is the specified owner
owner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S") owner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
trigger byte trigger byte
) )

View file

@ -16,7 +16,7 @@ var (
// ctx holds storage context for contract methods // ctx holds storage context for contract methods
ctx storage.Context ctx storage.Context
// Check if the invoker of the contract is the specified owner // Check if the invoker of the contract is the specified owner
owner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S") owner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
// ticksKey is a storage key for ticks counter // ticksKey is a storage key for ticks counter
ticksKey = []byte("ticks") ticksKey = []byte("ticks")
) )

View file

@ -13,7 +13,7 @@ const (
) )
var ( var (
owner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S") owner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
trigger byte trigger byte
token TokenConfig token TokenConfig
ctx storage.Context ctx storage.Context

View file

@ -13,7 +13,7 @@ const (
) )
var ( var (
owner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S") owner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
token nep17.Token token nep17.Token
ctx storage.Context ctx storage.Context
) )

View file

@ -14,28 +14,28 @@ type Ktype struct {
// Arr contains a set of known keys in Ktype format. // Arr contains a set of known keys in Ktype format.
var Arr = []Ktype{ var Arr = []Ktype{
{ {
Address: "NQrEVKgpx2qEg6DpVMT5H8kFa7kc2DFgqS", Address: "NPTmAHDxo6Pkyic8Nvu3kwyXoYJCvcCB6i",
PrivateKey: "7d128a6d096f0c14c3a25a2b0c41cf79661bfcb4a8cc95aaaea28bde4d732344", PrivateKey: "7d128a6d096f0c14c3a25a2b0c41cf79661bfcb4a8cc95aaaea28bde4d732344",
PublicKey: "02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef", PublicKey: "02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef",
Wif: "L1QqQJnpBwbsPGAuutuzPTac8piqvbR1HRjrY5qHup48TBCBFe4g", Wif: "L1QqQJnpBwbsPGAuutuzPTac8piqvbR1HRjrY5qHup48TBCBFe4g",
Passphrase: "city of zion", Passphrase: "city of zion",
EncryptedWif: "6PYWaEBMd9UTVFKi1YahYXY5NMLDg9U6w2gpQYUnx8wvaFgdo8EeVPaD7o", EncryptedWif: "6PYUUUFei9PBBfVkSn8q7hFCnewWFRBKPxcn6Kz6Bmk3FqWyLyuTQE2XFH",
}, },
{ {
Address: "NYaVsrMV9GS8aaspRS4odXf1WHZdMmJiPC", Address: "NMBfzaEq2c5zodiNbLPoohVENARMbJim1r",
PrivateKey: "9ab7e154840daca3a2efadaf0df93cd3a5b51768c632f5433f86909d9b994a69", PrivateKey: "9ab7e154840daca3a2efadaf0df93cd3a5b51768c632f5433f86909d9b994a69",
PublicKey: "031d8e1630ce640966967bc6d95223d21f44304133003140c3b52004dc981349c9", PublicKey: "031d8e1630ce640966967bc6d95223d21f44304133003140c3b52004dc981349c9",
Wif: "L2QTooFoDFyRFTxmtiVHt5CfsXfVnexdbENGDkkrrgTTryiLsPMG", Wif: "L2QTooFoDFyRFTxmtiVHt5CfsXfVnexdbENGDkkrrgTTryiLsPMG",
Passphrase: "我的密码", Passphrase: "我的密码",
EncryptedWif: "6PYUpn5uxTpsoawM3YKEWamk2oiKeafQBBK3Vutsowogy8a86jPu71xhE9", EncryptedWif: "6PYUmBuLbdXdnybyNeafUJUrVhoBRZpjHACdY9K2VCNzD5tuX5tXgr9fur",
}, },
{ {
Address: "NWcpK2143ZjgzDYyQJhoKrodJUymHTxPzR", Address: "NfVdwyaJbijrWkRagrvs4eSRQUpP7WpukT",
PrivateKey: "3edee7036b8fd9cef91de47386b191dd76db2888a553e7736bb02808932a915b", PrivateKey: "3edee7036b8fd9cef91de47386b191dd76db2888a553e7736bb02808932a915b",
PublicKey: "02232ce8d2e2063dce0451131851d47421bfc4fc1da4db116fca5302c0756462fa", PublicKey: "02232ce8d2e2063dce0451131851d47421bfc4fc1da4db116fca5302c0756462fa",
Wif: "KyKvWLZsNwBJx5j9nurHYRwhYfdQUu9tTEDsLCUHDbYBL8cHxMiG", Wif: "KyKvWLZsNwBJx5j9nurHYRwhYfdQUu9tTEDsLCUHDbYBL8cHxMiG",
Passphrase: "MyL33tP@33w0rd", Passphrase: "MyL33tP@33w0rd",
EncryptedWif: "6PYRbKt55d4NXxCESqk8n9kURqopvixEY5nhAYe2ZJ4c1oDWAjtFX8hd1M", EncryptedWif: "6PYLQ9oCoEWCfuuHkq6xH4tYbi4Pyv9HYUU8WGkFVXtoczwTbitMjypkma",
}, },
{ {
Address: "NWcpK2143ZjgzDYyQJhoKrodJUymHTxPzR", Address: "NWcpK2143ZjgzDYyQJhoKrodJUymHTxPzR",

View file

@ -89,7 +89,7 @@ func TestSyscallExecution(t *testing.T) {
"storage.Put": {interopnames.SystemStoragePut, []string{sctx, b, b}, true}, "storage.Put": {interopnames.SystemStoragePut, []string{sctx, b, b}, true},
"storage.ConvertContextToReadOnly": {interopnames.SystemStorageAsReadOnly, []string{sctx}, false}, "storage.ConvertContextToReadOnly": {interopnames.SystemStorageAsReadOnly, []string{sctx}, false},
"crypto.CheckMultisig": {interopnames.NeoCryptoCheckMultisig, []string{pubs, sigs}, false}, "crypto.CheckMultisig": {interopnames.NeoCryptoCheckMultisig, []string{pubs, sigs}, false},
"crypto.CheckSig": {interopnames.NeoCryptoCheckSig, []string{pub, sig}, false}, "crypto.CheckSig": {interopnames.SystemCryptoCheckSig, []string{pub, sig}, false},
} }
ic := &interop.Context{} ic := &interop.Context{}
core.SpawnVM(ic) // set Functions field core.SpawnVM(ic) // set Functions field

View file

@ -19,7 +19,7 @@ func TestVerifyGood(t *testing.T) {
src := getVerifyProg(pub, sig) src := getVerifyProg(pub, sig)
v, p := vmAndCompileInterop(t, src) v, p := vmAndCompileInterop(t, src)
p.interops[interopnames.ToID([]byte(interopnames.NeoCryptoCheckSig))] = func(v *vm.VM) error { p.interops[interopnames.ToID([]byte(interopnames.SystemCryptoCheckSig))] = func(v *vm.VM) error {
assert.Equal(t, pub, v.Estack().Pop().Bytes()) assert.Equal(t, pub, v.Estack().Pop().Bytes())
assert.Equal(t, sig, v.Estack().Pop().Bytes()) assert.Equal(t, sig, v.Estack().Pop().Bytes())
v.Estack().PushVal(true) v.Estack().PushVal(true)

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==", "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7", "address": "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275",
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk", "key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BdHR2qg==", "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk", "key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NQP81vKVRmwZHveX8C9Rbf2qejSpT1W1Eu", "address": "NdypBhqkz2CMMnwxBgvoC9X2XjKF5axgKo",
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK", "key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBdHR2qg==", "script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK", "key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NLA34vf8eXGGUhRjVaYe5f8YsyYHTehbDZ", "address": "NPrB7BmTMYxf9UVroJp4RQExM9tqKmsHTz",
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a", "key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBdHR2qg==", "script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a", "key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -269,7 +269,7 @@ func TestCreateBasicChain(t *testing.T) {
require.NoError(t, acc0.SignTx(testchain.Network(), txSendRaw)) require.NoError(t, acc0.SignTx(testchain.Network(), txSendRaw))
bw := io.NewBufBinWriter() bw := io.NewBufBinWriter()
txSendRaw.EncodeBinary(bw.BinWriter) txSendRaw.EncodeBinary(bw.BinWriter)
t.Logf("sendrawtransaction: %s", base64.StdEncoding.EncodeToString(bw.Bytes())) t.Logf("sendrawtransaction: \n\tbase64: %s\n\tHash LE: %s", base64.StdEncoding.EncodeToString(bw.Bytes()), txSendRaw.Hash().StringLE())
require.False(t, saveChain) require.False(t, saveChain)
} }

View file

@ -7,7 +7,7 @@ import (
var ( var (
neoCryptoCheckMultisigID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckMultisig)) neoCryptoCheckMultisigID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckMultisig))
neoCryptoCheckSigID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckSig)) neoCryptoCheckSigID = interopnames.ToID([]byte(interopnames.SystemCryptoCheckSig))
) )
var cryptoInterops = []interop.Function{ var cryptoInterops = []interop.Function{

View file

@ -13,6 +13,7 @@ const (
SystemContractGetCallFlags = "System.Contract.GetCallFlags" SystemContractGetCallFlags = "System.Contract.GetCallFlags"
SystemContractNativeOnPersist = "System.Contract.NativeOnPersist" SystemContractNativeOnPersist = "System.Contract.NativeOnPersist"
SystemContractNativePostPersist = "System.Contract.NativePostPersist" SystemContractNativePostPersist = "System.Contract.NativePostPersist"
SystemCryptoCheckSig = "System.Crypto.CheckSig"
SystemIteratorNext = "System.Iterator.Next" SystemIteratorNext = "System.Iterator.Next"
SystemIteratorValue = "System.Iterator.Value" SystemIteratorValue = "System.Iterator.Value"
SystemRuntimeBurnGas = "System.Runtime.BurnGas" SystemRuntimeBurnGas = "System.Runtime.BurnGas"
@ -37,7 +38,6 @@ const (
SystemStoragePut = "System.Storage.Put" SystemStoragePut = "System.Storage.Put"
SystemStorageAsReadOnly = "System.Storage.AsReadOnly" SystemStorageAsReadOnly = "System.Storage.AsReadOnly"
NeoCryptoCheckMultisig = "Neo.Crypto.CheckMultisig" NeoCryptoCheckMultisig = "Neo.Crypto.CheckMultisig"
NeoCryptoCheckSig = "Neo.Crypto.CheckSig"
) )
var names = []string{ var names = []string{
@ -76,5 +76,5 @@ var names = []string{
SystemStoragePut, SystemStoragePut,
SystemStorageAsReadOnly, SystemStorageAsReadOnly,
NeoCryptoCheckMultisig, NeoCryptoCheckMultisig,
NeoCryptoCheckSig, SystemCryptoCheckSig,
} }

View file

@ -75,7 +75,7 @@ var systemInterops = []interop.Function{
var neoInterops = []interop.Function{ var neoInterops = []interop.Function{
{Name: interopnames.NeoCryptoCheckMultisig, Func: crypto.ECDSASecp256r1CheckMultisig, Price: 0, ParamCount: 2}, {Name: interopnames.NeoCryptoCheckMultisig, Func: crypto.ECDSASecp256r1CheckMultisig, Price: 0, ParamCount: 2},
{Name: interopnames.NeoCryptoCheckSig, Func: crypto.ECDSASecp256r1CheckSig, Price: fee.ECDSAVerifyPrice, ParamCount: 2}, {Name: interopnames.SystemCryptoCheckSig, Func: crypto.ECDSASecp256r1CheckSig, Price: fee.ECDSAVerifyPrice, ParamCount: 2},
} }
// initIDinInteropsSlice initializes IDs from names in one given // initIDinInteropsSlice initializes IDs from names in one given

View file

@ -316,7 +316,7 @@ func (p *PublicKey) GetVerificationScript() []byte {
return buf.Bytes() return buf.Bytes()
} }
emit.Bytes(buf.BinWriter, b) emit.Bytes(buf.BinWriter, b)
emit.Syscall(buf.BinWriter, interopnames.NeoCryptoCheckSig) emit.Syscall(buf.BinWriter, interopnames.SystemCryptoCheckSig)
return buf.Bytes() return buf.Bytes()
} }

View file

@ -111,7 +111,7 @@ func TestPubkeyToAddress(t *testing.T) {
pubKey, err := NewPublicKeyFromString("031ee4e73a17d8f76dc02532e2620bcb12425b33c0c9f9694cc2caa8226b68cad4") pubKey, err := NewPublicKeyFromString("031ee4e73a17d8f76dc02532e2620bcb12425b33c0c9f9694cc2caa8226b68cad4")
require.NoError(t, err) require.NoError(t, err)
actual := pubKey.Address() actual := pubKey.Address()
expected := "NWmVWWvFA6RxvTs4kgY1NnwTXeLYwWxPb1" expected := "NdxG5MZQy8h2qseawfSt8tTYG2iQPTwsn9"
require.Equal(t, expected, actual) require.Equal(t, expected, actual)
} }

View file

@ -16,7 +16,7 @@ func CheckMultisig(pubs []interop.PublicKey, sigs []interop.Signature) bool {
// CheckSig checks that sig is correct signature of the script container // CheckSig checks that sig is correct signature of the script container
// (transaction) for a given pub (serialized public key). It uses // (transaction) for a given pub (serialized public key). It uses
// `Neo.Crypto.CheckSig` syscall. // `System.Crypto.CheckSig` syscall.
func CheckSig(pub interop.PublicKey, sig interop.Signature) bool { func CheckSig(pub interop.PublicKey, sig interop.Signature) bool {
return neogointernal.Syscall2("Neo.Crypto.CheckSig", pub, sig).(bool) return neogointernal.Syscall2("System.Crypto.CheckSig", pub, sig).(bool)
} }

View file

@ -1185,7 +1185,7 @@ var rpcClientErrorCases = map[string][]rpcClientErrorCase{
name: "getnep17transfers_invalid_params_error 2", name: "getnep17transfers_invalid_params_error 2",
invoke: func(c *Client) (interface{}, error) { invoke: func(c *Client) (interface{}, error) {
var stop uint32 var stop uint32
return c.GetNEP17Transfers("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", nil, &stop, nil, nil) return c.GetNEP17Transfers("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", nil, &stop, nil, nil)
}, },
}, },
{ {
@ -1193,7 +1193,7 @@ var rpcClientErrorCases = map[string][]rpcClientErrorCase{
invoke: func(c *Client) (interface{}, error) { invoke: func(c *Client) (interface{}, error) {
var start uint32 var start uint32
var limit int var limit int
return c.GetNEP17Transfers("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", &start, nil, &limit, nil) return c.GetNEP17Transfers("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", &start, nil, &limit, nil)
}, },
}, },
{ {
@ -1201,7 +1201,7 @@ var rpcClientErrorCases = map[string][]rpcClientErrorCase{
invoke: func(c *Client) (interface{}, error) { invoke: func(c *Client) (interface{}, error) {
var start, stop uint32 var start, stop uint32
var page int var page int
return c.GetNEP17Transfers("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", &start, &stop, nil, &page) return c.GetNEP17Transfers("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", &start, &stop, nil, &page)
}, },
}, },
{ {

View file

@ -59,13 +59,13 @@ type rpcTestCase struct {
check func(t *testing.T, e *executor, result interface{}) check func(t *testing.T, e *executor, result interface{})
} }
const testContractHash = "c6ca2347bb84b99807221365c900ec069a265e7c" const testContractHash = "63cc6571e990dd3f345f699fc9c2a6e49edb89af"
const deploymentTxHash = "26692315f71f4790263160c0f570828be77c6927493ae6657a6e5a6a09229eb9" const deploymentTxHash = "c5c341eebe735dc9cec302be94f4082f7a846d2dd6d923a722a84baa10bc8147"
const genesisBlockHash = "5b60644c6c6f58faca72c70689d7ed1f40c2e795772bd0de5a88e983ad55080c" const genesisBlockHash = "5b60644c6c6f58faca72c70689d7ed1f40c2e795772bd0de5a88e983ad55080c"
const verifyContractHash = "5bb4bac40e961e334ba7bd36d2496010f67e246e" const verifyContractHash = "c50082e0d8364d61ce6933bd24027a3363474dce"
const verifyContractAVM = "VwMAQS1RCDAhcAwUVVQtU+0PVUb61E1umZEoZwIvzl7bMHFoE87bKGnbKJdA" const verifyContractAVM = "VwMAQS1RCDAhcAwU7p6iLCfjS9AUj8QQjgj3To9QSLLbMHFoE87bKGnbKJdA"
const verifyWithArgsContractHash = "59b08e81dcf94f6ddbef5c2d84a4c1a098b9a984" const verifyWithArgsContractHash = "8744ffdd07af8e9f18ab90685c8c2ebfd37c6415"
const verifyWithArgsContractAVM = "VwIDeAwLZ29vZF9zdHJpbmeXJA15FSgJehHbIJciBRHbIHBoQA==" const verifyWithArgsContractAVM = "VwIDeAwLZ29vZF9zdHJpbmeXJA15FSgJehHbIJciBRHbIHBoQA=="
const invokescriptContractAVM = "VwcADBQBDAMOBQYMDQIODw0DDgcJAAAAANswcGhB+CfsjCGqJgQRQAwUDQ8DAgkAAgEDBwMEBQIBAA4GDAnbMHFpQfgn7IwhqiYEEkATQA==" const invokescriptContractAVM = "VwcADBQBDAMOBQYMDQIODw0DDgcJAAAAANswcGhB+CfsjCGqJgQRQAwUDQ8DAgkAAgEDBwMEBQIBAA4GDAnbMHFpQfgn7IwhqiYEEkATQA=="
@ -917,13 +917,13 @@ var rpcTestCases = map[string][]rpcTestCase{
"sendrawtransaction": { "sendrawtransaction": {
{ {
name: "positive", name: "positive",
params: `["ADQSAADA2KcAAAAAABDiEgAAAAAAgBYAAAFVVC1T7Q9VRvrUTW6ZkShnAi/OXgEAYBDAAwDodkgXAAAADBRdSe/t0S4+BgGLRljbEKiXX8gLTgwUVVQtU+0PVUb61E1umZEoZwIvzl4UwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQFCDEA0sZMiszaJ/YkG3ZzyFKbE+qujQif0RrlplXpBc5IMzxyM4sPBwvpfGTtDtY9NI8gzR1lVL/O6nzPJG9m8XKjxKAwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CQXR0dqo="]`, params: `["ADQSAADA2KcAAAAAABDiEgAAAAAAgBYAAAHunqIsJ+NL0BSPxBCOCPdOj1BIsgEAYBDAAwDodkgXAAAADBQRJlu0FyUAQb4E6PokDjj1fB5WmwwU7p6iLCfjS9AUj8QQjgj3To9QSLIUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQFCDEBRp0p08GFA2rYC/Xrol8DIhXEMfVMbUJEYer1RqZSatmTjUJE9fnZtDGkQEX/zQ7yOhbnIPAZIrllUTuUBskhUKAwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CQVbnsyc="]`,
result: func(e *executor) interface{} { return &result.RelayResult{} }, result: func(e *executor) interface{} { return &result.RelayResult{} },
check: func(t *testing.T, e *executor, inv interface{}) { check: func(t *testing.T, e *executor, inv interface{}) {
res, ok := inv.(*result.RelayResult) res, ok := inv.(*result.RelayResult)
require.True(t, ok) require.True(t, ok)
expectedHash := util.Uint256{0xaf, 0x80, 0x44, 0x52, 0x49, 0xac, 0xa7, 0xa9, 0x47, 0x11, 0x8, 0xac, 0xdb, 0x59, 0x29, 0xb, 0x3d, 0xac, 0xf2, 0xe9, 0xf7, 0xde, 0x45, 0x79, 0x73, 0x66, 0xe9, 0xb0, 0xd4, 0xc5, 0x6b, 0x97} expectedHash := "8ea251d812fbbdecaebfc164fb6afbd78b7db94f7dacb69421cd5d4e364522d2"
assert.Equal(t, expectedHash, res.Hash) assert.Equal(t, expectedHash, res.Hash.StringLE())
}, },
}, },
{ {
@ -1638,7 +1638,7 @@ func checkNep17Balances(t *testing.T, e *executor, acc interface{}) {
}, },
{ {
Asset: e.chain.UtilityTokenHash(), Asset: e.chain.UtilityTokenHash(),
Amount: "67960042780", Amount: "67960000780",
LastUpdated: 14, LastUpdated: 14,
}}, }},
Address: testchain.PrivateKeyByID(0).GetScriptHash().StringLE(), Address: testchain.PrivateKeyByID(0).GetScriptHash().StringLE(),

Binary file not shown.

View file

@ -6,9 +6,9 @@ import (
) )
// Verify is a verification contract method. // Verify is a verification contract method.
// It returns true iff it is signed by NTh9TnZTstvAePEYWDGLLxidBikJE24uTo (id-0 private key from testchain). // It returns true iff it is signed by Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn (id-0 private key from testchain).
func Verify() bool { func Verify() bool {
tx := runtime.GetScriptContainer() tx := runtime.GetScriptContainer()
addr := util.FromAddress("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo") addr := util.FromAddress("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
return util.Equals(string(tx.Sender), string(addr)) return util.Equals(string(tx.Sender), string(addr))
} }

View file

@ -1,65 +1,64 @@
{ {
"scrypt" : { "version": "3.0",
"n" : 16384, "accounts": [
"r" : 8,
"p" : 8
},
"accounts" : [
{ {
"contract" : { "address": "Nbruchf1SGfar3sN4cPr1UG1bWqADrN5sh",
"parameters" : [ "key": "6PYRC8sNNB5rVx96ezh6Eefw8JcdQPRBfHx7hfe251m4bwHQnH2cZbcRk8",
"label": "",
"contract": {
"script": "DCEDm5PmbOfVPmYXTSVW903XnOhhNBTsF9oDlVYusIH/ui1BVuezJw==",
"parameters": [
{ {
"type" : "Signature", "name": "parameter0",
"name" : "parameter0" "type": "Signature"
} }
], ],
"deployed" : false, "deployed": false
"script" : "DCEDm5PmbOfVPmYXTSVW903XnOhhNBTsF9oDlVYusIH/ui1BdHR2qg=="
}, },
"label" : "NotaryNode1", "lock": false,
"address" : "NS6vb4uE8wdQfcQbFcRY7yquSbwbVcMSV3", "isdefault": false
"isdefault" : false,
"lock" : false,
"key" : "6PYMGBef95jMZJTQcH9ZP5PuecWa2H86HFbdnfe7VQs8uPZ3S6pu4D5NpP"
}, },
{ {
"contract" : { "address": "NiYvEoR2FTD8FmGXtg1WMhkaTS9A6VH7YV",
"script" : "DCEDHRWEIGXHCwUU2Fc7B0qrYPezXR0sfdEduRExyzIKVC9BdHR2qg==", "key": "6PYMecvacj5qTSB771Q9k4wfqTRK4SXSQhmDsDAxZxBgEVJf4BsnrgrQYS",
"deployed" : false, "label": "",
"parameters" : [ "contract": {
"script": "DCEDHRWEIGXHCwUU2Fc7B0qrYPezXR0sfdEduRExyzIKVC9BVuezJw==",
"parameters": [
{ {
"name" : "parameter0", "name": "parameter0",
"type" : "Signature" "type": "Signature"
}
]
},
"label" : "three",
"address" : "NakELwR1i6brB7EmYLc6yPbvk78Qi5Qbpi",
"isdefault" : false,
"lock" : false,
"key" : "6PYLm6kse9FVpKoBbhYYSFHhFUUL2bZYePU95x7Ncknu798WEHYmTuUijR"
},
{
"contract" : {
"parameters" : [
{
"name" : "parameter0",
"type" : "Signature"
} }
], ],
"deployed" : false, "deployed": false
"script" : "DCECmUfs/gqKHd3AdJm5+Ev6zkubV8pP8DZzgu8+t5WdphJBdHR2qg=="
}, },
"key" : "6PYWBWehojbBn8U2XWcXxuWqPrnp9qwQ5rD3RKQza1iR5ZBCPHXxCQonYm", "lock": false,
"isdefault" : false, "isdefault": false
"lock" : false, },
"address" : "NLWXE5CMEqJzEVtscF4BoTvSbiBr1FwtBb", {
"label" : "four" "address": "NcPWfiU7bJkUpBruEQcGRyo91bTWijcUXY",
"key": "6PYWH6sS2JVshBA5ijMAT1CtFbs9LcLuthYoR4eZMD8TyXShD1c2zLsfjC",
"label": "",
"contract": {
"script": "DCECmUfs/gqKHd3AdJm5+Ev6zkubV8pP8DZzgu8+t5WdphJBVuezJw==",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isdefault": false
} }
], ],
"extra" : { "scrypt": {
"Tokens" : null "n": 16384,
"r": 8,
"p": 8
}, },
"version" : "3.0" "extra": {
"Tokens": null
}
} }

View file

@ -1,30 +1,30 @@
{ {
"scrypt" : { "version": "3.0",
"r" : 8, "accounts": [
"p" : 8,
"n" : 16384
},
"version" : "3.0",
"extra" : {
"Tokens" : null
},
"accounts" : [
{ {
"address" : "NYt1oLCMMvqxnAVMJCSk87kZTP693GxK11", "address": "NaVp3ZxwZWA84DRewRjnBLFstaeBuVMKwR",
"key" : "6PYWejAoqoF4JT5P9N3EcqC5tRC1MXx2gZ1R2WWryjDUH1bMAo3Bd68nCo", "key": "6PYK1JEBNRL1jnqpD2Vct9sa5gjSfU5p42zavZBmWmKWR8oKvS5mPzcvqm",
"lock" : false, "label": "",
"isdefault" : false, "contract": {
"contract" : { "script": "DCECIcKj0GFdv4b1NZrw9X6zLNLWzmNKAxtw6olIMZxpPRRBVuezJw==",
"parameters" : [ "parameters": [
{ {
"name" : "parameter0", "name": "parameter0",
"type" : "Signature" "type": "Signature"
} }
], ],
"deployed" : false, "deployed": false
"script" : "DCECIcKj0GFdv4b1NZrw9X6zLNLWzmNKAxtw6olIMZxpPRRBdHR2qg=="
}, },
"label" : "NotaryNode2" "lock": false,
"isdefault": false
} }
] ],
"scrypt": {
"n": 16384,
"r": 8,
"p": 8
},
"extra": {
"Tokens": null
}
} }

View file

@ -1,30 +1,30 @@
{ {
"accounts" : [ "version": "3.0",
"accounts": [
{ {
"address" : "NPcxgUcZorwb1njfRGL7JEyc6SsTku42ek", "address": "NLUCkBS5dtk1h5cedgFoVXqeoCW2UiYNrZ",
"key" : "6PYPy72Gnoif27u9Uy5r2sqMwTTYMLRBGwPcJmB1GP1FTPp4U3M9fZVdtg", "key": "6PYVFexrF2CvxJwx3xpoPchHWJpkrcXy5FZjuXckpArgApVm6AEpQwCuKw",
"lock" : false, "label": "",
"isdefault" : false, "contract": {
"contract" : { "script": "DCEDNxK01e1DnGA+TiGU3H4DKUuGliSz89/NuZCbVvA2u0xBVuezJw==",
"parameters" : [ "parameters": [
{ {
"type" : "Signature", "name": "parameter0",
"name" : "parameter0" "type": "Signature"
} }
], ],
"script" : "DCEDNxK01e1DnGA+TiGU3H4DKUuGliSz89/NuZCbVvA2u0xBdHR2qg==", "deployed": false
"deployed" : false
}, },
"label" : "" "lock": false,
"isdefault": false
} }
], ],
"extra" : { "scrypt": {
"Tokens" : null "n": 16384,
"r": 8,
"p": 8
}, },
"version" : "3.0", "extra": {
"scrypt" : { "Tokens": null
"n" : 16384,
"p" : 8,
"r" : 8
} }
} }

View file

@ -1,30 +1,30 @@
{ {
"version" : "3.0", "version": "3.0",
"extra" : { "accounts": [
"Tokens" : null
},
"accounts" : [
{ {
"isdefault" : false, "address": "NUkatH1cgvBeQyDwfyEjTqZRgjmXC1d23A",
"label" : "", "key": "6PYNvsB8P7Ge5SHth9Ui9ikgkupTfED1g7Ec39gn2YDuuM4LFgQgG4j4i3",
"key" : "6PYTgfwm5kuahFNN391D6p21ivKrHpvr8Wnn1mBpMnavn6PxkK2prSsxye", "label": "",
"address" : "NhSCnPJdgLdxnQaYHmW9A3WFLT9DiicBfK", "contract": {
"lock" : false, "script": "DCEDEXzwIl4Jhvsj98GYIPFFiedeb1QdP8T79uSBSDNsisxBVuezJw==",
"contract" : { "parameters": [
"script" : "DCEDEXzwIl4Jhvsj98GYIPFFiedeb1QdP8T79uSBSDNsisxBdHR2qg==",
"deployed" : false,
"parameters" : [
{ {
"type" : "Signature", "name": "parameter0",
"name" : "parameter0" "type": "Signature"
} }
] ],
} "deployed": false
},
"lock": false,
"isdefault": false
} }
], ],
"scrypt" : { "scrypt": {
"p" : 8, "n": 16384,
"n" : 16384, "r": 8,
"r" : 8 "p": 8
},
"extra": {
"Tokens": null
} }
} }

View file

@ -13,7 +13,7 @@ import (
) )
var ( var (
verifyInteropID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckSig)) verifyInteropID = interopnames.ToID([]byte(interopnames.SystemCryptoCheckSig))
multisigInteropID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckMultisig)) multisigInteropID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckMultisig))
) )

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==", "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",

View file

@ -2,11 +2,11 @@
"version": "3.0", "version": "3.0",
"accounts": [ "accounts": [
{ {
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==", "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",
@ -20,7 +20,7 @@
}, },
{ {
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6", "address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL", "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
"label": "", "label": "",
"contract": { "contract": {
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl", "script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
@ -44,11 +44,11 @@
"isdefault": false "isdefault": false
}, },
{ {
"address": "NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7", "address": "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275",
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk", "key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
"label": "", "label": "",
"contract": { "contract": {
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BdHR2qg==", "script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BVuezJw==",
"parameters": [ "parameters": [
{ {
"name": "parameter0", "name": "parameter0",

View file

@ -188,16 +188,12 @@ func TestWalletGetChangeAddress(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
sh := w1.GetChangeAddress() sh := w1.GetChangeAddress()
// No default address, the first one is used. // No default address, the first one is used.
expected, err := address.StringToUint160("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo") require.Equal(t, "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", address.Uint160ToString(sh))
require.NoError(t, err)
require.Equal(t, expected, sh)
w2, err := NewWalletFromFile("testdata/wallet2.json") w2, err := NewWalletFromFile("testdata/wallet2.json")
require.NoError(t, err) require.NoError(t, err)
sh = w2.GetChangeAddress() sh = w2.GetChangeAddress()
// Default address. // Default address.
expected, err = address.StringToUint160("NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7") require.Equal(t, "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275", address.Uint160ToString(sh))
require.NoError(t, err)
require.Equal(t, expected, sh)
} }
func TestWalletForExamples(t *testing.T) { func TestWalletForExamples(t *testing.T) {
@ -214,5 +210,5 @@ func TestWalletForExamples(t *testing.T) {
require.NoError(t, w.Accounts[0].Decrypt(walletPass)) require.NoError(t, w.Accounts[0].Decrypt(walletPass))
// we need to keep the owner of the example contracts the same as the wallet account // we need to keep the owner of the example contracts the same as the wallet account
require.Equal(t, "NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S", w.Accounts[0].Address, "need to change `owner` in the example contracts") require.Equal(t, "NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB", w.Accounts[0].Address, "need to change `owner` in the example contracts")
} }