This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change params type of basefee and remove default base fee
- Loading branch information
1 parent
d483578
commit 1d48659
Showing
16 changed files
with
92 additions
and
203 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,37 +1,27 @@ | ||
package types | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/ethereum/go-ethereum/params" | ||
) | ||
|
||
// DefaultGenesisState sets default fee market genesis state. | ||
func DefaultGenesisState() *GenesisState { | ||
return &GenesisState{ | ||
Params: DefaultParams(), | ||
// the default base fee should be initialized because the default enable height is zero. | ||
DefaultBaseFee: sdk.NewIntFromUint64(params.InitialBaseFee), | ||
BlockGas: 0, | ||
Params: DefaultParams(), | ||
BlockGas: 0, | ||
} | ||
} | ||
|
||
// NewGenesisState creates a new genesis state. | ||
func NewGenesisState(params Params, baseFee sdk.Int, blockGas uint64) *GenesisState { | ||
return &GenesisState{ | ||
Params: params, | ||
DefaultBaseFee: baseFee, | ||
BlockGas: blockGas, | ||
Params: params, | ||
BlockGas: blockGas, | ||
} | ||
} | ||
|
||
// Validate performs basic genesis state validation returning an error upon any | ||
// failure. | ||
func (gs GenesisState) Validate() error { | ||
if gs.DefaultBaseFee.IsNegative() { | ||
return fmt.Errorf("base fee cannot be negative: %s", gs.DefaultBaseFee) | ||
} | ||
|
||
return gs.Params.Validate() | ||
} |
Oops, something went wrong.