cli: add new testing wallet

It contains several simple signature accounts that are not related to
network committee or validators. Needed for tests, existing
`testwallet.json` can't de reused since some tests need testing wallet
with a single account.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-02-29 23:48:10 +03:00
parent 2404145133
commit 1f4e1922ee
3 changed files with 97 additions and 0 deletions

64
cli/testdata/testwallet_multi.json vendored Normal file
View file

@ -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
}
}

View file

@ -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.

View file

@ -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