From ab8ad30648373c9d14b025114801e59d563d2f11 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sat, 21 Mar 2015 11:08:05 -0700 Subject: [PATCH] Set Pubkey on vm.Account. --- state/vm_app_state.go | 6 ++++++ vm/types.go | 1 + 2 files changed, 7 insertions(+) diff --git a/state/vm_app_state.go b/state/vm_app_state.go index 643f30f82..e82a21c17 100644 --- a/state/vm_app_state.go +++ b/state/vm_app_state.go @@ -20,13 +20,19 @@ func toVMAccount(acc *ac.Account) *vm.Account { Code: acc.Code, // This is crazy. Nonce: uint64(acc.Sequence), StorageRoot: vm.BytesToWord(acc.StorageRoot), + Other: acc.PubKey, } } // Converts vm.Account to state.Account struct. func toStateAccount(acc *vm.Account) *ac.Account { + pubKey, ok := acc.Other.(ac.PubKey) + if !ok { + pubKey = ac.PubKeyNil{} + } return &ac.Account{ Address: acc.Address.Address(), + PubKey: pubKey, Balance: acc.Balance, Code: acc.Code, Sequence: uint(acc.Nonce), diff --git a/vm/types.go b/vm/types.go index e4cf0a371..968538ef1 100644 --- a/vm/types.go +++ b/vm/types.go @@ -33,6 +33,7 @@ type Account struct { Code []byte Nonce uint64 StorageRoot Word + Other interface{} // For holding all other data. } type Log struct {