forked from TrueCloudLab/neoneo-go
core: rename Neo.Crypto.CheckSig interop
This commit is contained in:
parent
af16c3e009
commit
366e79b9b8
44 changed files with 283 additions and 289 deletions
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==",
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==",
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
@ -45,7 +45,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUF7zmyl",
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7",
|
||||
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk",
|
||||
"address": "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275",
|
||||
"key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BdHR2qg==",
|
||||
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk",
|
||||
"key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NQP81vKVRmwZHveX8C9Rbf2qejSpT1W1Eu",
|
||||
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK",
|
||||
"address": "NdypBhqkz2CMMnwxBgvoC9X2XjKF5axgKo",
|
||||
"key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBdHR2qg==",
|
||||
"script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK",
|
||||
"key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NLA34vf8eXGGUhRjVaYe5f8YsyYHTehbDZ",
|
||||
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a",
|
||||
"address": "NPrB7BmTMYxf9UVroJp4RQExM9tqKmsHTz",
|
||||
"key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBdHR2qg==",
|
||||
"script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a",
|
||||
"key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
|
@ -22,7 +22,7 @@ import (
|
|||
|
||||
const (
|
||||
// nftOwnerAddr is the owner of NFT-ND HASHY token (../examples/nft-nd/nft.go)
|
||||
nftOwnerAddr = "NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S"
|
||||
nftOwnerAddr = "NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB"
|
||||
nftOwnerWallet = "../examples/my_wallet.json"
|
||||
nftOwnerPass = "qwerty"
|
||||
)
|
||||
|
|
|
@ -52,7 +52,7 @@ func TestNEP17Balance(t *testing.T) {
|
|||
})
|
||||
t.Run("all accounts", func(t *testing.T) {
|
||||
e.Run(t, cmdbase...)
|
||||
addr1, err := address.StringToUint160("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo")
|
||||
addr1, err := address.StringToUint160("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
|
||||
require.NoError(t, err)
|
||||
e.checkNextLine(t, "^Account "+address.Uint160ToString(addr1))
|
||||
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)
|
||||
|
||||
hVerify := deployVerifyContract(t, e)
|
||||
const validatorDefault = "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo"
|
||||
const validatorDefault = "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn"
|
||||
|
||||
t.Run("default address", func(t *testing.T) {
|
||||
e.In.WriteString("one\r")
|
||||
|
|
BIN
cli/testdata/chain50x2.acc
vendored
BIN
cli/testdata/chain50x2.acc
vendored
Binary file not shown.
41
cli/testdata/testwallet.json
vendored
41
cli/testdata/testwallet.json
vendored
|
@ -1,31 +1,30 @@
|
|||
{
|
||||
"version" : "3.0",
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
},
|
||||
"accounts" : [
|
||||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"lock" : false,
|
||||
"isdefault" : false,
|
||||
"key" : "6PYRjaxsdSrW8zBzPynkC9uJRHpkhFHiQTuYY33gNL1wTimTbpN8S8eCNc",
|
||||
"address" : "NUSEsqon6PikQA5mDFaV4njemF9Su8JEmf",
|
||||
"contract" : {
|
||||
"parameters" : [
|
||||
"address": "Nfyz4KcsgYepRJw1W5C2uKCi6QWKf7v6gG",
|
||||
"key": "6PYVjvHy8n4suq81uxkWqriiffKWFpTFPve57HdzWdDhpYUUYRUTai1jZS",
|
||||
"label": "kek",
|
||||
"contract": {
|
||||
"script": "DCECl3UyEIq6T5RRIXS6z4tNdZPTzQ7NvXyx7FwK05d9UyZBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"type" : "Signature",
|
||||
"name" : "parameter0"
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
],
|
||||
"script" : "DCECl3UyEIq6T5RRIXS6z4tNdZPTzQ7NvXyx7FwK05d9UyZBdHR2qg==",
|
||||
"deployed" : false
|
||||
"deployed": false
|
||||
},
|
||||
"label" : "kek"
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
}
|
||||
],
|
||||
"scrypt" : {
|
||||
"r" : 8,
|
||||
"p" : 8,
|
||||
"n" : 16384
|
||||
"scrypt": {
|
||||
"n": 16384,
|
||||
"r": 8,
|
||||
"p": 8
|
||||
},
|
||||
"extra": {
|
||||
"Tokens": null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
64
cli/testdata/wallet1_solo.json
vendored
64
cli/testdata/wallet1_solo.json
vendored
|
@ -1,34 +1,38 @@
|
|||
{
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
},
|
||||
"scrypt" : {
|
||||
"r" : 8,
|
||||
"p" : 8,
|
||||
"r" : 8,
|
||||
"n" : 16384
|
||||
},
|
||||
"version" : "3.0",
|
||||
"accounts" : [
|
||||
{
|
||||
"address" : "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
|
||||
"label" : "",
|
||||
"lock" : false,
|
||||
"contract" : {
|
||||
"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,
|
||||
"key" : "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL"
|
||||
"address" : "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn"
|
||||
},
|
||||
{
|
||||
"label" : "",
|
||||
"address" : "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"isdefault" : false,
|
||||
"key" : "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"address" : "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"lock" : false,
|
||||
"contract" : {
|
||||
"deployed" : false,
|
||||
"script" : "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
"parameters" : [
|
||||
{
|
||||
"name" : "parameter0",
|
||||
|
@ -42,43 +46,39 @@
|
|||
"type" : "Signature",
|
||||
"name" : "parameter2"
|
||||
}
|
||||
],
|
||||
"deployed" : false,
|
||||
"script" : "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl"
|
||||
]
|
||||
},
|
||||
"lock" : false
|
||||
"label" : "",
|
||||
"key" : "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY"
|
||||
},
|
||||
{
|
||||
"address" : "NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF",
|
||||
"key" : "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label" : "",
|
||||
"contract" : {
|
||||
"script" : "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUF7zmyl",
|
||||
"deployed" : false,
|
||||
"parameters" : [
|
||||
{
|
||||
"name" : "parameter0",
|
||||
"type" : "Signature"
|
||||
}
|
||||
],
|
||||
"deployed" : false,
|
||||
"script" : "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUF7zmyl"
|
||||
]
|
||||
},
|
||||
"lock" : false,
|
||||
"isdefault" : false,
|
||||
"key" : "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL"
|
||||
"address" : "NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF",
|
||||
"isdefault" : false
|
||||
},
|
||||
{
|
||||
"label" : "acc",
|
||||
"key" : "6PYUFXrqXyKKPYeG8y3GcjSi9VcJec8E6nHmREbVjCUnrtbJbB3pEfTiLx",
|
||||
"lock" : false,
|
||||
"contract" : {
|
||||
"parameters" : [],
|
||||
"script" : "VwEAEdsgQFcAA0BXAQR4eXp7VBTAcAwOT25ORVAxMVBheW1lbnRoUEGVAW9hIUA=",
|
||||
"deployed" : true
|
||||
"deployed" : true,
|
||||
"script" : "VwEAEdsgQFcAA0BXAQR4eXp7VBTAcAwOT25ORVAxMVBheW1lbnRoUEGVAW9hIUA="
|
||||
},
|
||||
"lock" : false,
|
||||
"isdefault" : false,
|
||||
"key" : "6PYVxVpeNjxGDFTTG61ARGy6mCz6fQsGm9qW2tsFW3ox1zM6KpCoWSE4PB",
|
||||
"address" : "NaZjSxmRZ4ErG2QEXCQMjjJfvAxMPiutmi",
|
||||
"label" : "acc"
|
||||
"isdefault" : false
|
||||
}
|
||||
],
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
}
|
||||
]
|
||||
}
|
8
cli/testdata/wallets/testwallet_NEO3.json
vendored
8
cli/testdata/wallets/testwallet_NEO3.json
vendored
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==",
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
|
@ -309,7 +309,7 @@ func TestWalletDump(t *testing.T) {
|
|||
w := new(wallet.Wallet)
|
||||
require.NoError(t, json.Unmarshal([]byte(rawStr), w))
|
||||
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) {
|
||||
cmd = append(cmd, "--decrypt")
|
||||
|
@ -324,7 +324,7 @@ func TestWalletDump(t *testing.T) {
|
|||
w := new(wallet.Wallet)
|
||||
require.NoError(t, json.Unmarshal([]byte(rawStr), w))
|
||||
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}$"
|
||||
t.Run("all", func(t *testing.T) {
|
||||
e.Run(t, cmd...)
|
||||
e.checkNextLine(t, "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo")
|
||||
e.checkNextLine(t, "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
|
||||
e.checkNextLine(t, pubRegex)
|
||||
e.checkNextLine(t, "^\\s*$")
|
||||
e.checkNextLine(t, "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6")
|
||||
|
@ -347,7 +347,7 @@ func TestDumpKeys(t *testing.T) {
|
|||
e.checkEOF(t)
|
||||
})
|
||||
t.Run("simple signature", func(t *testing.T) {
|
||||
cmd := append(cmd, "--address", "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo")
|
||||
cmd := append(cmd, "--address", "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
|
||||
e.Run(t, cmd...)
|
||||
e.checkNextLine(t, "simple signature contract")
|
||||
e.checkNextLine(t, pubRegex)
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
{
|
||||
"version" : "3.0",
|
||||
"scrypt" : {
|
||||
"p" : 8,
|
||||
"r" : 8,
|
||||
"n" : 16384
|
||||
},
|
||||
"accounts" : [
|
||||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"isdefault" : false,
|
||||
"contract" : {
|
||||
"parameters" : [
|
||||
"address": "NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB",
|
||||
"key": "6PYMKWG2sqfBJ3imGiDyzhiBMviFYgPGQhgehGALkvySJ9kvn4V4FVsceQ",
|
||||
"label": "my_account",
|
||||
"contract": {
|
||||
"script": "DCEDhEhWuuSSNuCc7nLsxQhI8nFlt+UfY3oP0/UkYmdH7G5BVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name" : "parameter0",
|
||||
"type" : "Signature"
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
],
|
||||
"script" : "DCEDhEhWuuSSNuCc7nLsxQhI8nFlt+UfY3oP0/UkYmdH7G5BdHR2qg==",
|
||||
"deployed" : false
|
||||
"deployed": false
|
||||
},
|
||||
"key" : "6PYUz1rNSwDf9ad1vxYbJyK93GrnnPBhr819HgSefMvgU1H9QxqVVCZQtN",
|
||||
"lock" : false,
|
||||
"label" : "my_account",
|
||||
"address" : "NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S"
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
}
|
||||
],
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
"scrypt": {
|
||||
"n": 16384,
|
||||
"r": 8,
|
||||
"p": 8
|
||||
},
|
||||
"extra": {
|
||||
"Tokens": null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ var (
|
|||
// contractOwner is a special address that can perform some management
|
||||
// functions on this contract like updating/destroying it and can also
|
||||
// be used for contract address verification.
|
||||
contractOwner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S")
|
||||
contractOwner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
|
||||
)
|
||||
|
||||
// Symbol returns token symbol, it's HASHY.
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
var (
|
||||
// Check if the invoker of the contract is the specified owner
|
||||
owner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S")
|
||||
owner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
|
||||
trigger byte
|
||||
)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ var (
|
|||
// ctx holds storage context for contract methods
|
||||
ctx storage.Context
|
||||
// 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 = []byte("ticks")
|
||||
)
|
||||
|
|
|
@ -13,7 +13,7 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
owner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S")
|
||||
owner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
|
||||
trigger byte
|
||||
token TokenConfig
|
||||
ctx storage.Context
|
||||
|
|
|
@ -13,7 +13,7 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
owner = util.FromAddress("NX1yL5wDx3inK2qUVLRVaqCLUxYnAbv85S")
|
||||
owner = util.FromAddress("NbrUYaZgyhSkNoRo9ugRyEMdUZxrhkNaWB")
|
||||
token nep17.Token
|
||||
ctx storage.Context
|
||||
)
|
||||
|
|
|
@ -14,28 +14,28 @@ type Ktype struct {
|
|||
// Arr contains a set of known keys in Ktype format.
|
||||
var Arr = []Ktype{
|
||||
{
|
||||
Address: "NQrEVKgpx2qEg6DpVMT5H8kFa7kc2DFgqS",
|
||||
Address: "NPTmAHDxo6Pkyic8Nvu3kwyXoYJCvcCB6i",
|
||||
PrivateKey: "7d128a6d096f0c14c3a25a2b0c41cf79661bfcb4a8cc95aaaea28bde4d732344",
|
||||
PublicKey: "02028a99826edc0c97d18e22b6932373d908d323aa7f92656a77ec26e8861699ef",
|
||||
Wif: "L1QqQJnpBwbsPGAuutuzPTac8piqvbR1HRjrY5qHup48TBCBFe4g",
|
||||
Passphrase: "city of zion",
|
||||
EncryptedWif: "6PYWaEBMd9UTVFKi1YahYXY5NMLDg9U6w2gpQYUnx8wvaFgdo8EeVPaD7o",
|
||||
EncryptedWif: "6PYUUUFei9PBBfVkSn8q7hFCnewWFRBKPxcn6Kz6Bmk3FqWyLyuTQE2XFH",
|
||||
},
|
||||
{
|
||||
Address: "NYaVsrMV9GS8aaspRS4odXf1WHZdMmJiPC",
|
||||
Address: "NMBfzaEq2c5zodiNbLPoohVENARMbJim1r",
|
||||
PrivateKey: "9ab7e154840daca3a2efadaf0df93cd3a5b51768c632f5433f86909d9b994a69",
|
||||
PublicKey: "031d8e1630ce640966967bc6d95223d21f44304133003140c3b52004dc981349c9",
|
||||
Wif: "L2QTooFoDFyRFTxmtiVHt5CfsXfVnexdbENGDkkrrgTTryiLsPMG",
|
||||
Passphrase: "我的密码",
|
||||
EncryptedWif: "6PYUpn5uxTpsoawM3YKEWamk2oiKeafQBBK3Vutsowogy8a86jPu71xhE9",
|
||||
EncryptedWif: "6PYUmBuLbdXdnybyNeafUJUrVhoBRZpjHACdY9K2VCNzD5tuX5tXgr9fur",
|
||||
},
|
||||
{
|
||||
Address: "NWcpK2143ZjgzDYyQJhoKrodJUymHTxPzR",
|
||||
Address: "NfVdwyaJbijrWkRagrvs4eSRQUpP7WpukT",
|
||||
PrivateKey: "3edee7036b8fd9cef91de47386b191dd76db2888a553e7736bb02808932a915b",
|
||||
PublicKey: "02232ce8d2e2063dce0451131851d47421bfc4fc1da4db116fca5302c0756462fa",
|
||||
Wif: "KyKvWLZsNwBJx5j9nurHYRwhYfdQUu9tTEDsLCUHDbYBL8cHxMiG",
|
||||
Passphrase: "MyL33tP@33w0rd",
|
||||
EncryptedWif: "6PYRbKt55d4NXxCESqk8n9kURqopvixEY5nhAYe2ZJ4c1oDWAjtFX8hd1M",
|
||||
EncryptedWif: "6PYLQ9oCoEWCfuuHkq6xH4tYbi4Pyv9HYUU8WGkFVXtoczwTbitMjypkma",
|
||||
},
|
||||
{
|
||||
Address: "NWcpK2143ZjgzDYyQJhoKrodJUymHTxPzR",
|
||||
|
|
|
@ -89,7 +89,7 @@ func TestSyscallExecution(t *testing.T) {
|
|||
"storage.Put": {interopnames.SystemStoragePut, []string{sctx, b, b}, true},
|
||||
"storage.ConvertContextToReadOnly": {interopnames.SystemStorageAsReadOnly, []string{sctx}, 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{}
|
||||
core.SpawnVM(ic) // set Functions field
|
||||
|
|
|
@ -19,7 +19,7 @@ func TestVerifyGood(t *testing.T) {
|
|||
src := getVerifyProg(pub, sig)
|
||||
|
||||
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, sig, v.Estack().Pop().Bytes())
|
||||
v.Estack().PushVal(true)
|
||||
|
|
8
pkg/consensus/testdata/wallet1.json
vendored
8
pkg/consensus/testdata/wallet1.json
vendored
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==",
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
8
pkg/consensus/testdata/wallet2.json
vendored
8
pkg/consensus/testdata/wallet2.json
vendored
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7",
|
||||
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk",
|
||||
"address": "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275",
|
||||
"key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BdHR2qg==",
|
||||
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk",
|
||||
"key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
8
pkg/consensus/testdata/wallet3.json
vendored
8
pkg/consensus/testdata/wallet3.json
vendored
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NQP81vKVRmwZHveX8C9Rbf2qejSpT1W1Eu",
|
||||
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK",
|
||||
"address": "NdypBhqkz2CMMnwxBgvoC9X2XjKF5axgKo",
|
||||
"key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBdHR2qg==",
|
||||
"script": "DCED2QwH32PmkM53kS4Qq1GsyUS2aGAje2CMT4+DCece5plBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYScv3Vgvdi9EkhDNvHXdvQeuaXK9gRwXDmytCswZMNpTzMLvfgR3U5dK",
|
||||
"key": "6PYVxMnzPMFTYY16xRvXm2SJcvaChabLzaARAb1Mmej9U7rYLYWMSPtfam",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
8
pkg/consensus/testdata/wallet4.json
vendored
8
pkg/consensus/testdata/wallet4.json
vendored
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NLA34vf8eXGGUhRjVaYe5f8YsyYHTehbDZ",
|
||||
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a",
|
||||
"address": "NPrB7BmTMYxf9UVroJp4RQExM9tqKmsHTz",
|
||||
"key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBdHR2qg==",
|
||||
"script": "DCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYVwp1Sdg9DfTzvg42PZxgzMDf5a5FYBgT6ynKKzwmSHuhGkipoNjyW3a",
|
||||
"key": "6PYX8eELiDduPW3RGiZxZNmG6KtWtXkyRFi47f8w6quEBpRkpBPxH5u5AP",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
|
@ -269,7 +269,7 @@ func TestCreateBasicChain(t *testing.T) {
|
|||
require.NoError(t, acc0.SignTx(testchain.Network(), txSendRaw))
|
||||
bw := io.NewBufBinWriter()
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
var (
|
||||
neoCryptoCheckMultisigID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckMultisig))
|
||||
neoCryptoCheckSigID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckSig))
|
||||
neoCryptoCheckSigID = interopnames.ToID([]byte(interopnames.SystemCryptoCheckSig))
|
||||
)
|
||||
|
||||
var cryptoInterops = []interop.Function{
|
||||
|
|
|
@ -13,6 +13,7 @@ const (
|
|||
SystemContractGetCallFlags = "System.Contract.GetCallFlags"
|
||||
SystemContractNativeOnPersist = "System.Contract.NativeOnPersist"
|
||||
SystemContractNativePostPersist = "System.Contract.NativePostPersist"
|
||||
SystemCryptoCheckSig = "System.Crypto.CheckSig"
|
||||
SystemIteratorNext = "System.Iterator.Next"
|
||||
SystemIteratorValue = "System.Iterator.Value"
|
||||
SystemRuntimeBurnGas = "System.Runtime.BurnGas"
|
||||
|
@ -37,7 +38,6 @@ const (
|
|||
SystemStoragePut = "System.Storage.Put"
|
||||
SystemStorageAsReadOnly = "System.Storage.AsReadOnly"
|
||||
NeoCryptoCheckMultisig = "Neo.Crypto.CheckMultisig"
|
||||
NeoCryptoCheckSig = "Neo.Crypto.CheckSig"
|
||||
)
|
||||
|
||||
var names = []string{
|
||||
|
@ -76,5 +76,5 @@ var names = []string{
|
|||
SystemStoragePut,
|
||||
SystemStorageAsReadOnly,
|
||||
NeoCryptoCheckMultisig,
|
||||
NeoCryptoCheckSig,
|
||||
SystemCryptoCheckSig,
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ var systemInterops = []interop.Function{
|
|||
|
||||
var neoInterops = []interop.Function{
|
||||
{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
|
||||
|
|
|
@ -316,7 +316,7 @@ func (p *PublicKey) GetVerificationScript() []byte {
|
|||
return buf.Bytes()
|
||||
}
|
||||
emit.Bytes(buf.BinWriter, b)
|
||||
emit.Syscall(buf.BinWriter, interopnames.NeoCryptoCheckSig)
|
||||
emit.Syscall(buf.BinWriter, interopnames.SystemCryptoCheckSig)
|
||||
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ func TestPubkeyToAddress(t *testing.T) {
|
|||
pubKey, err := NewPublicKeyFromString("031ee4e73a17d8f76dc02532e2620bcb12425b33c0c9f9694cc2caa8226b68cad4")
|
||||
require.NoError(t, err)
|
||||
actual := pubKey.Address()
|
||||
expected := "NWmVWWvFA6RxvTs4kgY1NnwTXeLYwWxPb1"
|
||||
expected := "NdxG5MZQy8h2qseawfSt8tTYG2iQPTwsn9"
|
||||
require.Equal(t, expected, actual)
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ func CheckMultisig(pubs []interop.PublicKey, sigs []interop.Signature) bool {
|
|||
|
||||
// CheckSig checks that sig is correct signature of the script container
|
||||
// (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 {
|
||||
return neogointernal.Syscall2("Neo.Crypto.CheckSig", pub, sig).(bool)
|
||||
return neogointernal.Syscall2("System.Crypto.CheckSig", pub, sig).(bool)
|
||||
}
|
||||
|
|
|
@ -1185,7 +1185,7 @@ var rpcClientErrorCases = map[string][]rpcClientErrorCase{
|
|||
name: "getnep17transfers_invalid_params_error 2",
|
||||
invoke: func(c *Client) (interface{}, error) {
|
||||
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) {
|
||||
var start uint32
|
||||
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) {
|
||||
var start, stop uint32
|
||||
var page int
|
||||
return c.GetNEP17Transfers("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo", &start, &stop, nil, &page)
|
||||
return c.GetNEP17Transfers("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", &start, &stop, nil, &page)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -59,13 +59,13 @@ type rpcTestCase struct {
|
|||
check func(t *testing.T, e *executor, result interface{})
|
||||
}
|
||||
|
||||
const testContractHash = "c6ca2347bb84b99807221365c900ec069a265e7c"
|
||||
const deploymentTxHash = "26692315f71f4790263160c0f570828be77c6927493ae6657a6e5a6a09229eb9"
|
||||
const testContractHash = "63cc6571e990dd3f345f699fc9c2a6e49edb89af"
|
||||
const deploymentTxHash = "c5c341eebe735dc9cec302be94f4082f7a846d2dd6d923a722a84baa10bc8147"
|
||||
const genesisBlockHash = "5b60644c6c6f58faca72c70689d7ed1f40c2e795772bd0de5a88e983ad55080c"
|
||||
|
||||
const verifyContractHash = "5bb4bac40e961e334ba7bd36d2496010f67e246e"
|
||||
const verifyContractAVM = "VwMAQS1RCDAhcAwUVVQtU+0PVUb61E1umZEoZwIvzl7bMHFoE87bKGnbKJdA"
|
||||
const verifyWithArgsContractHash = "59b08e81dcf94f6ddbef5c2d84a4c1a098b9a984"
|
||||
const verifyContractHash = "c50082e0d8364d61ce6933bd24027a3363474dce"
|
||||
const verifyContractAVM = "VwMAQS1RCDAhcAwU7p6iLCfjS9AUj8QQjgj3To9QSLLbMHFoE87bKGnbKJdA"
|
||||
const verifyWithArgsContractHash = "8744ffdd07af8e9f18ab90685c8c2ebfd37c6415"
|
||||
const verifyWithArgsContractAVM = "VwIDeAwLZ29vZF9zdHJpbmeXJA15FSgJehHbIJciBRHbIHBoQA=="
|
||||
const invokescriptContractAVM = "VwcADBQBDAMOBQYMDQIODw0DDgcJAAAAANswcGhB+CfsjCGqJgQRQAwUDQ8DAgkAAgEDBwMEBQIBAA4GDAnbMHFpQfgn7IwhqiYEEkATQA=="
|
||||
|
||||
|
@ -917,13 +917,13 @@ var rpcTestCases = map[string][]rpcTestCase{
|
|||
"sendrawtransaction": {
|
||||
{
|
||||
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{} },
|
||||
check: func(t *testing.T, e *executor, inv interface{}) {
|
||||
res, ok := inv.(*result.RelayResult)
|
||||
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}
|
||||
assert.Equal(t, expectedHash, res.Hash)
|
||||
expectedHash := "8ea251d812fbbdecaebfc164fb6afbd78b7db94f7dacb69421cd5d4e364522d2"
|
||||
assert.Equal(t, expectedHash, res.Hash.StringLE())
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -1638,7 +1638,7 @@ func checkNep17Balances(t *testing.T, e *executor, acc interface{}) {
|
|||
},
|
||||
{
|
||||
Asset: e.chain.UtilityTokenHash(),
|
||||
Amount: "67960042780",
|
||||
Amount: "67960000780",
|
||||
LastUpdated: 14,
|
||||
}},
|
||||
Address: testchain.PrivateKeyByID(0).GetScriptHash().StringLE(),
|
||||
|
|
BIN
pkg/rpc/server/testdata/testblocks.acc
vendored
BIN
pkg/rpc/server/testdata/testblocks.acc
vendored
Binary file not shown.
|
@ -6,9 +6,9 @@ import (
|
|||
)
|
||||
|
||||
// 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 {
|
||||
tx := runtime.GetScriptContainer()
|
||||
addr := util.FromAddress("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo")
|
||||
addr := util.FromAddress("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
|
||||
return util.Equals(string(tx.Sender), string(addr))
|
||||
}
|
||||
|
|
97
pkg/services/notary/testdata/notary1.json
vendored
97
pkg/services/notary/testdata/notary1.json
vendored
|
@ -1,65 +1,64 @@
|
|||
{
|
||||
"scrypt" : {
|
||||
"n" : 16384,
|
||||
"r" : 8,
|
||||
"p" : 8
|
||||
},
|
||||
"accounts" : [
|
||||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"contract" : {
|
||||
"parameters" : [
|
||||
"address": "Nbruchf1SGfar3sN4cPr1UG1bWqADrN5sh",
|
||||
"key": "6PYRC8sNNB5rVx96ezh6Eefw8JcdQPRBfHx7hfe251m4bwHQnH2cZbcRk8",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCEDm5PmbOfVPmYXTSVW903XnOhhNBTsF9oDlVYusIH/ui1BVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"type" : "Signature",
|
||||
"name" : "parameter0"
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
],
|
||||
"deployed" : false,
|
||||
"script" : "DCEDm5PmbOfVPmYXTSVW903XnOhhNBTsF9oDlVYusIH/ui1BdHR2qg=="
|
||||
"deployed": false
|
||||
},
|
||||
"label" : "NotaryNode1",
|
||||
"address" : "NS6vb4uE8wdQfcQbFcRY7yquSbwbVcMSV3",
|
||||
"isdefault" : false,
|
||||
"lock" : false,
|
||||
"key" : "6PYMGBef95jMZJTQcH9ZP5PuecWa2H86HFbdnfe7VQs8uPZ3S6pu4D5NpP"
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
},
|
||||
{
|
||||
"contract" : {
|
||||
"script" : "DCEDHRWEIGXHCwUU2Fc7B0qrYPezXR0sfdEduRExyzIKVC9BdHR2qg==",
|
||||
"deployed" : false,
|
||||
"parameters" : [
|
||||
"address": "NiYvEoR2FTD8FmGXtg1WMhkaTS9A6VH7YV",
|
||||
"key": "6PYMecvacj5qTSB771Q9k4wfqTRK4SXSQhmDsDAxZxBgEVJf4BsnrgrQYS",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCEDHRWEIGXHCwUU2Fc7B0qrYPezXR0sfdEduRExyzIKVC9BVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name" : "parameter0",
|
||||
"type" : "Signature"
|
||||
}
|
||||
]
|
||||
},
|
||||
"label" : "three",
|
||||
"address" : "NakELwR1i6brB7EmYLc6yPbvk78Qi5Qbpi",
|
||||
"isdefault" : false,
|
||||
"lock" : false,
|
||||
"key" : "6PYLm6kse9FVpKoBbhYYSFHhFUUL2bZYePU95x7Ncknu798WEHYmTuUijR"
|
||||
},
|
||||
{
|
||||
"contract" : {
|
||||
"parameters" : [
|
||||
{
|
||||
"name" : "parameter0",
|
||||
"type" : "Signature"
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
],
|
||||
"deployed" : false,
|
||||
"script" : "DCECmUfs/gqKHd3AdJm5+Ev6zkubV8pP8DZzgu8+t5WdphJBdHR2qg=="
|
||||
"deployed": false
|
||||
},
|
||||
"key" : "6PYWBWehojbBn8U2XWcXxuWqPrnp9qwQ5rD3RKQza1iR5ZBCPHXxCQonYm",
|
||||
"isdefault" : false,
|
||||
"lock" : false,
|
||||
"address" : "NLWXE5CMEqJzEVtscF4BoTvSbiBr1FwtBb",
|
||||
"label" : "four"
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
},
|
||||
{
|
||||
"address": "NcPWfiU7bJkUpBruEQcGRyo91bTWijcUXY",
|
||||
"key": "6PYWH6sS2JVshBA5ijMAT1CtFbs9LcLuthYoR4eZMD8TyXShD1c2zLsfjC",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECmUfs/gqKHd3AdJm5+Ev6zkubV8pP8DZzgu8+t5WdphJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
],
|
||||
"deployed": false
|
||||
},
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
}
|
||||
],
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
"scrypt": {
|
||||
"n": 16384,
|
||||
"r": 8,
|
||||
"p": 8
|
||||
},
|
||||
"version" : "3.0"
|
||||
"extra": {
|
||||
"Tokens": null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
44
pkg/services/notary/testdata/notary2.json
vendored
44
pkg/services/notary/testdata/notary2.json
vendored
|
@ -1,30 +1,30 @@
|
|||
{
|
||||
"scrypt" : {
|
||||
"r" : 8,
|
||||
"p" : 8,
|
||||
"n" : 16384
|
||||
},
|
||||
"version" : "3.0",
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
},
|
||||
"accounts" : [
|
||||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address" : "NYt1oLCMMvqxnAVMJCSk87kZTP693GxK11",
|
||||
"key" : "6PYWejAoqoF4JT5P9N3EcqC5tRC1MXx2gZ1R2WWryjDUH1bMAo3Bd68nCo",
|
||||
"lock" : false,
|
||||
"isdefault" : false,
|
||||
"contract" : {
|
||||
"parameters" : [
|
||||
"address": "NaVp3ZxwZWA84DRewRjnBLFstaeBuVMKwR",
|
||||
"key": "6PYK1JEBNRL1jnqpD2Vct9sa5gjSfU5p42zavZBmWmKWR8oKvS5mPzcvqm",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECIcKj0GFdv4b1NZrw9X6zLNLWzmNKAxtw6olIMZxpPRRBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name" : "parameter0",
|
||||
"type" : "Signature"
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
],
|
||||
"deployed" : false,
|
||||
"script" : "DCECIcKj0GFdv4b1NZrw9X6zLNLWzmNKAxtw6olIMZxpPRRBdHR2qg=="
|
||||
"deployed": false
|
||||
},
|
||||
"label" : "NotaryNode2"
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
}
|
||||
]
|
||||
],
|
||||
"scrypt": {
|
||||
"n": 16384,
|
||||
"r": 8,
|
||||
"p": 8
|
||||
},
|
||||
"extra": {
|
||||
"Tokens": null
|
||||
}
|
||||
}
|
||||
|
|
38
pkg/services/oracle/testdata/oracle1.json
vendored
38
pkg/services/oracle/testdata/oracle1.json
vendored
|
@ -1,30 +1,30 @@
|
|||
{
|
||||
"accounts" : [
|
||||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address" : "NPcxgUcZorwb1njfRGL7JEyc6SsTku42ek",
|
||||
"key" : "6PYPy72Gnoif27u9Uy5r2sqMwTTYMLRBGwPcJmB1GP1FTPp4U3M9fZVdtg",
|
||||
"lock" : false,
|
||||
"isdefault" : false,
|
||||
"contract" : {
|
||||
"parameters" : [
|
||||
"address": "NLUCkBS5dtk1h5cedgFoVXqeoCW2UiYNrZ",
|
||||
"key": "6PYVFexrF2CvxJwx3xpoPchHWJpkrcXy5FZjuXckpArgApVm6AEpQwCuKw",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCEDNxK01e1DnGA+TiGU3H4DKUuGliSz89/NuZCbVvA2u0xBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"type" : "Signature",
|
||||
"name" : "parameter0"
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
],
|
||||
"script" : "DCEDNxK01e1DnGA+TiGU3H4DKUuGliSz89/NuZCbVvA2u0xBdHR2qg==",
|
||||
"deployed" : false
|
||||
"deployed": false
|
||||
},
|
||||
"label" : ""
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
}
|
||||
],
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
"scrypt": {
|
||||
"n": 16384,
|
||||
"r": 8,
|
||||
"p": 8
|
||||
},
|
||||
"version" : "3.0",
|
||||
"scrypt" : {
|
||||
"n" : 16384,
|
||||
"p" : 8,
|
||||
"r" : 8
|
||||
"extra": {
|
||||
"Tokens": null
|
||||
}
|
||||
}
|
||||
|
|
44
pkg/services/oracle/testdata/oracle2.json
vendored
44
pkg/services/oracle/testdata/oracle2.json
vendored
|
@ -1,30 +1,30 @@
|
|||
{
|
||||
"version" : "3.0",
|
||||
"extra" : {
|
||||
"Tokens" : null
|
||||
},
|
||||
"accounts" : [
|
||||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"isdefault" : false,
|
||||
"label" : "",
|
||||
"key" : "6PYTgfwm5kuahFNN391D6p21ivKrHpvr8Wnn1mBpMnavn6PxkK2prSsxye",
|
||||
"address" : "NhSCnPJdgLdxnQaYHmW9A3WFLT9DiicBfK",
|
||||
"lock" : false,
|
||||
"contract" : {
|
||||
"script" : "DCEDEXzwIl4Jhvsj98GYIPFFiedeb1QdP8T79uSBSDNsisxBdHR2qg==",
|
||||
"deployed" : false,
|
||||
"parameters" : [
|
||||
"address": "NUkatH1cgvBeQyDwfyEjTqZRgjmXC1d23A",
|
||||
"key": "6PYNvsB8P7Ge5SHth9Ui9ikgkupTfED1g7Ec39gn2YDuuM4LFgQgG4j4i3",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCEDEXzwIl4Jhvsj98GYIPFFiedeb1QdP8T79uSBSDNsisxBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"type" : "Signature",
|
||||
"name" : "parameter0"
|
||||
"name": "parameter0",
|
||||
"type": "Signature"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"deployed": false
|
||||
},
|
||||
"lock": false,
|
||||
"isdefault": false
|
||||
}
|
||||
],
|
||||
"scrypt" : {
|
||||
"p" : 8,
|
||||
"n" : 16384,
|
||||
"r" : 8
|
||||
"scrypt": {
|
||||
"n": 16384,
|
||||
"r": 8,
|
||||
"p": 8
|
||||
},
|
||||
"extra": {
|
||||
"Tokens": null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
verifyInteropID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckSig))
|
||||
verifyInteropID = interopnames.ToID([]byte(interopnames.SystemCryptoCheckSig))
|
||||
multisigInteropID = interopnames.ToID([]byte(interopnames.NeoCryptoCheckMultisig))
|
||||
)
|
||||
|
||||
|
|
8
pkg/wallet/testdata/wallet1.json
vendored
8
pkg/wallet/testdata/wallet1.json
vendored
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==",
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
|
14
pkg/wallet/testdata/wallet2.json
vendored
14
pkg/wallet/testdata/wallet2.json
vendored
|
@ -2,11 +2,11 @@
|
|||
"version": "3.0",
|
||||
"accounts": [
|
||||
{
|
||||
"address": "NTh9TnZTstvAePEYWDGLLxidBikJE24uTo",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBdHR2qg==",
|
||||
"script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
{
|
||||
"address": "NgEisvCqr2h8wpRxQb7bVPWUZdbVCY8Uo6",
|
||||
"key": "6PYL8Gnjsz4RBKX18jx5ZAQTDH7PKkZwEVjPKEkjNzCDNFE6TKZwaFLibL",
|
||||
"key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEF7zmyl",
|
||||
|
@ -44,11 +44,11 @@
|
|||
"isdefault": false
|
||||
},
|
||||
{
|
||||
"address": "NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7",
|
||||
"key": "6PYXADog3RQCwKRhqQsobwZEFopdcCJuMfPosM9pXPaDWSguKvznLdpADk",
|
||||
"address": "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275",
|
||||
"key": "6PYSYoZaxqDu5vqvm7yUFT3sPJJFwyLyYDnp8zwj1YVPcBWxacz64bNX59",
|
||||
"label": "",
|
||||
"contract": {
|
||||
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BdHR2qg==",
|
||||
"script": "DCECEDp/fdAWVYWX95YNJ8UWpDlP2Wi55lFV60sBPkBAQG5BVuezJw==",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "parameter0",
|
||||
|
|
|
@ -188,16 +188,12 @@ func TestWalletGetChangeAddress(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
sh := w1.GetChangeAddress()
|
||||
// No default address, the first one is used.
|
||||
expected, err := address.StringToUint160("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expected, sh)
|
||||
require.Equal(t, "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", address.Uint160ToString(sh))
|
||||
w2, err := NewWalletFromFile("testdata/wallet2.json")
|
||||
require.NoError(t, err)
|
||||
sh = w2.GetChangeAddress()
|
||||
// Default address.
|
||||
expected, err = address.StringToUint160("NUREbqw2kfbPgDeEz8Dac2QxntGGqqFMm7")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expected, sh)
|
||||
require.Equal(t, "NMUedC8TSV2rE17wGguSvPk9XcmHSaT275", address.Uint160ToString(sh))
|
||||
}
|
||||
|
||||
func TestWalletForExamples(t *testing.T) {
|
||||
|
@ -214,5 +210,5 @@ func TestWalletForExamples(t *testing.T) {
|
|||
require.NoError(t, w.Accounts[0].Decrypt(walletPass))
|
||||
|
||||
// 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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue