github.com/smartcontractkit/chainlink-testing-framework/libs@v0.0.0-20240227141906-ec710b4eb1a3/blockchain/klaytn.go (about)

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