Documentation ¶
Index ¶
- func ConvertAccounts(accounts [][]byte) []common.Address
- func MidToInternalType(m MidLevelTestStruct) chain_reader_tester.MidLevelTestStruct
- func OracleIdsToBytes(oracleIDs [32]commontypes.OracleID) [32]byte
- func RunChainReaderEvmTests[T TestingT[T]](t T, it *EVMChainReaderInterfaceTester[T])
- func ToInternalType(testStruct TestStruct) chain_reader_tester.TestStruct
- type ClientWithContractHistory
- func (cwh *ClientWithContractHistory) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (cwh *ClientWithContractHistory) Init(_ context.Context, config types.ChainReaderConfig) error
- func (cwh *ClientWithContractHistory) SetUintLatestValue(ctx context.Context, val uint64, forCall ExpectedGetLatestValueArgs) error
- func (v ClientWithContractHistory) String() string
- type EVMChainReaderInterfaceTester
- func (it *EVMChainReaderInterfaceTester[T]) AwaitTx(t T, tx *gethtypes.Transaction)
- func (it *EVMChainReaderInterfaceTester[T]) GenerateBlocksTillConfidenceLevel(t T, contractName, readName string, confidenceLevel primitives.ConfidenceLevel)
- func (it *EVMChainReaderInterfaceTester[T]) GetAccountBytes(i int) []byte
- func (it *EVMChainReaderInterfaceTester[T]) GetAuthWithGasSet(t T) *bind.TransactOpts
- func (it *EVMChainReaderInterfaceTester[T]) GetBindings(_ T) []clcommontypes.BoundContract
- func (it *EVMChainReaderInterfaceTester[T]) GetChainReader(t T) clcommontypes.ContractReader
- func (it *EVMChainReaderInterfaceTester[T]) IncNonce()
- func (it *EVMChainReaderInterfaceTester[T]) MaxWaitTimeForEvents() time.Duration
- func (it *EVMChainReaderInterfaceTester[T]) Name() string
- func (it *EVMChainReaderInterfaceTester[T]) SetBatchLatestValues(t T, batchCallEntry BatchCallEntry)
- func (it *EVMChainReaderInterfaceTester[T]) SetTestStructLatestValue(t T, testStruct *TestStruct)
- func (it *EVMChainReaderInterfaceTester[T]) SetUintLatestValue(t T, val uint64, forCall ExpectedGetLatestValueArgs)
- func (it *EVMChainReaderInterfaceTester[T]) Setup(t T)
- func (it *EVMChainReaderInterfaceTester[T]) TriggerEvent(t T, testStruct *TestStruct)
- type EVMChainReaderInterfaceTesterHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAccounts ¶
func MidToInternalType ¶
func MidToInternalType(m MidLevelTestStruct) chain_reader_tester.MidLevelTestStruct
func OracleIdsToBytes ¶
func OracleIdsToBytes(oracleIDs [32]commontypes.OracleID) [32]byte
func RunChainReaderEvmTests ¶
func RunChainReaderEvmTests[T TestingT[T]](t T, it *EVMChainReaderInterfaceTester[T])
func ToInternalType ¶
func ToInternalType(testStruct TestStruct) chain_reader_tester.TestStruct
Types ¶
type ClientWithContractHistory ¶ added in v2.15.0
type ClientWithContractHistory struct { client.Client HT logpoller.HeadTracker // contains filtered or unexported fields }
ClientWithContractHistory makes it possible to modify client.Client CallContract so that it returns historical data.
func (*ClientWithContractHistory) CallContract ¶ added in v2.15.0
func (cwh *ClientWithContractHistory) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract does the standard CallContract if blockNumber is latest, otherwise returns mocked historical value since SimulatedBackend doesn't support historical calls.
func (*ClientWithContractHistory) Init ¶ added in v2.15.0
func (cwh *ClientWithContractHistory) Init(_ context.Context, config types.ChainReaderConfig) error
func (*ClientWithContractHistory) SetUintLatestValue ¶ added in v2.15.0
func (cwh *ClientWithContractHistory) SetUintLatestValue(ctx context.Context, val uint64, forCall ExpectedGetLatestValueArgs) error
type EVMChainReaderInterfaceTester ¶
type EVMChainReaderInterfaceTester[T TestingT[T]] struct { Helper EVMChainReaderInterfaceTesterHelper[T] // contains filtered or unexported fields }
func (*EVMChainReaderInterfaceTester[T]) AwaitTx ¶
func (it *EVMChainReaderInterfaceTester[T]) AwaitTx(t T, tx *gethtypes.Transaction)
func (*EVMChainReaderInterfaceTester[T]) GenerateBlocksTillConfidenceLevel ¶ added in v2.15.0
func (it *EVMChainReaderInterfaceTester[T]) GenerateBlocksTillConfidenceLevel(t T, contractName, readName string, confidenceLevel primitives.ConfidenceLevel)
GenerateBlocksTillConfidenceLevel is supposed to be used for testing confidence levels, but geth simulated backend doesn't support calling past state
func (*EVMChainReaderInterfaceTester[T]) GetAccountBytes ¶
func (it *EVMChainReaderInterfaceTester[T]) GetAccountBytes(i int) []byte
func (*EVMChainReaderInterfaceTester[T]) GetAuthWithGasSet ¶
func (it *EVMChainReaderInterfaceTester[T]) GetAuthWithGasSet(t T) *bind.TransactOpts
func (*EVMChainReaderInterfaceTester[T]) GetBindings ¶
func (it *EVMChainReaderInterfaceTester[T]) GetBindings(_ T) []clcommontypes.BoundContract
func (*EVMChainReaderInterfaceTester[T]) GetChainReader ¶
func (it *EVMChainReaderInterfaceTester[T]) GetChainReader(t T) clcommontypes.ContractReader
func (*EVMChainReaderInterfaceTester[T]) IncNonce ¶
func (it *EVMChainReaderInterfaceTester[T]) IncNonce()
func (*EVMChainReaderInterfaceTester[T]) MaxWaitTimeForEvents ¶
func (it *EVMChainReaderInterfaceTester[T]) MaxWaitTimeForEvents() time.Duration
func (*EVMChainReaderInterfaceTester[T]) Name ¶
func (it *EVMChainReaderInterfaceTester[T]) Name() string
func (*EVMChainReaderInterfaceTester[T]) SetBatchLatestValues ¶ added in v2.15.0
func (it *EVMChainReaderInterfaceTester[T]) SetBatchLatestValues(t T, batchCallEntry BatchCallEntry)
func (*EVMChainReaderInterfaceTester[T]) SetTestStructLatestValue ¶ added in v2.15.0
func (it *EVMChainReaderInterfaceTester[T]) SetTestStructLatestValue(t T, testStruct *TestStruct)
func (*EVMChainReaderInterfaceTester[T]) SetUintLatestValue ¶ added in v2.15.0
func (it *EVMChainReaderInterfaceTester[T]) SetUintLatestValue(t T, val uint64, forCall ExpectedGetLatestValueArgs)
SetUintLatestValue is supposed to be used for testing confidence levels, but geth simulated backend doesn't support calling past state
func (*EVMChainReaderInterfaceTester[T]) Setup ¶
func (it *EVMChainReaderInterfaceTester[T]) Setup(t T)
func (*EVMChainReaderInterfaceTester[T]) TriggerEvent ¶
func (it *EVMChainReaderInterfaceTester[T]) TriggerEvent(t T, testStruct *TestStruct)
type EVMChainReaderInterfaceTesterHelper ¶
type EVMChainReaderInterfaceTesterHelper[T TestingT[T]] interface { SetupAuth(t T) *bind.TransactOpts Client(t T) client.Client Commit() Backend() bind.ContractBackend ChainID() *big.Int Context(t T) context.Context NewSqlxDB(t T) *sqlx.DB MaxWaitTimeForEvents() time.Duration GasPriceBufferPercent() int64 }
Click to show internal directories.
Click to hide internal directories.