Remove unnecessary fields from simple account

This commit is contained in:
Aditya Sripal 2018-06-26 19:17:36 -07:00 committed by Ethan Buchman
parent d1c9b8bdb9
commit c0445e52b0
1 changed files with 3 additions and 5 deletions

View File

@ -35,7 +35,7 @@ func NewApp1(logger log.Logger, db dbm.DB) *bapp.BaseApp {
// Register message routes.
// Note the handler gets access to the account store.
app.Router().
AddRoute("bank", NewApp1Handler(keyAccount))
AddRoute("send", NewApp1Handler(keyAccount))
// Mount stores and load the latest state.
app.MountStoresIAVL(keyAccount)
@ -65,7 +65,7 @@ func NewMsgSend(from, to sdk.Address, amt sdk.Coins) MsgSend {
}
// Implements Msg.
func (msg MsgSend) Type() string { return "bank" }
func (msg MsgSend) Type() string { return "send" }
// Implements Msg. Ensure the addresses are good and the
// amount is positive.
@ -155,7 +155,7 @@ func handleMsgSend(ctx sdk.Context, key *sdk.KVStoreKey, msg MsgSend) sdk.Result
var acc2 account
if bz == nil {
// Receiver account does not already exist, create a new one.
acc2 = account{Address: msg.To}
acc2 = account{}
} else {
// Receiver account already exists. Retrieve and decode it.
err = json.Unmarshal(bz, &acc2)
@ -184,9 +184,7 @@ func handleMsgSend(ctx sdk.Context, key *sdk.KVStoreKey, msg MsgSend) sdk.Result
}
type account struct {
Address sdk.Address `json:"address"`
Coins sdk.Coins `json:"coins"`
SequenceNumber int64 `json:"sequence"`
}
//------------------------------------------------------------------