-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* progress on blockdelay * complete block delay param * address most comments * address the rest * Update modules/light-clients/07-tendermint/types/client_state.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * fix tm tests * fix lightclient tests * add connection tests * DRY consensus metadata setting * fix genesis and add safety check * switch param name and default * set metadata on init and fix tests * change param name * CHANGELOG * add param documentation: Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
- Loading branch information
1 parent
f412334
commit 2523fdb
Showing
36 changed files
with
916 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package keeper | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/ibc-go/modules/core/03-connection/types" | ||
) | ||
|
||
// GetMaxExpectedTimePerBlock retrieves the maximum expected time per block from the paramstore | ||
func (k Keeper) GetMaxExpectedTimePerBlock(ctx sdk.Context) uint64 { | ||
var res uint64 | ||
k.paramSpace.Get(ctx, types.KeyMaxExpectedTimePerBlock, &res) | ||
return res | ||
} | ||
|
||
// GetParams returns the total set of ibc-connection parameters. | ||
func (k Keeper) GetParams(ctx sdk.Context) types.Params { | ||
return types.NewParams(k.GetMaxExpectedTimePerBlock(ctx)) | ||
} | ||
|
||
// SetParams sets the total set of ibc-connection parameters. | ||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { | ||
k.paramSpace.SetParamSet(ctx, ¶ms) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"github.com/cosmos/ibc-go/modules/core/03-connection/types" | ||
) | ||
|
||
func (suite *KeeperTestSuite) TestParams() { | ||
expParams := types.DefaultParams() | ||
|
||
params := suite.chainA.App.GetIBCKeeper().ConnectionKeeper.GetParams(suite.chainA.GetContext()) | ||
suite.Require().Equal(expParams, params) | ||
|
||
expParams.MaxExpectedTimePerBlock = 10 | ||
suite.chainA.App.GetIBCKeeper().ConnectionKeeper.SetParams(suite.chainA.GetContext(), expParams) | ||
params = suite.chainA.App.GetIBCKeeper().ConnectionKeeper.GetParams(suite.chainA.GetContext()) | ||
suite.Require().Equal(uint64(10), expParams.MaxExpectedTimePerBlock) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.