Skip to content

Commit

Permalink
chore: increate default valid_sig_block_period (#348)
Browse files Browse the repository at this point in the history
* chore: increate default valid_sig_block_period

* fix: fix test failure

* fix: apply comment
  • Loading branch information
Woosang Son authored Oct 14, 2021
1 parent cc78696 commit 5d8420a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions x/auth/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigErrors() {
func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
suite.SetupTest(false) // reset

suite.ctx = suite.ctx.WithBlockHeight(200) // init block height is 200
suite.ctx = suite.ctx.WithBlockHeight(5000) // init block height is 5000

// Same data for every test cases
accounts := suite.CreateTestAccounts(2)
Expand All @@ -182,7 +182,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
msg := testdata.NewTestMsg(accounts[0].acc.GetAddress())
msgs = []sdk.Msg{msg}

privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{100}, []uint64{0}
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{3600}, []uint64{0}
},
false,
true,
Expand All @@ -200,7 +200,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
{
"new tx from correct sig block height",
func() {
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{100}, []uint64{1}
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv}, []uint64{3600}, []uint64{1}
},
false,
true,
Expand All @@ -221,7 +221,7 @@ func (suite *AnteTestSuite) TestAnteHandlerSigBlockHeight() {
{
"new tx with correct sig block height",
func() {
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv, accounts[1].priv}, []uint64{100, 101}, []uint64{2, 0}
privs, sbh, accSeqs = []cryptotypes.PrivKey{accounts[0].priv, accounts[1].priv}, []uint64{3600, 3601}, []uint64{2, 0}
},
false,
true,
Expand Down
2 changes: 1 addition & 1 deletion x/auth/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
DefaultTxSizeCostPerByte uint64 = 10
DefaultSigVerifyCostED25519 uint64 = 590
DefaultSigVerifyCostSecp256k1 uint64 = 1000
DefaultValidSigBlockPeriod uint64 = 100
DefaultValidSigBlockPeriod uint64 = 3600 // 1 hour for 1 second block interval
)

// Parameter keys
Expand Down

0 comments on commit 5d8420a

Please sign in to comment.