Skip to content

Commit

Permalink
Merge PR cosmos#2276: make simulation no longer generate new privkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored and cwgoes committed Sep 8, 2018
1 parent 0edfa17 commit 88a2dde
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion x/auth/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package auth

import (
"bytes"
"encoding/hex"
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -190,6 +191,13 @@ func processSig(
return
}

var dummySecp256k1Pubkey secp256k1.PubKeySecp256k1

func init() {
bz, _ := hex.DecodeString("035AD6810A47F073553FF30D2FCC7E0D3B1C0B74B61A1AAA2582344037151E143A")
copy(dummySecp256k1Pubkey[:], bz)
}

func processPubKey(acc Account, sig StdSignature, simulate bool) (crypto.PubKey, sdk.Result) {
// If pubkey is not known for account,
// set it from the StdSignature.
Expand All @@ -200,7 +208,7 @@ func processPubKey(acc Account, sig StdSignature, simulate bool) (crypto.PubKey,
// and gasKVStore.Set() shall consume the largest amount, i.e.
// it takes more gas to verifiy secp256k1 keys than ed25519 ones.
if pubKey == nil {
return secp256k1.GenPrivKey().PubKey(), sdk.Result{}
return dummySecp256k1Pubkey, sdk.Result{}
}
return pubKey, sdk.Result{}
}
Expand Down

0 comments on commit 88a2dde

Please sign in to comment.