genesis exisiting tests pass
This commit is contained in:
parent
17acf9e18d
commit
7206c434d4
|
@ -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, "")
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue