func GetAccount(store types.KVStore, addr []byte) *types.Account { data := store.Get(AccountKey(addr)) if len(data) == 0 { return nil } var acc *types.Account err := wire.ReadBinaryBytes(data, &acc) if err != nil { panic(Fmt("Error reading account %X error: %v", data, err.Error())) } return acc }
func SetAccount(store types.KVStore, addr []byte, acc *types.Account) { accBytes := wire.BinaryBytes(acc) store.Set(AccountKey(addr), accBytes) }