Skip to content

Commit d829a21

Browse files
committed
proto_helpers.go
1 parent 9b25399 commit d829a21

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

pkg/chains/evm/proto_helpers.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,18 +716,28 @@ func ConvertGasConfigToProto(gasConfig evmtypes.GasConfig) (*GasConfig, error) {
716716
return nil, fmt.Errorf("gas limit can't be nil")
717717
}
718718

719-
return &GasConfig{
719+
pbGasConfig := &GasConfig{
720720
GasLimit: *gasConfig.GasLimit,
721-
}, nil
721+
}
722+
723+
if gasConfig.MaxGasPrice != nil {
724+
pbGasConfig.MaxGasPrice = valuespb.NewBigIntFromInt(gasConfig.MaxGasPrice)
725+
}
726+
727+
return pbGasConfig, nil
722728
}
723729

724730
func ConvertGasConfigFromProto(gasConfig *GasConfig) *evmtypes.GasConfig {
725731
if gasConfig == nil {
726732
return nil
727733
}
728-
return &evmtypes.GasConfig{
734+
result := &evmtypes.GasConfig{
729735
GasLimit: &gasConfig.GasLimit,
730736
}
737+
if gasConfig.MaxGasPrice != nil {
738+
result.MaxGasPrice = valuespb.NewIntFromBigInt(gasConfig.MaxGasPrice)
739+
}
740+
return result
731741
}
732742

733743
func ConvertTxStatusFromProto(txStatus TxStatus) evmtypes.TransactionStatus {

0 commit comments

Comments
 (0)