Documentation ¶
Index ¶
- Constants
- Variables
- func RunChainReaderInterfaceTests(t *testing.T, tester ChainReaderInterfaceTester)
- func RunChainReaderWithStrictArgsInterfaceTest(t *testing.T, tester CodecInterfaceTester)
- func RunCodecInterfaceFuzzTests(f *testing.F, tester CodecInterfaceTester)
- func RunCodecInterfaceTests(t *testing.T, tester CodecInterfaceTester)
- type BasicTester
- type ChainReaderInterfaceTester
- type CodecInterfaceTester
- type EncodeRequest
- type FilterEventParams
- type InnerTestStruct
- type LatestParams
- type MidLevelTestStruct
- type TestStruct
- type TestStructMissingField
- type TestStructWithExtraField
Constants ¶
View Source
const ( AnyValueToReadWithoutAnArgument = uint64(3) AnyDifferentValueToReadWithoutAnArgument = uint64(1990) MethodTakingLatestParamsReturningTestStruct = "GetLatestValues" MethodReturningUint64 = "GetPrimitiveValue" DifferentMethodReturningUint64 = "GetDifferentPrimitiveValue" MethodReturningUint64Slice = "GetSliceValue" MethodReturningSeenStruct = "GetSeenStruct" EventName = "SomeEvent" EventWithFilterName = "SomeEventToFilter" AnyContractName = "TestContract" AnySecondContractName = "Not" + AnyContractName )
View Source
const ( TestItemType = "TestItem" TestItemSliceType = "TestItemSliceType" TestItemArray1Type = "TestItemArray1Type" TestItemArray2Type = "TestItemArray2Type" TestItemWithConfigExtra = "TestItemWithConfigExtra" NilType = "NilType" )
View Source
const AnyExtraValue = 3
Variables ¶
View Source
var AnySliceToReadWithoutAnArgument = []uint64{3, 4}
Functions ¶
func RunChainReaderInterfaceTests ¶
func RunChainReaderInterfaceTests(t *testing.T, tester ChainReaderInterfaceTester)
func RunChainReaderWithStrictArgsInterfaceTest ¶
func RunChainReaderWithStrictArgsInterfaceTest(t *testing.T, tester CodecInterfaceTester)
RunChainReaderWithStrictArgsInterfaceTest is meant to be used by codecs that don't pad They can assure that the right argument size is verified. Padding makes that harder/impossible to verify for come codecs. However, the extra verification is nice to have when possible.
func RunCodecInterfaceFuzzTests ¶
func RunCodecInterfaceFuzzTests(f *testing.F, tester CodecInterfaceTester)
func RunCodecInterfaceTests ¶
func RunCodecInterfaceTests(t *testing.T, tester CodecInterfaceTester)
Types ¶
type BasicTester ¶
type ChainReaderInterfaceTester ¶
type ChainReaderInterfaceTester interface { BasicTester GetChainReader(t *testing.T) types.ChainReader // SetLatestValue is expected to return the same bound contract and method in the same test // Any setup required for this should be done in Setup. // The contract should take a LatestParams as the params and return the nth TestStruct set SetLatestValue(t *testing.T, testStruct *TestStruct) TriggerEvent(t *testing.T, testStruct *TestStruct) GetBindings(t *testing.T) []types.BoundContract MaxWaitTimeForEvents() time.Duration }
type CodecInterfaceTester ¶
type CodecInterfaceTester interface { BasicTester EncodeFields(t *testing.T, request *EncodeRequest) []byte GetCodec(t *testing.T) types.Codec // IncludeArrayEncodingSizeEnforcement is here in case there's no way to have fixed arrays in the encoded values IncludeArrayEncodingSizeEnforcement() bool }
type EncodeRequest ¶
type EncodeRequest struct { TestStructs []TestStruct ExtraField bool MissingField bool TestOn string }
type FilterEventParams ¶
type FilterEventParams struct {
Field int32
}
type InnerTestStruct ¶
type LatestParams ¶
type LatestParams struct {
I int
}
type MidLevelTestStruct ¶
type MidLevelTestStruct struct { FixedBytes [2]byte Inner InnerTestStruct }
type TestStruct ¶
type TestStruct struct { Field *int32 DifferentField string OracleID commontypes.OracleID OracleIDs [32]commontypes.OracleID Account []byte Accounts [][]byte BigField *big.Int NestedStruct MidLevelTestStruct }
func CreateTestStruct ¶
func CreateTestStruct(i int, tester BasicTester) TestStruct
type TestStructMissingField ¶
type TestStructMissingField struct { DifferentField string OracleID commontypes.OracleID OracleIDs [32]commontypes.OracleID Account []byte Accounts [][]byte BigField *big.Int NestedStruct MidLevelTestStruct }
type TestStructWithExtraField ¶
type TestStructWithExtraField struct { TestStruct ExtraField int }
Click to show internal directories.
Click to hide internal directories.