Update AnteHandler in the Ethermint app (#83)

This commit is contained in:
Austin Abell 2019-08-19 11:31:40 -04:00 committed by GitHub
parent 82d016ab02
commit f0e2c01f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -173,6 +173,10 @@ func consumeSigGas(meter sdk.GasMeter, pubkey tmcrypto.PubKey) {
switch pubkey.(type) { switch pubkey.(type) {
case crypto.PubKeySecp256k1: case crypto.PubKeySecp256k1:
meter.ConsumeGas(secp256k1VerifyCost, "ante verify: secp256k1") meter.ConsumeGas(secp256k1VerifyCost, "ante verify: secp256k1")
// TODO: Remove allowing tm Pub key to sign transactions (if intended in final release)
// or until genesis utils are built into the evm or as their own module
case tmcrypto.PubKey:
meter.ConsumeGas(secp256k1VerifyCost, "ante verify: tendermint secp256k1")
default: default:
panic("Unrecognized signature type") panic("Unrecognized signature type")
} }

View File

@ -217,7 +217,7 @@ func NewEthermintApp(
// initialize BaseApp // initialize BaseApp
app.SetInitChainer(app.InitChainer) app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker) app.SetBeginBlocker(app.BeginBlocker)
app.SetAnteHandler(auth.NewAnteHandler(app.accountKeeper, app.supplyKeeper, auth.DefaultSigVerificationGasConsumer)) app.SetAnteHandler(NewAnteHandler(app.accountKeeper, app.supplyKeeper))
app.SetEndBlocker(app.EndBlocker) app.SetEndBlocker(app.EndBlocker)
if loadLatest { if loadLatest {