This commit is contained in:
Ethan Frey 2020-01-21 09:09:42 +01:00
parent cce07ca01d
commit da662fbd5c
3 changed files with 31 additions and 32 deletions

View File

@ -103,7 +103,7 @@ type WasmApp struct {
tKeys map[string]*sdk.TransientStoreKey
// keepers
AccountKeeper auth.AccountKeeper
accountKeeper auth.AccountKeeper
bankKeeper bank.Keeper
supplyKeeper supply.Keeper
stakingKeeper staking.Keeper
@ -169,9 +169,9 @@ func NewWasmApp(
evidenceSubspace := app.paramsKeeper.Subspace(evidence.DefaultParamspace)
// add keepers
app.AccountKeeper = auth.NewAccountKeeper(app.cdc, keys[auth.StoreKey], authSubspace, auth.ProtoBaseAccount)
app.bankKeeper = bank.NewBaseKeeper(app.AccountKeeper, bankSubspace, bank.DefaultCodespace, app.ModuleAccountAddrs())
app.supplyKeeper = supply.NewKeeper(app.cdc, keys[supply.StoreKey], app.AccountKeeper, app.bankKeeper, maccPerms)
app.accountKeeper = auth.NewAccountKeeper(app.cdc, keys[auth.StoreKey], authSubspace, auth.ProtoBaseAccount)
app.bankKeeper = bank.NewBaseKeeper(app.accountKeeper, bankSubspace, bank.DefaultCodespace, app.ModuleAccountAddrs())
app.supplyKeeper = supply.NewKeeper(app.cdc, keys[supply.StoreKey], app.accountKeeper, app.bankKeeper, maccPerms)
stakingKeeper := staking.NewKeeper(
app.cdc, keys[staking.StoreKey], app.supplyKeeper, stakingSubspace, staking.DefaultCodespace,
)
@ -197,7 +197,7 @@ func NewWasmApp(
wasmConfig := wasmWrap.Wasm
fmt.Printf("WasmConfig: %#v\n", wasmConfig)
app.wasmKeeper = wasm.NewKeeper(app.cdc, keys[wasm.StoreKey], app.AccountKeeper, app.bankKeeper, wasmRouter, wasmDir, wasmConfig)
app.wasmKeeper = wasm.NewKeeper(app.cdc, keys[wasm.StoreKey], app.accountKeeper, app.bankKeeper, wasmRouter, wasmDir, wasmConfig)
// create evidence keeper with evidence router
app.evidenceKeeper = evidence.NewKeeper(
@ -226,16 +226,16 @@ func NewWasmApp(
// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
app.mm = module.NewManager(
genutil.NewAppModule(app.AccountKeeper, app.stakingKeeper, app.BaseApp.DeliverTx),
auth.NewAppModule(app.AccountKeeper),
bank.NewAppModule(app.bankKeeper, app.AccountKeeper),
genutil.NewAppModule(app.accountKeeper, app.stakingKeeper, app.BaseApp.DeliverTx),
auth.NewAppModule(app.accountKeeper),
bank.NewAppModule(app.bankKeeper, app.accountKeeper),
crisis.NewAppModule(&app.crisisKeeper),
supply.NewAppModule(app.supplyKeeper, app.AccountKeeper),
supply.NewAppModule(app.supplyKeeper, app.accountKeeper),
distr.NewAppModule(app.distrKeeper, app.supplyKeeper),
gov.NewAppModule(app.govKeeper, app.supplyKeeper),
mint.NewAppModule(app.mintKeeper),
slashing.NewAppModule(app.slashingKeeper, app.stakingKeeper),
staking.NewAppModule(app.stakingKeeper, app.AccountKeeper, app.supplyKeeper),
staking.NewAppModule(app.stakingKeeper, app.accountKeeper, app.supplyKeeper),
evidence.NewAppModule(*app.evidenceKeeper),
wasm.NewAppModule(app.wasmKeeper),
)
@ -263,13 +263,13 @@ func NewWasmApp(
// NOTE: This is not required for apps that don't use the simulator for fuzz testing
// transactions.
app.sm = module.NewSimulationManager(
auth.NewAppModule(app.AccountKeeper),
bank.NewAppModule(app.bankKeeper, app.AccountKeeper),
supply.NewAppModule(app.supplyKeeper, app.AccountKeeper),
auth.NewAppModule(app.accountKeeper),
bank.NewAppModule(app.bankKeeper, app.accountKeeper),
supply.NewAppModule(app.supplyKeeper, app.accountKeeper),
gov.NewAppModule(app.govKeeper, app.supplyKeeper),
mint.NewAppModule(app.mintKeeper),
distr.NewAppModule(app.distrKeeper, app.supplyKeeper),
staking.NewAppModule(app.stakingKeeper, app.AccountKeeper, app.supplyKeeper),
staking.NewAppModule(app.stakingKeeper, app.accountKeeper, app.supplyKeeper),
slashing.NewAppModule(app.slashingKeeper, app.stakingKeeper),
)
@ -282,7 +282,7 @@ func NewWasmApp(
// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)
app.SetAnteHandler(auth.NewAnteHandler(app.AccountKeeper, app.supplyKeeper, auth.DefaultSigVerificationGasConsumer))
app.SetAnteHandler(auth.NewAnteHandler(app.accountKeeper, app.supplyKeeper, auth.DefaultSigVerificationGasConsumer))
app.SetEndBlocker(app.EndBlocker)
if loadLatest {

View File

@ -63,7 +63,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
banksim.SimulateMsgSend(app.AccountKeeper, app.bankKeeper),
banksim.SimulateMsgSend(app.accountKeeper, app.bankKeeper),
},
{
func(_ *rand.Rand) int {
@ -74,7 +74,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
banksim.SimulateMsgMultiSend(app.AccountKeeper, app.bankKeeper),
banksim.SimulateMsgMultiSend(app.accountKeeper, app.bankKeeper),
},
{
func(_ *rand.Rand) int {
@ -85,7 +85,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
distrsim.SimulateMsgSetWithdrawAddress(app.AccountKeeper, app.distrKeeper),
distrsim.SimulateMsgSetWithdrawAddress(app.accountKeeper, app.distrKeeper),
},
{
func(_ *rand.Rand) int {
@ -96,7 +96,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
distrsim.SimulateMsgWithdrawDelegatorReward(app.AccountKeeper, app.distrKeeper, app.stakingKeeper),
distrsim.SimulateMsgWithdrawDelegatorReward(app.accountKeeper, app.distrKeeper, app.stakingKeeper),
},
{
func(_ *rand.Rand) int {
@ -107,7 +107,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
distrsim.SimulateMsgWithdrawValidatorCommission(app.AccountKeeper, app.distrKeeper, app.stakingKeeper),
distrsim.SimulateMsgWithdrawValidatorCommission(app.accountKeeper, app.distrKeeper, app.stakingKeeper),
},
{
func(_ *rand.Rand) int {
@ -118,7 +118,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
govsim.SimulateSubmitProposal(app.AccountKeeper, app.govKeeper, govsim.SimulateTextProposalContent),
govsim.SimulateSubmitProposal(app.accountKeeper, app.govKeeper, govsim.SimulateTextProposalContent),
},
{
func(_ *rand.Rand) int {
@ -129,7 +129,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
govsim.SimulateSubmitProposal(app.AccountKeeper, app.govKeeper, distrsim.SimulateCommunityPoolSpendProposalContent(app.distrKeeper)),
govsim.SimulateSubmitProposal(app.accountKeeper, app.govKeeper, distrsim.SimulateCommunityPoolSpendProposalContent(app.distrKeeper)),
},
{
func(_ *rand.Rand) int {
@ -140,7 +140,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
govsim.SimulateSubmitProposal(app.AccountKeeper, app.govKeeper, paramsim.SimulateParamChangeProposalContent(paramChanges)),
govsim.SimulateSubmitProposal(app.accountKeeper, app.govKeeper, paramsim.SimulateParamChangeProposalContent(paramChanges)),
},
{
func(_ *rand.Rand) int {
@ -151,7 +151,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
govsim.SimulateMsgDeposit(app.AccountKeeper, app.govKeeper),
govsim.SimulateMsgDeposit(app.accountKeeper, app.govKeeper),
},
{
func(_ *rand.Rand) int {
@ -162,7 +162,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
govsim.SimulateMsgVote(app.AccountKeeper, app.govKeeper),
govsim.SimulateMsgVote(app.accountKeeper, app.govKeeper),
},
{
func(_ *rand.Rand) int {
@ -173,7 +173,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
stakingsim.SimulateMsgCreateValidator(app.AccountKeeper, app.stakingKeeper),
stakingsim.SimulateMsgCreateValidator(app.accountKeeper, app.stakingKeeper),
},
{
func(_ *rand.Rand) int {
@ -184,7 +184,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
stakingsim.SimulateMsgEditValidator(app.AccountKeeper, app.stakingKeeper),
stakingsim.SimulateMsgEditValidator(app.accountKeeper, app.stakingKeeper),
},
{
func(_ *rand.Rand) int {
@ -195,7 +195,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
stakingsim.SimulateMsgDelegate(app.AccountKeeper, app.stakingKeeper),
stakingsim.SimulateMsgDelegate(app.accountKeeper, app.stakingKeeper),
},
{
func(_ *rand.Rand) int {
@ -206,7 +206,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
stakingsim.SimulateMsgUndelegate(app.AccountKeeper, app.stakingKeeper),
stakingsim.SimulateMsgUndelegate(app.accountKeeper, app.stakingKeeper),
},
{
func(_ *rand.Rand) int {
@ -217,7 +217,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
stakingsim.SimulateMsgBeginRedelegate(app.AccountKeeper, app.stakingKeeper),
stakingsim.SimulateMsgBeginRedelegate(app.accountKeeper, app.stakingKeeper),
},
{
func(_ *rand.Rand) int {
@ -228,7 +228,7 @@ func testAndRunTxs(app *WasmApp, config simulation.Config) []simulation.Weighted
})
return v
}(nil),
slashingsim.SimulateMsgUnjail(app.AccountKeeper, app.slashingKeeper, app.stakingKeeper),
slashingsim.SimulateMsgUnjail(app.accountKeeper, app.slashingKeeper, app.stakingKeeper),
},
}
}

View File

@ -46,7 +46,6 @@ func TestQueryContractState(t *testing.T) {
addr, err := keeper.Instantiate(ctx, creator, contractID, initMsgBz, deposit)
require.NoError(t, err)
// require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", addr.String())
contractModel := []types.Model{
{Key: "foo", Value: "bar"},