Merge PR #3794: Write changes to store.

This commit is contained in:
Samuel E. Moelius 2019-03-04 07:27:01 -05:00 committed by Christopher Goes
parent ad91605d77
commit 05529f9c13

View File

@ -89,9 +89,12 @@ func SimulateMsgSubmitProposal(k gov.Keeper) simulation.Operation {
}
func simulateHandleMsgSubmitProposal(msg gov.MsgSubmitProposal, handler sdk.Handler, ctx sdk.Context, event func(string)) (action string, ok bool) {
ctx, _ = ctx.CacheContext()
ctx, write := ctx.CacheContext()
result := handler(ctx, msg)
ok = result.IsOK()
if ok {
write()
}
event(fmt.Sprintf("gov/MsgSubmitProposal/%v", ok))
action = fmt.Sprintf("TestMsgSubmitProposal: ok %v, msg %s", ok, msg.GetSignBytes())
return
@ -125,8 +128,11 @@ func SimulateMsgDeposit(k gov.Keeper) simulation.Operation {
if msg.ValidateBasic() != nil {
return "", nil, fmt.Errorf("expected msg to pass ValidateBasic: %s", msg.GetSignBytes())
}
ctx, _ = ctx.CacheContext()
ctx, write := ctx.CacheContext()
result := gov.NewHandler(k)(ctx, msg)
if result.IsOK() {
write()
}
event(fmt.Sprintf("gov/MsgDeposit/%v", result.IsOK()))
action = fmt.Sprintf("TestMsgDeposit: ok %v, msg %s", result.IsOK(), msg.GetSignBytes())
return action, nil, nil