mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
cli: add tests for wallet dump
This commit is contained in:
parent
40a24bad64
commit
fd98a9194a
1 changed files with 13 additions and 0 deletions
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
"math/big"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
@ -253,3 +254,15 @@ func TestImportDeployed(t *testing.T) {
|
||||||
require.Equal(t, big.NewInt(1), b)
|
require.Equal(t, big.NewInt(1), b)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestWalletDump(t *testing.T) {
|
||||||
|
e := newExecutor(t, false)
|
||||||
|
defer e.Close(t)
|
||||||
|
|
||||||
|
e.Run(t, "neo-go", "wallet", "dump", "--wallet", "testdata/testwallet.json")
|
||||||
|
rawStr := strings.TrimSpace(e.Out.String())
|
||||||
|
w := new(wallet.Wallet)
|
||||||
|
require.NoError(t, json.Unmarshal([]byte(rawStr), w))
|
||||||
|
require.Equal(t, 1, len(w.Accounts))
|
||||||
|
require.Equal(t, "NNuJqXDnRqvwgzhSzhH4jnVFWB1DyZ34EM", w.Accounts[0].Address)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue