diff --git a/cli/testdata/testwallet_multi.json b/cli/testdata/testwallet_multi.json new file mode 100644 index 000000000..9e1682ba9 --- /dev/null +++ b/cli/testdata/testwallet_multi.json @@ -0,0 +1,64 @@ +{ + "version": "1.0", + "accounts": [ + { + "address": "NgHcPxgEKZQV4QBedzyASJrgiANhJqBVLw", + "key": "6PYTbVq2P3AJQwWU5SFMKLjHYco7QABtNRo4ZvLvXhyaYjwMcuZm6xKokT", + "label": "one", + "contract": { + "script": "DCECnmSGVirDOqMr57EHaYz0YMTjaHQtO9FQYu8DMTCDw6VBVuezJw==", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "lock": false, + "isDefault": false + }, + { + "address": "NLvHRfKAifjio2z9HiwLo9ZnpRPHUbAHgH", + "key": "6PYUjQ8TgR3cduEpG5niUNuPEWi3tYiQsnC4Jha9nGAJ6tAQGUmcrZXsLF", + "label": "two", + "contract": { + "script": "DCECgk91c1ABAX3A1uJNnxhGlp7NwUJScwJzJhrsYrXIbgNBVuezJw==", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "lock": false, + "isDefault": false + }, + { + "address": "NcDfG8foJx79XSihcDDrx1df7cHAoJBfXj", + "key": "6PYRkUQKWFrTovHyeQZ7X4nWoDXKohtFRKW51LiCz317pwCjmB1cVwpcxz", + "label": "three", + "contract": { + "script": "DCEC9v0ZqBg8f4jJX9WR891M0bazf0FYTNu7MEgpSHrb9CVBVuezJw==", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "lock": false, + "isDefault": false + } + ], + "scrypt": { + "n": 16384, + "r": 8, + "p": 8 + }, + "extra": { + "Tokens": null + } +} \ No newline at end of file diff --git a/internal/testcli/executor.go b/internal/testcli/executor.go index 5fec5e06a..877b250e0 100644 --- a/internal/testcli/executor.go +++ b/internal/testcli/executor.go @@ -48,6 +48,11 @@ const ( TestWalletPath = "../testdata/testwallet.json" TestWalletAccount = "Nfyz4KcsgYepRJw1W5C2uKCi6QWKf7v6gG" + TestWalletMultiPath = "../testdata/testwallet_multi.json" + TestWalletMultiAccount1 = "NgHcPxgEKZQV4QBedzyASJrgiANhJqBVLw" + TestWalletMultiAccount2 = "NLvHRfKAifjio2z9HiwLo9ZnpRPHUbAHgH" + TestWalletMultiAccount3 = "NcDfG8foJx79XSihcDDrx1df7cHAoJBfXj" + ValidatorWallet = "../testdata/wallet1_solo.json" ValidatorPass = "one" ) @@ -55,6 +60,10 @@ const ( var ( ValidatorHash, _ = address.StringToUint160(ValidatorAddr) ValidatorPriv, _ = keys.NewPrivateKeyFromWIF(ValidatorWIF) + + TestWalletMultiAccount1Hash, _ = address.StringToUint160(TestWalletMultiAccount1) + TestWalletMultiAccount2Hash, _ = address.StringToUint160(TestWalletMultiAccount2) + TestWalletMultiAccount3Hash, _ = address.StringToUint160(TestWalletMultiAccount3) ) // Executor represents context for a test instance. diff --git a/pkg/wallet/regenerate_test.go b/pkg/wallet/regenerate_test.go index 5dfc919f8..24e687fed 100644 --- a/pkg/wallet/regenerate_test.go +++ b/pkg/wallet/regenerate_test.go @@ -179,6 +179,30 @@ func TestRegenerateCLITestwallet(t *testing.T) { createWallet(t, walletPath, acc) } +func TestRegenerateCLITestwalletMulti(t *testing.T) { + if !regenerate { + return + } + const ( + walletPath = "../../cli/testdata/testwallet_multi.json" + accWIF1 = "L2NZQ84s8SuUfyJmtjs7J5a2pZFEVQVVRYDtNsQEyB4RjHnpkorr" + pass1 = "one" + accWIF2 = "L4pSqPmvbghcM8NY14CNSUzkK92VmSFLKNwAh9TqLqFhTZkxZgsP" + pass2 = "two" + accWIF3 = "L1eNtPQA8bALqvSgGMNpNR3EYFR15WeNdCZDuiwWYcQ6Q6FfuVro" + pass3 = "three" + ) + + scryptParams := keys.ScryptParams{N: 2, R: 1, P: 1} + acc1 := getAccountWithScrypt(t, accWIF1, pass1, scryptParams) + acc1.Label = pass1 + acc2 := getAccountWithScrypt(t, accWIF2, pass2, scryptParams) + acc2.Label = pass2 + acc3 := getAccountWithScrypt(t, accWIF3, pass3, scryptParams) + acc3.Label = pass3 + createWallet(t, walletPath, acc1, acc2, acc3) +} + func TestRegenerateCLITestwallet_NEO3(t *testing.T) { if !regenerate { return