-
Notifications
You must be signed in to change notification settings - Fork 37
/
klaytn.go
29 lines (24 loc) · 924 Bytes
/
klaytn.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package blockchain
import (
"github.com/ethereum/go-ethereum"
)
// Handles specific issues with the Klaytn EVM chain: https://docs.klaytn.com/
// KlaytnMultinodeClient represents a multi-node, EVM compatible client for the Klaytn network
type KlaytnMultinodeClient struct {
*EthereumMultinodeClient
}
// KlaytnClient represents a single node, EVM compatible client for the Klaytn network
type KlaytnClient struct {
*EthereumClient
}
func (k *KlaytnClient) EstimateGas(callData ethereum.CallMsg) (GasEstimations, error) {
// Klaytn is unique in its usage of a gas tip cap, enforcing it be the same
// https://docs.klaytn.com/klaytn/design/transaction-fees#unit-price
gasEstimations, err := k.EthereumClient.EstimateGas(callData)
if err != nil {
return GasEstimations{}, err
}
gasEstimations.GasTipCap = gasEstimations.GasPrice
gasEstimations.GasFeeCap = gasEstimations.GasPrice
return gasEstimations, err
}