-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: validate proposed genesis state in InitGenesis (#90)
(cherry picked from commit 5bb6779)
- Loading branch information
1 parent
f7dbf4e
commit a27b4ea
Showing
4 changed files
with
20 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
package types | ||
|
||
// NewGenesisState creates a 29-fee GenesisState instance. | ||
// NewGenesisState creates a pfm GenesisState instance. | ||
func NewGenesisState(params Params, inFlightPackets map[string]InFlightPacket) *GenesisState { | ||
return &GenesisState{ | ||
Params: params, | ||
InFlightPackets: inFlightPackets, | ||
} | ||
} | ||
|
||
// DefaultGenesisState returns a GenesisState with "transfer" as the default PortID. | ||
// DefaultGenesisState returns a GenesisState with a default fee percentage of 0. | ||
func DefaultGenesisState() *GenesisState { | ||
return &GenesisState{ | ||
Params: DefaultParams(), | ||
InFlightPackets: make(map[string]InFlightPacket), | ||
} | ||
} | ||
|
||
// Validate performs basic genesis state validation returning an error upon any | ||
// failure. | ||
// Validate performs basic genesis state validation returning an error upon any failure. | ||
func (gs GenesisState) Validate() error { | ||
return gs.Params.Validate() | ||
} |
15 changes: 9 additions & 6 deletions
15
middleware/packet-forward-middleware/router/types/params.go
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