genesis exisiting tests pass

This commit is contained in:
rigelrozanski 2018-02-09 12:48:11 +00:00
parent 17acf9e18d
commit 7206c434d4
2 changed files with 8 additions and 3 deletions

View File

@ -35,11 +35,14 @@ func (app *BasecoinApp) initBaseAppTxDecoder() {
func (app *BasecoinApp) initBaseAppInitStater() {
accountMapper := app.accountMapper
app.BaseApp.SetInitStater(func(ctxCheckTx, ctxDeliverTx sdk.Context, stateJSON []byte) sdk.Error {
app.BaseApp.SetInitStater(func(ctxCheckTx, ctxDeliverTx sdk.Context, state json.RawMessage) sdk.Error {
if state == nil {
return nil
}
var accs []*types.AppAccount
err := json.Unmarshal(stateJSON, &accs)
err := json.Unmarshal(state, &accs)
if err != nil {
return sdk.ErrGenesisParse("").TraceCause(err, "")
}

View File

@ -1,4 +1,6 @@
package types
import "encoding/json"
// function variable used to initialize application state at genesis
type InitStater func(ctxCheckTx, ctxDeliverTx Context, stateJSON []byte) Error
type InitStater func(ctxCheckTx, ctxDeliverTx Context, state json.RawMessage) Error