Switch to BurnFeeHandler
This commit is contained in:
parent
3bbb15f454
commit
474fa1dfd1
|
@ -73,7 +73,7 @@ func NewBasecoinApp(logger log.Logger, db dbm.DB) *BasecoinApp {
|
||||||
AddRoute("simplestake", simplestake.NewHandler(stakeKeeper))
|
AddRoute("simplestake", simplestake.NewHandler(stakeKeeper))
|
||||||
|
|
||||||
// Define the feeHandler.
|
// Define the feeHandler.
|
||||||
app.feeHandler = func(ctx sdk.Context, tx sdk.Tx, fees sdk.Coins) {}
|
app.feeHandler = auth.BurnFeeHandler
|
||||||
|
|
||||||
// Initialize BaseApp.
|
// Initialize BaseApp.
|
||||||
app.SetTxDecoder(app.txDecoder)
|
app.SetTxDecoder(app.txDecoder)
|
||||||
|
|
|
@ -83,7 +83,7 @@ func NewDemocoinApp(logger log.Logger, db dbm.DB) *DemocoinApp {
|
||||||
AddRoute("simplestake", simplestake.NewHandler(stakeKeeper))
|
AddRoute("simplestake", simplestake.NewHandler(stakeKeeper))
|
||||||
|
|
||||||
// Define the feeHandler.
|
// Define the feeHandler.
|
||||||
app.feeHandler = func(ctx sdk.Context, tx sdk.Tx, fee sdk.Coins) {}
|
app.feeHandler = auth.BurnFeeHandler
|
||||||
|
|
||||||
// Initialize BaseApp.
|
// Initialize BaseApp.
|
||||||
app.SetTxDecoder(app.txDecoder)
|
app.SetTxDecoder(app.txDecoder)
|
||||||
|
|
|
@ -157,3 +157,7 @@ func deductFees(acc sdk.Account, fee sdk.StdFee) (sdk.Account, sdk.Result) {
|
||||||
acc.SetCoins(newCoins)
|
acc.SetCoins(newCoins)
|
||||||
return acc, sdk.Result{}
|
return acc, sdk.Result{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BurnFeeHandler burns all fees (decreasing total supply)
|
||||||
|
func BurnFeeHandler(ctx sdk.Context, tx sdk.Tx, fee sdk.Coins) {
|
||||||
|
}
|
||||||
|
|
|
@ -12,9 +12,6 @@ import (
|
||||||
wire "github.com/cosmos/cosmos-sdk/wire"
|
wire "github.com/cosmos/cosmos-sdk/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func nopFeeHandler(ctx sdk.Context, tx sdk.Tx, fee sdk.Coins) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func newTestMsg(addrs ...sdk.Address) *sdk.TestMsg {
|
func newTestMsg(addrs ...sdk.Address) *sdk.TestMsg {
|
||||||
return sdk.NewTestMsg(addrs...)
|
return sdk.NewTestMsg(addrs...)
|
||||||
}
|
}
|
||||||
|
@ -75,7 +72,7 @@ func TestAnteHandlerSigErrors(t *testing.T) {
|
||||||
cdc := wire.NewCodec()
|
cdc := wire.NewCodec()
|
||||||
RegisterBaseAccount(cdc)
|
RegisterBaseAccount(cdc)
|
||||||
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
||||||
anteHandler := NewAnteHandler(mapper, nopFeeHandler)
|
anteHandler := NewAnteHandler(mapper, BurnFeeHandler)
|
||||||
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
||||||
|
|
||||||
// keys and addresses
|
// keys and addresses
|
||||||
|
@ -116,7 +113,7 @@ func TestAnteHandlerSequences(t *testing.T) {
|
||||||
cdc := wire.NewCodec()
|
cdc := wire.NewCodec()
|
||||||
RegisterBaseAccount(cdc)
|
RegisterBaseAccount(cdc)
|
||||||
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
||||||
anteHandler := NewAnteHandler(mapper, nopFeeHandler)
|
anteHandler := NewAnteHandler(mapper, BurnFeeHandler)
|
||||||
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
||||||
|
|
||||||
// keys and addresses
|
// keys and addresses
|
||||||
|
@ -182,7 +179,7 @@ func TestAnteHandlerFees(t *testing.T) {
|
||||||
cdc := wire.NewCodec()
|
cdc := wire.NewCodec()
|
||||||
RegisterBaseAccount(cdc)
|
RegisterBaseAccount(cdc)
|
||||||
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
||||||
anteHandler := NewAnteHandler(mapper, nopFeeHandler)
|
anteHandler := NewAnteHandler(mapper, BurnFeeHandler)
|
||||||
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
||||||
|
|
||||||
// keys and addresses
|
// keys and addresses
|
||||||
|
@ -219,7 +216,7 @@ func TestAnteHandlerBadSignBytes(t *testing.T) {
|
||||||
cdc := wire.NewCodec()
|
cdc := wire.NewCodec()
|
||||||
RegisterBaseAccount(cdc)
|
RegisterBaseAccount(cdc)
|
||||||
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
||||||
anteHandler := NewAnteHandler(mapper, nopFeeHandler)
|
anteHandler := NewAnteHandler(mapper, BurnFeeHandler)
|
||||||
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
||||||
|
|
||||||
// keys and addresses
|
// keys and addresses
|
||||||
|
@ -294,7 +291,7 @@ func TestAnteHandlerSetPubKey(t *testing.T) {
|
||||||
cdc := wire.NewCodec()
|
cdc := wire.NewCodec()
|
||||||
RegisterBaseAccount(cdc)
|
RegisterBaseAccount(cdc)
|
||||||
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
|
||||||
anteHandler := NewAnteHandler(mapper, nopFeeHandler)
|
anteHandler := NewAnteHandler(mapper, BurnFeeHandler)
|
||||||
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
ctx := sdk.NewContext(ms, abci.Header{ChainID: "mychainid"}, false, nil)
|
||||||
|
|
||||||
// keys and addresses
|
// keys and addresses
|
||||||
|
|
Loading…
Reference in New Issue