Skip to content

Commit

Permalink
interface: Add CallMsg.GasFeeCap,GasTipCap
Browse files Browse the repository at this point in the history
  • Loading branch information
blukat29 committed Jun 27, 2024
1 parent 788a8be commit 492758e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
9 changes: 9 additions & 0 deletions client/kaia_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,15 @@ func toCallArg(msg kaia.CallMsg) interface{} {
if msg.GasPrice != nil {
arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice)
}
if msg.GasFeeCap != nil {
arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap)
}
if msg.GasTipCap != nil {
arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap)
}
if msg.AccessList != nil {
arg["accessList"] = msg.AccessList
}
return arg
}

Expand Down
14 changes: 8 additions & 6 deletions interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@ type ChainSyncReader interface {

// CallMsg contains parameters for contract calls.
type CallMsg struct {
From common.Address // the sender of the 'transaction'
To *common.Address // the destination contract (nil for contract creation)
Gas uint64 // if 0, the call executes with near-infinite gas
GasPrice *big.Int // kei <-> gas exchange ratio
Value *big.Int // amount of kei sent along with the call
Data []byte // input data, usually an ABI-encoded contract method invocation
From common.Address // the sender of the 'transaction'
To *common.Address // the destination contract (nil for contract creation)
Gas uint64 // if 0, the call executes with near-infinite gas
GasPrice *big.Int // kei <-> gas exchange ratio
GasFeeCap *big.Int // EIP-1559 fee cap per gas.
GasTipCap *big.Int // EIP-1559 tip per gas.
Value *big.Int // amount of kei sent along with the call
Data []byte // input data, usually an ABI-encoded contract method invocation

// Introduced by AccessListTxType transaction.
AccessList *types.AccessList `json:"accessList,omitempty"`
Expand Down
9 changes: 9 additions & 0 deletions node/sc/remote_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,14 @@ func toCallArg(msg klaytn.CallMsg) interface{} {
if msg.GasPrice != nil {
arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice)
}
if msg.GasFeeCap != nil {
arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap)
}
if msg.GasTipCap != nil {
arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap)
}
if msg.AccessList != nil {
arg["accessList"] = msg.AccessList
}
return arg
}

0 comments on commit 492758e

Please sign in to comment.