update minimum gas price to be 1 (#515)

* update minimum gas price to be 1

* update changelog
This commit is contained in:
noot 2020-09-15 13:17:22 -04:00 committed by GitHub
parent cf9662c7bd
commit 9a2d39bf18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -51,12 +51,14 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (`x/evm`) [\#458](https://github.com/ChainSafe/ethermint/pull/458) Define parameter for token denomination used for the EVM module.
* (`x/evm`) [\#443](https://github.com/ChainSafe/ethermint/issues/443) Support custom Ethereum `ChainConfig` params.
* (types) [\#434](https://github.com/ChainSafe/ethermint/issues/434) Update default denomination to Atto Photon (`aphoton`).
* (types) [\#515](https://github.com/ChainSafe/ethermint/pull/515) Update minimum gas price to be 1.
### Bug Fixes
* (types) [\#507](https://github.com/ChainSafe/ethermint/pull/507) Fix hardcoded `aphoton` on `EthAccount` balance getter and setter.
* (`x/evm`) [\#496](https://github.com/ChainSafe/ethermint/pull/496) Fix bugs on `journal.revert` and `CommitStateDB.Copy`.
* (types) [\#480](https://github.com/ChainSafe/ethermint/pull/480) Update [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) coin type to `60` to satisfy [EIP84](https://github.com/ethereum/EIPs/issues/84).
* (types) [\#513](https://github.com/ChainSafe/ethermint/pull/513) Fix simulated transaction bug that was causing a consensus error by unintentionally affecting the state.
## [v0.1.0] - 2020-08-23

View File

@ -82,8 +82,12 @@ func (msg MsgEthermint) GetSignBytes() []byte {
// ValidateBasic runs stateless checks on the message
func (msg MsgEthermint) ValidateBasic() error {
if msg.Price.IsZero() {
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be 0")
}
if msg.Price.Sign() == -1 {
return sdkerrors.Wrapf(types.ErrInvalidValue, "price cannot be negative %s", msg.Price)
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be negative %s", msg.Price)
}
// Amount can be 0
@ -185,8 +189,12 @@ func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx }
// ValidateBasic implements the sdk.Msg interface. It performs basic validation
// checks of a Transaction. If returns an error if validation fails.
func (msg MsgEthereumTx) ValidateBasic() error {
if msg.Data.Price.Cmp(big.NewInt(0)) == 0 {
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be 0")
}
if msg.Data.Price.Sign() == -1 {
return sdkerrors.Wrapf(types.ErrInvalidValue, "price cannot be negative %s", msg.Data.Price)
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be negative %s", msg.Data.Price)
}
// Amount can be 0