diff --git a/pkg/wallet/account.go b/pkg/wallet/account.go index 4abc659f1..067d59e07 100644 --- a/pkg/wallet/account.go +++ b/pkg/wallet/account.go @@ -24,9 +24,6 @@ type Account struct { // NEO public key. publicKey []byte - // Account import file. - wif string - // NEO public address. Address string `json:"address"` @@ -164,7 +161,6 @@ func (a *Account) Decrypt(passphrase string, scrypt keys.ScryptParams) error { } a.publicKey = a.privateKey.PublicKey().Bytes() - a.wif = a.privateKey.WIF() return nil } @@ -239,13 +235,11 @@ func (a *Account) ConvertMultisig(m int, pubs []*keys.PublicKey) error { func NewAccountFromPrivateKey(p *keys.PrivateKey) *Account { pubKey := p.PublicKey() pubAddr := p.Address() - wif := p.WIF() a := &Account{ publicKey: pubKey.Bytes(), privateKey: p, Address: pubAddr, - wif: wif, Contract: &Contract{ Script: pubKey.GetVerificationScript(), Parameters: getContractParams(1), diff --git a/pkg/wallet/account_test.go b/pkg/wallet/account_test.go index 2d0a798df..d2b0374de 100644 --- a/pkg/wallet/account_test.go +++ b/pkg/wallet/account_test.go @@ -215,7 +215,7 @@ func convertPubs(t *testing.T, hexKeys []string) []*keys.PublicKey { func compareFields(t *testing.T, tk keytestcases.Ktype, acc *Account) { want, have := tk.Address, acc.Address require.Equalf(t, want, have, "expected address %s got %s", want, have) - want, have = tk.Wif, acc.wif + want, have = tk.Wif, acc.privateKey.WIF() require.Equalf(t, want, have, "expected wif %s got %s", want, have) want, have = tk.PublicKey, hex.EncodeToString(acc.publicKey) require.Equalf(t, want, have, "expected pub key %s got %s", want, have) diff --git a/pkg/wallet/wallet_test.go b/pkg/wallet/wallet_test.go index 6ac8f4071..42d078663 100644 --- a/pkg/wallet/wallet_test.go +++ b/pkg/wallet/wallet_test.go @@ -49,7 +49,6 @@ func TestAddAccount(t *testing.T) { wallet.AddAccount(&Account{ privateKey: nil, publicKey: nil, - wif: "", Address: "real", EncryptedWIF: "", Label: "", @@ -79,7 +78,6 @@ func TestSave(t *testing.T) { wallet.AddAccount(&Account{ privateKey: nil, publicKey: nil, - wif: "", Address: "", EncryptedWIF: "", Label: "",