Documentation ¶
Index ¶
- Constants
- Variables
- func AllExternalInitiators(t testing.TB, store *strpkg.Store) []models.ExternalInitiator
- func AssertCount(t *testing.T, db *gorm.DB, model interface{}, expected int64)
- func AssertCountStays(t testing.TB, store *strpkg.Store, model interface{}, want int64)
- func AssertError(t testing.TB, want bool, err error)
- func AssertEthTxAttemptCountStays(t testing.TB, store *strpkg.Store, want int) []bulletprooftxmanager.EthTxAttempt
- func AssertPipelineRunsStays(t testing.TB, pipelineSpecID int32, store *strpkg.Store, want int) []pipeline.Run
- func AssertPipelineTaskRunsSuccessful(t testing.TB, runs []pipeline.TaskRun)
- func AssertRecordEventually(t *testing.T, store *strpkg.Store, model interface{}, check func() bool)
- func AssertServerResponse(t testing.TB, resp *http.Response, expectedStatusCode int)
- func AwaitJobActive(t testing.TB, jobSpawner job.Spawner, jobID int32, waitFor time.Duration)
- func BatchElemMatchesHash(req rpc.BatchElem, hash common.Hash) bool
- func BatchElemMustMatchHash(t *testing.T, req rpc.BatchElem, hash common.Hash)
- func BigHexInt(val interface{}) hexutil.Big
- func BlockWithTransactions(gasPrices ...int64) *types.Block
- func CallbackOrTimeout(t testing.TB, msg string, callback func(), durationParams ...time.Duration)
- func CompareOCRJobSpecs(t *testing.T, expected, actual job.Job)
- func CreateBridgeTypeViaWeb(t testing.TB, app *TestApplication, payload string) *webpresenters.BridgeResource
- func CreateExternalInitiatorViaWeb(t testing.TB, app *TestApplication, payload string) *webpresenters.ExternalInitiatorAuthentication
- func CreateJobRunViaExternalInitiatorV2(t testing.TB, app *TestApplication, jobID uuid.UUID, eia auth.Token, ...) webpresenters.PipelineRunResource
- func CreateJobViaWeb(t testing.TB, app *TestApplication, request []byte) job.Job
- func CreateJobViaWeb2(t testing.TB, app *TestApplication, spec string) webpresenters.JobResource
- func DecodeSessionCookie(value string) (string, error)
- func DeleteJobViaWeb(t testing.TB, app *TestApplication, jobID int32)
- func EmptyCLIContext() *cli.Context
- func EventuallyExpectationsMet(t *testing.T, mock testifyExpectationsAsserter, timeout time.Duration, ...)
- func FindEthTxWithAttempts(db *gorm.DB, etxID int64) (bulletprooftxmanager.EthTx, error)
- func FixtureCreateJobSpecV2ViaWeb(t *testing.T, app *TestApplication, path string) job.Job
- func GetLastEthTxAttempt(t testing.TB, store *strpkg.Store) bulletprooftxmanager.EthTxAttempt
- func GetLogs(t *testing.T, rv interface{}, logs EthereumLogIterator) []interface{}
- func Head(val interface{}) *models.Head
- func JSONFromBytes(t testing.TB, body []byte) models.JSON
- func JSONFromFixture(t *testing.T, path string) models.JSON
- func JSONFromString(t testing.TB, body string, args ...interface{}) models.JSON
- func JSONResultFromFixture(t *testing.T, path string) models.JSON
- func LogFromFixture(t *testing.T, path string) types.Log
- func MakeConfigDigest(t *testing.T) ocrtypes.ConfigDigest
- func MakeDirectRequestJobSpec(t *testing.T) *job.Job
- func MakeRoundStateReturnData(roundID uint64, eligible bool, ...) []byte
- func Mine(backend *backends.SimulatedBackend, blockTime time.Duration) (stopMining func())
- func MinimalOCRNonBootstrapSpec(contractAddress, transmitterAddress ethkey.EIP55Address, peerID p2pkey.PeerID, ...) string
- func MockApplicationEthCalls(t *testing.T, app *TestApplication, ethClient *mocks.Client) (verify func())
- func MockFluxAggCall(client *mocks.Client, address common.Address, funcName string) *mock.Call
- func MockSubscribeToLogsCh(ethClient *mocks.Client, sub *mocks.Subscription) chan chan<- types.Log
- func MustAddKeyToKeystore(t testing.TB, key ethkey.KeyV2, ethKeyStore keystore.Eth)
- func MustAddRandomKeyToKeystore(t testing.TB, ethKeyStore keystore.Eth) (ethkey.KeyV2, common.Address)
- func MustBigIntFromString(t *testing.T, s string) *big.Int
- func MustBytesToConfigDigest(t *testing.T, b []byte) ocrtypes.ConfigDigest
- func MustGenerateRandomKey(t testing.TB) ethkey.KeyV2
- func MustGenerateSessionCookie(value string) *http.Cookie
- func MustHelloWorldAgreement(t *testing.T) string
- func MustHexDecodeString(s string) []byte
- func MustInsertBroadcastEthTxAttempt(t *testing.T, etxID int64, db *gorm.DB, gasPrice int64) bulletprooftxmanager.EthTxAttempt
- func MustInsertConfirmedEthTxWithAttempt(t *testing.T, db *gorm.DB, nonce int64, broadcastBeforeBlockNum int64, ...) bulletprooftxmanager.EthTx
- func MustInsertConfirmedEthTxWithReceipt(t *testing.T, db *gorm.DB, fromAddress common.Address, nonce, blockNum int64) (etx bulletprooftxmanager.EthTx)
- func MustInsertEthReceipt(t *testing.T, db *gorm.DB, blockNumber int64, blockHash common.Hash, ...) bulletprooftxmanager.EthReceipt
- func MustInsertExternalInitiator(t *testing.T, db *gorm.DB) (ei models.ExternalInitiator)
- func MustInsertExternalInitiatorWithOpts(t *testing.T, db *gorm.DB, opts ExternalInitiatorOpts) (ei models.ExternalInitiator)
- func MustInsertFatalErrorEthTx(t *testing.T, db *gorm.DB, fromAddress common.Address) bulletprooftxmanager.EthTx
- func MustInsertHead(t *testing.T, store *strpkg.Store, number int64) models.Head
- func MustInsertInProgressEthTxWithAttempt(t *testing.T, db *gorm.DB, nonce int64, fromAddress common.Address) bulletprooftxmanager.EthTx
- func MustInsertKeeperJob(t *testing.T, store *strpkg.Store, from ethkey.EIP55Address, ...) job.Job
- func MustInsertKeeperRegistry(t *testing.T, store *strpkg.Store, ethKeyStore keystore.Eth) (keeper.Registry, job.Job)
- func MustInsertOffchainreportingOracleSpec(t *testing.T, db *gorm.DB, transmitterAddress ethkey.EIP55Address) job.OffchainReportingOracleSpec
- func MustInsertPipelineRun(t *testing.T, db *gorm.DB) pipeline.Run
- func MustInsertRandomKey(t testing.TB, keystore keystore.Eth, opts ...interface{}) (ethkey.KeyV2, common.Address)
- func MustInsertSampleDirectRequestJob(t *testing.T, db *gorm.DB) job.Job
- func MustInsertUnconfirmedEthTx(t *testing.T, db *gorm.DB, nonce int64, fromAddress common.Address, ...) bulletprooftxmanager.EthTx
- func MustInsertUnconfirmedEthTxWithBroadcastAttempt(t *testing.T, db *gorm.DB, nonce int64, fromAddress common.Address, ...) bulletprooftxmanager.EthTx
- func MustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t *testing.T, db *gorm.DB, nonce int64, fromAddress common.Address) bulletprooftxmanager.EthTx
- func MustInsertUnfinishedPipelineTaskRun(t *testing.T, store *strpkg.Store, pipelineRunID int64) pipeline.TaskRun
- func MustInsertUnstartedEthTx(t *testing.T, db *gorm.DB, fromAddress common.Address, opts ...interface{}) bulletprooftxmanager.EthTx
- func MustInsertUpkeepForRegistry(t *testing.T, store *strpkg.Store, registry keeper.Registry) keeper.UpkeepRegistration
- func MustInsertV2JobSpec(t *testing.T, store *strpkg.Store, transmitterAddress common.Address) job.Job
- func MustInsertWebhookSpec(t *testing.T, db *gorm.DB) (job.Job, job.WebhookSpec)
- func MustJSONDel(t *testing.T, json, path string) string
- func MustJSONMarshal(t *testing.T, val interface{}) string
- func MustJSONSet(t *testing.T, json, path string, value interface{}) string
- func MustNewJSONSerializable(t *testing.T, s string) pipeline.JSONSerializable
- func MustNewKeyedTransactor(t *testing.T, key *ecdsa.PrivateKey, chainID int64) *bind.TransactOpts
- func MustNewSimulatedBackendKeyedTransactor(t *testing.T, key *ecdsa.PrivateKey) *bind.TransactOpts
- func MustNewUser(t *testing.T, email, password string) models.User
- func MustParseDuration(t testing.TB, durationStr string) time.Duration
- func MustParseURL(input string) *url.URL
- func MustRandomBytes(t *testing.T, l int) (b []byte)
- func MustRandomP2PPeerID(t *testing.T) p2ppeer.ID
- func MustRandomUser() models.User
- func MustReadFile(t testing.TB, file string) []byte
- func MustSendingKeys(t *testing.T, ethKeyStore keystore.Eth) (keys []ethkey.KeyV2)
- func MustWebURL(t *testing.T, s string) *models.WebURL
- func NewAddress() common.Address
- func NewBridgeType(t testing.TB, info ...string) (*models.BridgeTypeAuthentication, *models.BridgeType)
- func NewContractMockReceiver(t *testing.T, ethMock *mocks.Client, abi abi.ABI, address common.Address) contractMockReceiver
- func NewEIP55Address() ethkey.EIP55Address
- func NewEthBroadcaster(t testing.TB, db *gorm.DB, ethClient eth.Client, ...) (*bulletprooftxmanager.EthBroadcaster, func())
- func NewEthClientAndSubMock(t mock.TestingT) (*mocks.Client, *mocks.Subscription)
- func NewEthClientMock(t mock.TestingT) *mocks.Client
- func NewEthConfirmer(t testing.TB, db *gorm.DB, ethClient eth.Client, config config.EVMConfig, ...) *bulletprooftxmanager.EthConfirmer
- func NewEthMocks(t testing.TB) (*mocks.Client, *mocks.Subscription, func())
- func NewEthMocksWithStartupAssertions(t testing.TB) (*mocks.Client, *mocks.Subscription, func())
- func NewEthTx(t *testing.T, fromAddress common.Address) bulletprooftxmanager.EthTx
- func NewEthTxAttempt(t *testing.T, etxID int64) bulletprooftxmanager.EthTxAttempt
- func NewHTTPMockServer(t *testing.T, status int, wantMethod string, response string, ...) (*httptest.Server, func())
- func NewHTTPMockServerWithAlterableResponse(t *testing.T, response func() string) (server *httptest.Server)
- func NewHTTPMockServerWithAlterableResponseAndRequest(t *testing.T, response func() string, callback func(r *http.Request)) (server *httptest.Server)
- func NewHTTPMockServerWithRequest(t *testing.T, status int, response string, callback func(r *http.Request)) (*httptest.Server, func())
- func NewKeyStore(t testing.TB, db *gorm.DB) keystore.Master
- func NewMockAuthenticatedHTTPClient(cfg cmd.HTTPClientConfig, sessionID string) cmd.HTTPClient
- func NewPeerID() p2ppeer.ID
- func NewPipelineORM(t testing.TB, cfg config.GeneralConfig, db *gorm.DB) (pipeline.ORM, postgres.EventBroadcaster, func())
- func NewRandomInt64() int64
- func NewRoundStateForRoundID(store *strpkg.Store, roundID uint32, latestSubmission *big.Int) flux_aggregator_wrapper.OracleRoundState
- func NewRunLog(t *testing.T, jobID common.Hash, emitter common.Address, ...) types.Log
- func NewSession(optionalSessionID ...string) models.Session
- func NewSimulatedBackendIdentity(t *testing.T) *bind.TransactOpts
- func NewStore(t *testing.T, flagsAndDeps ...interface{}) (*strpkg.Store, func())
- func NewStoreWithConfig(t testing.TB, c config.GeneralConfig, flagsAndDeps ...interface{}) (*strpkg.Store, func())
- func NewTestEVMConfig(t testing.TB) *configtest.TestEVMConfig
- func NewWSServer(msg string, callback func(data []byte)) (*httptest.Server, string, func())
- func NormalizedJSON(t testing.TB, input []byte) string
- func NullableTime(t time.Time) null.Time
- func ParseISO8601(t testing.TB, s string) time.Time
- func ParseJSON(t testing.TB, body io.Reader) models.JSON
- func ParseJSONAPIErrors(t testing.TB, body io.Reader) *models.JSONAPIErrors
- func ParseJSONAPIResponse(t testing.TB, resp *http.Response, resource interface{}) error
- func ParseJSONAPIResponseMeta(input []byte) (map[string]*json.RawMessage, error)
- func ParseJSONAPIResponseMetaCount(input []byte) (int, error)
- func ParseNullableTime(t testing.TB, s string) null.Time
- func ParseResponseBody(t testing.TB, resp *http.Response) []byte
- func Random32Byte() (b [32]byte)
- func RandomLog(t *testing.T) types.Log
- func RawNewRoundLog(t *testing.T, contractAddr common.Address, blockHash common.Hash, ...) types.Log
- func RawNewRoundLogWithTopics(t *testing.T, contractAddr common.Address, blockHash common.Hash, ...) types.Log
- func ReadLogs(cfg config.GeneralConfig) (string, error)
- func RequireTxSuccessful(t testing.TB, client TransactionReceipter, txHash common.Hash) *types.Receipt
- func SimulateIncomingHeads(t *testing.T, args SimulateIncomingHeadsArgs) (func(), chan struct{})
- func StringToHash(s string) common.Hash
- func StringToVersionedLogData20190207withoutIndexes(t *testing.T, internalID string, requester common.Address, str string) []byte
- func TransactionsFromGasPrices(gasPrices ...int64) []gas.Transaction
- func TxReceiptFromFixture(t *testing.T, path string) *types.Receipt
- func UnauthenticatedPatch(t testing.TB, url string, body io.Reader, headers map[string]string) (*http.Response, func())
- func UnauthenticatedPost(t testing.TB, url string, body io.Reader, headers map[string]string) (*http.Response, func())
- func WaitForCount(t testing.TB, store *strpkg.Store, model interface{}, want int64)
- func WaitForEthTxAttemptCount(t testing.TB, store *strpkg.Store, want int) []bulletprooftxmanager.EthTxAttempt
- func WaitForEthTxAttemptsForEthTx(t testing.TB, store *strpkg.Store, ethTx bulletprooftxmanager.EthTx) []bulletprooftxmanager.EthTxAttempt
- func WaitForPipelineComplete(t testing.TB, nodeID int, jobID int32, expectedPipelineRuns int, ...) []pipeline.Run
- func WaitForSpecErrorV2(t *testing.T, store *strpkg.Store, jobID int32, count int) []job.SpecError
- func WebURL(t testing.TB, unparsed string) models.WebURL
- type Awaiter
- type BlockedRunner
- type Blocks
- func (b *Blocks) ForkAt(t *testing.T, blockNum int64, numHashes int) *Blocks
- func (b *Blocks) HashesMap() map[int64]common.Hash
- func (b *Blocks) Head(number uint64) *models.Head
- func (b *Blocks) LogOnBlockNum(i uint64, addr common.Address) types.Log
- func (b *Blocks) LogOnBlockNumRemoved(i uint64, addr common.Address) types.Log
- func (b *Blocks) LogOnBlockNumWithIndex(i uint64, logIndex uint, addr common.Address) types.Log
- func (b *Blocks) LogOnBlockNumWithIndexRemoved(i uint64, logIndex uint, addr common.Address) types.Log
- func (b *Blocks) LogOnBlockNumWithTopics(i uint64, logIndex uint, addr common.Address, topics []common.Hash) types.Log
- func (b *Blocks) NewHead(number uint64) *models.Head
- type EmptyRunner
- type EthereumLogIterator
- type EventWebSocketServer
- type ExternalInitiatorOpts
- type HTTPClientCleaner
- func (r *HTTPClientCleaner) Delete(path string) (*http.Response, func())
- func (r *HTTPClientCleaner) Get(path string, headers ...map[string]string) (*http.Response, func())
- func (r *HTTPClientCleaner) Patch(path string, body io.Reader, headers ...map[string]string) (*http.Response, func())
- func (r *HTTPClientCleaner) Post(path string, body io.Reader) (*http.Response, func())
- func (r *HTTPClientCleaner) Put(path string, body io.Reader) (*http.Response, func())
- type HeadBuffer
- type HeadTrackableFunc
- type InstanceAppFactory
- type InstantClock
- type JobPipelineV2TestHelper
- type MockAPIInitializer
- type MockChangePasswordPrompter
- type MockCookieAuthenticator
- type MockCountingPrompter
- type MockCron
- type MockCronEntry
- type MockHeadTrackable
- type MockPasswordPrompter
- type MockSecretGenerator
- type MockSessionRequestBuilder
- type MockSigner
- type MockSubscription
- type NeverSleeper
- type RendererMock
- type SimulateIncomingHeadsArgs
- type SimulatedBackendClient
- func (c *SimulatedBackendClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (c *SimulatedBackendClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
- func (c *SimulatedBackendClient) BlockByNumber(ctx context.Context, n *big.Int) (*types.Block, error)
- func (c *SimulatedBackendClient) Call(result interface{}, method string, args ...interface{}) error
- func (c *SimulatedBackendClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
- func (c *SimulatedBackendClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (c *SimulatedBackendClient) ChainID(context.Context) (*big.Int, error)
- func (c *SimulatedBackendClient) Close()
- func (c *SimulatedBackendClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
- func (c *SimulatedBackendClient) Dial(context.Context) error
- func (c *SimulatedBackendClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- func (c *SimulatedBackendClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) (logs []types.Log, err error)
- func (c *SimulatedBackendClient) GetERC20Balance(address common.Address, contractAddress common.Address) (balance *big.Int, err error)
- func (c *SimulatedBackendClient) GetEthBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*assets.Eth, error)
- func (c *SimulatedBackendClient) GetLINKBalance(linkAddress common.Address, address common.Address) (*assets.Link, error)
- func (c *SimulatedBackendClient) HeadByNumber(ctx context.Context, n *big.Int) (*models.Head, error)
- func (c *SimulatedBackendClient) HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error)
- func (c *SimulatedBackendClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
- func (c *SimulatedBackendClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (c *SimulatedBackendClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (c *SimulatedBackendClient) RoundRobinBatchCallContext(ctx context.Context, b []rpc.BatchElem) error
- func (c *SimulatedBackendClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (c *SimulatedBackendClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, channel chan<- types.Log) (ethereum.Subscription, error)
- func (c *SimulatedBackendClient) SubscribeNewHead(ctx context.Context, channel chan<- *models.Head) (ethereum.Subscription, error)
- func (c *SimulatedBackendClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (c *SimulatedBackendClient) SuggestGasTipCap(ctx context.Context) (tipCap *big.Int, err error)
- func (c *SimulatedBackendClient) TransactionReceipt(ctx context.Context, receipt common.Hash) (*types.Receipt, error)
- type TestApplication
- func NewApplication(t testing.TB, flagsAndDeps ...interface{}) (*TestApplication, func())
- func NewApplicationEthereumDisabled(t *testing.T) (*TestApplication, func())
- func NewApplicationWithConfig(t testing.TB, c *configtest.TestEVMConfig, flagsAndDeps ...interface{}) (*TestApplication, func())
- func NewApplicationWithConfigAndKey(t testing.TB, c *configtest.TestEVMConfig, flagsAndDeps ...interface{}) (*TestApplication, func())
- func NewApplicationWithConfigAndKeyOnSimulatedBlockchain(t testing.TB, tc *configtest.TestEVMConfig, backend *backends.SimulatedBackend, ...) (app *TestApplication, cleanup func())
- func NewApplicationWithKey(t *testing.T, flagsAndDeps ...interface{}) (*TestApplication, func())
- func (ta *TestApplication) Import(content string)
- func (ta *TestApplication) MustSeedNewSession() string
- func (ta *TestApplication) NewAuthenticatingClient(prompter cmd.Prompter) *cmd.Client
- func (ta *TestApplication) NewBox() packr.Box
- func (ta *TestApplication) NewClientAndRenderer() (*cmd.Client, *RendererMock)
- func (ta *TestApplication) NewHTTPClient() HTTPClientCleaner
- func (ta *TestApplication) Start() error
- func (ta *TestApplication) Stop() error
- type TransactionReceipter
- type TriggerClock
Constants ¶
const ( // APIKey of the fixture API user APIKey = "2d25e62eaf9143e993acaf48691564b2" // APISecret of the fixture API user. APISecret = "1eCP/w0llVkchejFaoBpfIGaLRxZK54lTXBCT22YLW+pdzE4Fafy/XO5LoJ2uwHi" // APIEmail is the email of the fixture API user APIEmail = "apiuser@chainlink.test" // Password just a password we use everywhere for testing Password = "p4SsW0rD1!@#_" VRFPassword = "testingpassword" // SessionSecret is the hardcoded secret solely used for test SessionSecret = "clsession_test_secret" // DefaultKeyAddress is the ETH address of the fixture key DefaultKeyAddress = "0xF67D0290337bca0847005C7ffD1BC75BA9AAE6e4" // DefaultKeyFixtureFileName is the filename of the fixture key DefaultKeyFixtureFileName = "testkey-0xF67D0290337bca0847005C7ffD1BC75BA9AAE6e4.json" // DefaultKeyJSON is the JSON for the default key encrypted with fast scrypt and password 'password' (used for fixture file) DefaultKeyJSON = `` /* 491-byte string literal not displayed */ // AllowUnstarted enable an application that can be used in tests without being started AllowUnstarted = "allow_unstarted" // DefaultPeerID is the peer ID of the default p2p key DefaultPeerID = "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X" // A peer ID without an associated p2p key. NonExistentPeerID = "12D3KooWAdCzaesXyezatDzgGvCngqsBqoUqnV9PnVc46jsVt2i9" // DefaultOCRKeyBundleID is the ID of the default ocr key bundle DefaultOCRKeyBundleID = "f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5" )
const ( // DBWaitTimeout is how long we wait by default for something to appear in // the DB. It needs to be fairly long because integration // tests rely on it. DBWaitTimeout = 20 * time.Second // DBPollingInterval can't be too short to avoid DOSing the test database DBPollingInterval = 100 * time.Millisecond // AssertNoActionTimeout shouldn't be too long, or it will slow down tests AssertNoActionTimeout = 3 * time.Second )
const (
UseRealExternalInitiatorManager = "UseRealExternalInitiatorManager"
)
Variables ¶
var ( DefaultP2PPeerID p2pkey.PeerID NonExistentP2PPeerID p2pkey.PeerID // DefaultOCRKeyBundleIDSha256 is the ID of the fixture ocr key bundle DefaultOCRKeyBundleIDSha256 models.Sha256Hash FluxAggAddress = common.HexToAddress("0x3cCad4715152693fE3BC4460591e3D3Fbd071b42") DefaultCSAKey = csakey.MustNewV2XXXTestingOnly(big.NewInt(1)) DefaultOCRKey = ocrkey.MustNewV2XXXTestingOnly(big.NewInt(1)) DefaultP2PKey = p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)) DefaultVRFKey = vrfkey.MustNewV2XXXTestingOnly(big.NewInt(1)) )
var ( // RunLogTopic20190207withoutIndexes was the new RunRequest filter topic as of 2019-01-28, // after renaming Solidity variables, moving data version, and removing the cast of requestId to uint256 RunLogTopic20190207withoutIndexes = utils.MustHash("OracleRequest(bytes32,address,bytes32,uint256,address,bytes4,uint256,uint256,bytes)") )
Functions ¶
func AllExternalInitiators ¶ added in v0.6.6
func AssertCount ¶ added in v0.10.3
func AssertCountStays ¶ added in v0.10.3
func AssertEthTxAttemptCountStays ¶ added in v0.9.6
func AssertEthTxAttemptCountStays(t testing.TB, store *strpkg.Store, want int) []bulletprooftxmanager.EthTxAttempt
AssertEthTxAttemptCountStays asserts that the number of tx attempts remains at the provided value
func AssertPipelineRunsStays ¶ added in v0.10.4
func AssertPipelineRunsStays(t testing.TB, pipelineSpecID int32, store *strpkg.Store, want int) []pipeline.Run
AssertPipelineRunsStays asserts that the number of pipeline runs for a particular job remains at the provided values
func AssertPipelineTaskRunsSuccessful ¶ added in v0.10.11
func AssertRecordEventually ¶ added in v0.10.4
func AssertServerResponse ¶
AssertServerResponse is used to match against a client response, will print any errors returned if the request fails.
func AwaitJobActive ¶ added in v0.10.8
func BatchElemMatchesHash ¶ added in v0.10.0
func BatchElemMustMatchHash ¶ added in v0.10.6
func BlockWithTransactions ¶ added in v0.8.2
BlockWithTransactions returns a new ethereum block with transactions matching the given gas prices
func CallbackOrTimeout ¶
func CompareOCRJobSpecs ¶ added in v0.9.6
`require.Equal` currently has broken handling of `time.Time` values, so we have to do equality comparisons of these structs manually.
func CreateBridgeTypeViaWeb ¶
func CreateBridgeTypeViaWeb( t testing.TB, app *TestApplication, payload string, ) *webpresenters.BridgeResource
CreateBridgeTypeViaWeb creates a bridgetype via web using /v2/bridge_types
func CreateExternalInitiatorViaWeb ¶ added in v0.6.6
func CreateExternalInitiatorViaWeb( t testing.TB, app *TestApplication, payload string, ) *webpresenters.ExternalInitiatorAuthentication
CreateExternalInitiatorViaWeb creates a bridgetype via web using /v2/bridge_types
func CreateJobRunViaExternalInitiatorV2 ¶ added in v0.10.8
func CreateJobRunViaExternalInitiatorV2( t testing.TB, app *TestApplication, jobID uuid.UUID, eia auth.Token, body string, ) webpresenters.PipelineRunResource
func CreateJobViaWeb ¶ added in v0.9.9
func CreateJobViaWeb2 ¶ added in v0.10.4
func CreateJobViaWeb2(t testing.TB, app *TestApplication, spec string) webpresenters.JobResource
func DecodeSessionCookie ¶
func DeleteJobViaWeb ¶ added in v0.10.8
func DeleteJobViaWeb(t testing.TB, app *TestApplication, jobID int32)
func EmptyCLIContext ¶
func EventuallyExpectationsMet ¶ added in v0.10.3
func FindEthTxWithAttempts ¶ added in v0.10.11
FindEthTxWithAttempts finds the EthTx with its attempts and receipts preloaded
func FixtureCreateJobSpecV2ViaWeb ¶ added in v0.9.9
func GetLastEthTxAttempt ¶ added in v0.9.6
func GetLastEthTxAttempt(t testing.TB, store *strpkg.Store) bulletprooftxmanager.EthTxAttempt
func GetLogs ¶ added in v0.8.4
func GetLogs(t *testing.T, rv interface{}, logs EthereumLogIterator) []interface{}
GetLogs drains logs of EVM log representations. Since those log representations don't fit into a type hierarchy, this API is a bit awkward. It returns the logs as a slice of blank interface{}s, and if rv is non-nil, it must be a pointer to a slice for elements of the same type as the logs, in which case GetLogs will append the logs to it.
func JSONFromBytes ¶
JSONFromBytes creates JSON from a given byte array
func JSONFromFixture ¶
JSONFromFixture create models.JSON from file path
func JSONFromString ¶
JSONFromString create JSON from given body and arguments
func JSONResultFromFixture ¶
JSONResultFromFixture create model.JSON with params.result found in the given file path
func LogFromFixture ¶
LogFromFixture create ethtypes.log from file path
func MakeConfigDigest ¶ added in v0.9.7
func MakeConfigDigest(t *testing.T) ocrtypes.ConfigDigest
func MakeDirectRequestJobSpec ¶ added in v0.10.6
func MakeRoundStateReturnData ¶ added in v0.8.3
func Mine ¶ added in v0.10.3
func Mine(backend *backends.SimulatedBackend, blockTime time.Duration) (stopMining func())
Mine forces the simulated backend to produce a new block every 2 seconds
func MinimalOCRNonBootstrapSpec ¶ added in v0.9.6
func MockApplicationEthCalls ¶ added in v0.9.9
func MockApplicationEthCalls(t *testing.T, app *TestApplication, ethClient *mocks.Client) (verify func())
MockApplicationEthCalls mocks all calls made by the chainlink application as standard when starting and stopping
func MockFluxAggCall ¶ added in v0.9.10
func MockSubscribeToLogsCh ¶ added in v0.9.9
func MustAddKeyToKeystore ¶ added in v0.9.9
func MustAddRandomKeyToKeystore ¶ added in v0.9.9
func MustBigIntFromString ¶ added in v0.10.9
func MustBytesToConfigDigest ¶ added in v0.9.7
func MustBytesToConfigDigest(t *testing.T, b []byte) ocrtypes.ConfigDigest
func MustHelloWorldAgreement ¶ added in v0.8.4
MustHelloWorldAgreement returns the fixture hello world agreement
func MustHexDecodeString ¶ added in v0.9.6
func MustInsertBroadcastEthTxAttempt ¶ added in v0.8.7
func MustInsertBroadcastEthTxAttempt(t *testing.T, etxID int64, db *gorm.DB, gasPrice int64) bulletprooftxmanager.EthTxAttempt
func MustInsertConfirmedEthTxWithAttempt ¶ added in v0.8.7
func MustInsertConfirmedEthTxWithReceipt ¶ added in v0.10.7
func MustInsertEthReceipt ¶ added in v0.8.7
func MustInsertExternalInitiator ¶ added in v0.10.11
func MustInsertExternalInitiatorWithOpts ¶ added in v0.10.11
func MustInsertExternalInitiatorWithOpts(t *testing.T, db *gorm.DB, opts ExternalInitiatorOpts) (ei models.ExternalInitiator)
func MustInsertFatalErrorEthTx ¶ added in v0.8.7
func MustInsertHead ¶ added in v0.10.4
func MustInsertInProgressEthTxWithAttempt ¶ added in v0.9.6
func MustInsertKeeperJob ¶ added in v0.10.3
func MustInsertKeeperJob(t *testing.T, store *strpkg.Store, from ethkey.EIP55Address, contract ethkey.EIP55Address) job.Job
func MustInsertKeeperRegistry ¶ added in v0.10.3
func MustInsertOffchainreportingOracleSpec ¶ added in v0.9.0
func MustInsertOffchainreportingOracleSpec(t *testing.T, db *gorm.DB, transmitterAddress ethkey.EIP55Address) job.OffchainReportingOracleSpec
func MustInsertPipelineRun ¶ added in v0.9.10
func MustInsertRandomKey ¶ added in v0.8.11
func MustInsertRandomKey( t testing.TB, keystore keystore.Eth, opts ...interface{}, ) (ethkey.KeyV2, common.Address)
MustInsertRandomKey inserts a randomly generated (not cryptographically secure) key for testing If using this with the keystore, it should be called before the keystore loads keys from the database
func MustInsertSampleDirectRequestJob ¶ added in v0.9.10
func MustInsertUnconfirmedEthTx ¶ added in v0.10.6
func MustInsertUnconfirmedEthTxWithBroadcastAttempt ¶ added in v0.8.7
func MustInsertUnconfirmedEthTxWithInsufficientEthAttempt ¶ added in v0.9.9
func MustInsertUnfinishedPipelineTaskRun ¶ added in v0.9.7
func MustInsertUnstartedEthTx ¶ added in v0.10.5
func MustInsertUpkeepForRegistry ¶ added in v0.10.3
func MustInsertV2JobSpec ¶ added in v0.10.3
func MustInsertWebhookSpec ¶ added in v0.10.11
func MustJSONDel ¶
MustJSONDel uses sjson.Delete to remove a path from a JSON string and returns the string
func MustJSONMarshal ¶ added in v0.10.8
func MustJSONSet ¶
MustJSONSet uses sjson.Set to set a path in a JSON string and returns the string See https://github.com/tidwall/sjson
func MustNewJSONSerializable ¶ added in v0.9.10
func MustNewJSONSerializable(t *testing.T, s string) pipeline.JSONSerializable
func MustNewKeyedTransactor ¶ added in v0.9.9
func MustNewKeyedTransactor(t *testing.T, key *ecdsa.PrivateKey, chainID int64) *bind.TransactOpts
func MustNewSimulatedBackendKeyedTransactor ¶ added in v0.9.9
func MustNewSimulatedBackendKeyedTransactor(t *testing.T, key *ecdsa.PrivateKey) *bind.TransactOpts
func MustNewUser ¶ added in v0.8.4
func MustParseURL ¶
func MustRandomUser ¶ added in v0.8.4
func MustReadFile ¶
MustReadFile loads a file but should never fail
func MustSendingKeys ¶ added in v0.10.8
func NewBridgeType ¶
func NewBridgeType(t testing.TB, info ...string) (*models.BridgeTypeAuthentication, *models.BridgeType)
NewBridgeType create new bridge type given info slice
func NewContractMockReceiver ¶ added in v0.10.3
func NewEIP55Address ¶ added in v0.9.3
func NewEIP55Address() ethkey.EIP55Address
func NewEthBroadcaster ¶ added in v0.9.3
func NewEthBroadcaster(t testing.TB, db *gorm.DB, ethClient eth.Client, keyStore bulletprooftxmanager.KeyStore, config config.EVMConfig, keys []ethkey.KeyV2) (*bulletprooftxmanager.EthBroadcaster, func())
func NewEthClientAndSubMock ¶ added in v1.0.0
func NewEthConfirmer ¶ added in v0.10.10
func NewEthMocks ¶ added in v0.9.9
func NewEthMocksWithStartupAssertions ¶ added in v0.9.9
func NewEthTxAttempt ¶ added in v0.8.7
func NewEthTxAttempt(t *testing.T, etxID int64) bulletprooftxmanager.EthTxAttempt
func NewHTTPMockServer ¶
func NewHTTPMockServer( t *testing.T, status int, wantMethod string, response string, callback ...func(http.Header, string), ) (*httptest.Server, func())
NewHTTPMockServer create http test server with passed in parameters
func NewHTTPMockServerWithAlterableResponse ¶ added in v0.8.4
func NewHTTPMockServerWithAlterableResponseAndRequest ¶ added in v0.10.5
func NewHTTPMockServerWithRequest ¶ added in v0.9.10
func NewHTTPMockServerWithRequest( t *testing.T, status int, response string, callback func(r *http.Request), ) (*httptest.Server, func())
NewHTTPMockServerWithRequest creates http test server that makes the request available in the callback
func NewKeyStore ¶ added in v0.10.8
NewKeyStore returns a new, unlocked keystore
func NewMockAuthenticatedHTTPClient ¶
func NewMockAuthenticatedHTTPClient(cfg cmd.HTTPClientConfig, sessionID string) cmd.HTTPClient
func NewPipelineORM ¶ added in v0.9.3
func NewPipelineORM(t testing.TB, cfg config.GeneralConfig, db *gorm.DB) (pipeline.ORM, postgres.EventBroadcaster, func())
func NewRandomInt64 ¶ added in v0.8.4
func NewRandomInt64() int64
func NewRoundStateForRoundID ¶ added in v0.9.7
func NewRoundStateForRoundID(store *strpkg.Store, roundID uint32, latestSubmission *big.Int) flux_aggregator_wrapper.OracleRoundState
func NewRunLog ¶
func NewRunLog( t *testing.T, jobID common.Hash, emitter common.Address, requester common.Address, blk int, json string, ) types.Log
NewRunLog create types.Log for given jobid, address, block, and json
func NewSession ¶
func NewSimulatedBackendIdentity ¶ added in v0.10.3
func NewSimulatedBackendIdentity(t *testing.T) *bind.TransactOpts
newIdentity returns a go-ethereum abstraction of an ethereum account for interacting with contract golang wrappers
func NewStoreWithConfig ¶
func NewStoreWithConfig(t testing.TB, c config.GeneralConfig, flagsAndDeps ...interface{}) (*strpkg.Store, func())
NewStoreWithConfig creates a new store with given config
func NewTestEVMConfig ¶ added in v1.0.0
func NewTestEVMConfig(t testing.TB) *configtest.TestEVMConfig
func NewWSServer ¶
NewWSServer returns a new wsserver
func NullableTime ¶
NullableTime will return a valid nullable time given time.Time
func ParseISO8601 ¶
ParseISO8601 given the time string it Must parse the time and return it
func ParseJSONAPIErrors ¶
func ParseJSONAPIResponse ¶
ParseJSONAPIResponse parses the response and returns the JSONAPI resource.
func ParseJSONAPIResponseMeta ¶
func ParseJSONAPIResponseMeta(input []byte) (map[string]*json.RawMessage, error)
ParseJSONAPIResponseMeta parses the bytes of the root document and returns a map of *json.RawMessage's within the 'meta' key.
func ParseJSONAPIResponseMetaCount ¶
ParseJSONAPIResponseMetaCount parses the bytes of the root document and returns the value of the 'count' key from the 'meta' section.
func ParseNullableTime ¶
ParseNullableTime given a time string parse it into a null.Time
func ParseResponseBody ¶
ParseResponseBody will parse the given response into a byte slice
func Random32Byte ¶ added in v0.9.0
func Random32Byte() (b [32]byte)
func RawNewRoundLog ¶ added in v0.10.3
func RawNewRoundLogWithTopics ¶ added in v0.10.6
func ReadLogs ¶
func ReadLogs(cfg config.GeneralConfig) (string, error)
ReadLogs returns the contents of the applications log file as a string
func RequireTxSuccessful ¶ added in v0.10.11
func SimulateIncomingHeads ¶ added in v0.10.3
func SimulateIncomingHeads(t *testing.T, args SimulateIncomingHeadsArgs) (func(), chan struct{})
func StringToHash ¶
func TransactionsFromGasPrices ¶ added in v0.10.3
func TransactionsFromGasPrices(gasPrices ...int64) []gas.Transaction
TransactionsFromGasPrices returns transactions matching the given gas prices
func TxReceiptFromFixture ¶
TxReceiptFromFixture create ethtypes.log from file path
func UnauthenticatedPatch ¶
func UnauthenticatedPost ¶ added in v0.6.7
func WaitForCount ¶ added in v0.10.3
func WaitForEthTxAttemptCount ¶ added in v0.9.6
func WaitForEthTxAttemptCount(t testing.TB, store *strpkg.Store, want int) []bulletprooftxmanager.EthTxAttempt
func WaitForEthTxAttemptsForEthTx ¶ added in v0.9.6
func WaitForEthTxAttemptsForEthTx(t testing.TB, store *strpkg.Store, ethTx bulletprooftxmanager.EthTx) []bulletprooftxmanager.EthTxAttempt
func WaitForPipelineComplete ¶ added in v0.9.9
func WaitForSpecErrorV2 ¶ added in v0.10.4
WaitForSpecErrorV2 polls until the passed in jobID has count number of job spec errors.
Types ¶
type Awaiter ¶ added in v0.9.3
type Awaiter chan struct{}
func NewAwaiter ¶ added in v0.9.3
func NewAwaiter() Awaiter
func (Awaiter) AssertHappened ¶ added in v0.10.9
func (Awaiter) AwaitOrFail ¶ added in v0.9.3
func (Awaiter) ItHappened ¶ added in v0.9.3
func (a Awaiter) ItHappened()
type BlockedRunner ¶
type BlockedRunner struct {
Done chan struct{}
}
BlockedRunner is a Runner that blocks until its channel is posted to
func (BlockedRunner) Run ¶
func (r BlockedRunner) Run(app chainlink.Application) error
Run runs the blocked runner, doesn't return until the channel is signalled
type Blocks ¶ added in v0.10.10
type Blocks struct { Hashes []common.Hash Heads map[int64]*models.Head // contains filtered or unexported fields }
Blocks - a helper logic to construct a range of linked heads and an ability to fork and create logs from them
func (*Blocks) LogOnBlockNum ¶ added in v0.10.10
func (*Blocks) LogOnBlockNumRemoved ¶ added in v0.10.10
func (*Blocks) LogOnBlockNumWithIndex ¶ added in v0.10.10
func (*Blocks) LogOnBlockNumWithIndexRemoved ¶ added in v0.10.10
func (*Blocks) LogOnBlockNumWithTopics ¶ added in v0.10.10
type EmptyRunner ¶
type EmptyRunner struct{}
EmptyRunner is an EmptyRunner
func (EmptyRunner) Run ¶
func (r EmptyRunner) Run(app chainlink.Application) error
Run runs the empty runner
type EthereumLogIterator ¶ added in v0.8.4
type EthereumLogIterator interface{ Next() bool }
EthereumLogIterator is the interface provided by gethwrapper representations of EVM logs.
type EventWebSocketServer ¶
type EventWebSocketServer struct { *httptest.Server Connected chan struct{} ReceivedText chan string ReceivedBinary chan []byte URL *url.URL // contains filtered or unexported fields }
EventWebSocketServer is a web socket server designed specifically for testing
func NewEventWebSocketServer ¶
func NewEventWebSocketServer(t *testing.T) (*EventWebSocketServer, func())
NewEventWebSocketServer returns a new EventWebSocketServer
func (*EventWebSocketServer) Broadcast ¶
func (wss *EventWebSocketServer) Broadcast(message string) error
Broadcast sends a message to every web socket client connected to the EventWebSocketServer
func (*EventWebSocketServer) WriteCloseMessage ¶
func (wss *EventWebSocketServer) WriteCloseMessage()
WriteCloseMessage tells connected clients to disconnect. Useful to emulate that the websocket server is shutting down without actually shutting down. This overcomes httptest.Server's inability to restart on the same URL:port.
type ExternalInitiatorOpts ¶ added in v0.10.11
type HTTPClientCleaner ¶
type HTTPClientCleaner struct { HTTPClient cmd.HTTPClient // contains filtered or unexported fields }
func (*HTTPClientCleaner) Delete ¶
func (r *HTTPClientCleaner) Delete(path string) (*http.Response, func())
type HeadBuffer ¶ added in v1.0.0
HeadBuffer - stores heads in sequence, with increasing timestamps
func NewHeadBuffer ¶ added in v1.0.0
func NewHeadBuffer(t *testing.T) *HeadBuffer
func (*HeadBuffer) Append ¶ added in v1.0.0
func (hb *HeadBuffer) Append(head *models.Head)
type HeadTrackableFunc ¶ added in v0.10.3
func (HeadTrackableFunc) OnNewLongestChain ¶ added in v0.10.3
func (fn HeadTrackableFunc) OnNewLongestChain(ctx context.Context, head models.Head)
type InstanceAppFactory ¶
type InstanceAppFactory struct {
App chainlink.Application
}
InstanceAppFactory is an InstanceAppFactory
func (InstanceAppFactory) NewApplication ¶
func (f InstanceAppFactory) NewApplication(config config.EVMConfig) (chainlink.Application, error)
NewApplication creates a new application with specified config
type InstantClock ¶
type InstantClock struct{}
InstantClock an InstantClock
type JobPipelineV2TestHelper ¶ added in v0.10.5
type MockAPIInitializer ¶
type MockAPIInitializer struct {
Count int
}
func (*MockAPIInitializer) Initialize ¶
type MockChangePasswordPrompter ¶
type MockChangePasswordPrompter struct { web.UpdatePasswordRequest // contains filtered or unexported fields }
func (MockChangePasswordPrompter) Prompt ¶
func (m MockChangePasswordPrompter) Prompt() (web.UpdatePasswordRequest, error)
type MockCookieAuthenticator ¶
func (MockCookieAuthenticator) Authenticate ¶
func (m MockCookieAuthenticator) Authenticate(models.SessionRequest) (*http.Cookie, error)
type MockCountingPrompter ¶
type MockCountingPrompter struct { T *testing.T EnteredStrings []string Count int NotTerminal bool }
MockCountingPrompter is a mock counting prompt
func (*MockCountingPrompter) IsTerminal ¶
func (p *MockCountingPrompter) IsTerminal() bool
IsTerminal always returns true in tests
func (*MockCountingPrompter) PasswordPrompt ¶
func (p *MockCountingPrompter) PasswordPrompt(string) string
PasswordPrompt returns an entered string
func (*MockCountingPrompter) Prompt ¶
func (p *MockCountingPrompter) Prompt(string) string
Prompt returns an entered string
type MockCron ¶
type MockCron struct { Entries []MockCronEntry // contains filtered or unexported fields }
MockCron represents a mock cron
func (*MockCron) RunEntries ¶
func (mc *MockCron) RunEntries()
RunEntries run every function for each mockcron entry
type MockCronEntry ¶
type MockCronEntry struct { Schedule string Function func() }
MockCronEntry a cron schedule and function
type MockHeadTrackable ¶
type MockHeadTrackable struct {
// contains filtered or unexported fields
}
MockHeadTrackable allows you to mock HeadTrackable
func (*MockHeadTrackable) OnNewLongestChain ¶ added in v0.8.5
func (m *MockHeadTrackable) OnNewLongestChain(context.Context, models.Head)
OnNewLongestChain increases the OnNewLongestChainCount count by one
func (*MockHeadTrackable) OnNewLongestChainCount ¶ added in v0.8.5
func (m *MockHeadTrackable) OnNewLongestChainCount() int32
OnNewLongestChainCount returns the count of new heads, safely.
type MockPasswordPrompter ¶
type MockPasswordPrompter struct {
Password string
}
func (MockPasswordPrompter) Prompt ¶
func (m MockPasswordPrompter) Prompt() string
type MockSecretGenerator ¶ added in v1.0.0
type MockSecretGenerator struct{}
type MockSessionRequestBuilder ¶
func (*MockSessionRequestBuilder) Build ¶
func (m *MockSessionRequestBuilder) Build(string) (models.SessionRequest, error)
type MockSigner ¶
type MockSigner struct{}
type MockSubscription ¶
type MockSubscription struct { Errors chan error // contains filtered or unexported fields }
MockSubscription a mock subscription
func EmptyMockSubscription ¶
func EmptyMockSubscription() *MockSubscription
EmptyMockSubscription return empty MockSubscription
func (*MockSubscription) Err ¶
func (mes *MockSubscription) Err() <-chan error
Err returns error channel from mes
func (*MockSubscription) Unsubscribe ¶
func (mes *MockSubscription) Unsubscribe()
Unsubscribe closes the subscription
type NeverSleeper ¶
type NeverSleeper struct{}
NeverSleeper is a struct that never sleeps
func (NeverSleeper) Duration ¶
func (ns NeverSleeper) Duration() time.Duration
Duration returns a duration
type RendererMock ¶
type RendererMock struct {
Renders []interface{}
}
RendererMock a mock renderer
func (*RendererMock) Render ¶
func (rm *RendererMock) Render(v interface{}, headers ...string) error
Render appends values to renderer mock
type SimulateIncomingHeadsArgs ¶ added in v0.10.3
type SimulatedBackendClient ¶ added in v0.8.4
type SimulatedBackendClient struct {
// contains filtered or unexported fields
}
SimulatedBackendClient is an eth.Client implementation using a simulated blockchain backend. Note that not all RPC methods are implemented here.
func (*SimulatedBackendClient) BatchCallContext ¶ added in v0.10.0
func (*SimulatedBackendClient) BlockByNumber ¶ added in v0.8.13
func (*SimulatedBackendClient) Call ¶ added in v0.8.4
func (c *SimulatedBackendClient) Call(result interface{}, method string, args ...interface{}) error
Call mocks the ethereum client RPC calls used by chainlink, copying the return value into result.
func (*SimulatedBackendClient) CallContext ¶ added in v0.8.13
func (c *SimulatedBackendClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
func (*SimulatedBackendClient) CallContract ¶ added in v0.8.13
func (*SimulatedBackendClient) Close ¶ added in v0.8.4
func (c *SimulatedBackendClient) Close()
Close terminates the underlying blockchain's update loop.
func (*SimulatedBackendClient) Dial ¶ added in v0.8.13
func (c *SimulatedBackendClient) Dial(context.Context) error
func (*SimulatedBackendClient) EstimateGas ¶ added in v0.9.0
func (c *SimulatedBackendClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
func (*SimulatedBackendClient) FilterLogs ¶ added in v0.8.13
func (c *SimulatedBackendClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) (logs []types.Log, err error)
FilterLogs returns all logs that respect the passed filter query.
func (*SimulatedBackendClient) GetERC20Balance ¶ added in v0.8.4
func (c *SimulatedBackendClient) GetERC20Balance(address common.Address, contractAddress common.Address) (balance *big.Int, err error)
GetERC20Balance returns the balance of the given address for the token contract address.
func (*SimulatedBackendClient) GetEthBalance ¶ added in v0.8.4
func (*SimulatedBackendClient) GetLINKBalance ¶ added in v0.9.6
func (*SimulatedBackendClient) HeadByNumber ¶ added in v0.10.10
func (*SimulatedBackendClient) HeaderByNumber ¶ added in v0.8.13
func (*SimulatedBackendClient) PendingCodeAt ¶ added in v0.9.0
func (*SimulatedBackendClient) PendingNonceAt ¶ added in v0.8.13
func (*SimulatedBackendClient) RoundRobinBatchCallContext ¶ added in v0.10.4
func (*SimulatedBackendClient) SendTransaction ¶ added in v0.8.13
func (c *SimulatedBackendClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*SimulatedBackendClient) SubscribeFilterLogs ¶ added in v0.8.13
func (c *SimulatedBackendClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, channel chan<- types.Log) (ethereum.Subscription, error)
SubscribeToLogs registers a subscription for push notifications of logs from a given address.
func (*SimulatedBackendClient) SubscribeNewHead ¶ added in v0.8.13
func (c *SimulatedBackendClient) SubscribeNewHead( ctx context.Context, channel chan<- *models.Head, ) (ethereum.Subscription, error)
SubscribeToNewHeads registers a subscription for push notifications of new blocks. Note the sim's API only accepts types.Head so we have this goroutine to convert those into models.Head.
func (*SimulatedBackendClient) SuggestGasPrice ¶ added in v0.9.0
func (*SimulatedBackendClient) SuggestGasTipCap ¶ added in v0.10.10
func (*SimulatedBackendClient) TransactionReceipt ¶ added in v0.8.13
func (c *SimulatedBackendClient) TransactionReceipt(ctx context.Context, receipt common.Hash) (*types.Receipt, error)
TransactionReceipt returns the transaction receipt for the given transaction hash.
type TestApplication ¶
type TestApplication struct { *chainlink.ChainlinkApplication Logger *logger.Logger Server *httptest.Server Started bool Backend *backends.SimulatedBackend Key ethkey.KeyV2 // contains filtered or unexported fields }
TestApplication holds the test application and test servers
func NewApplication ¶
func NewApplication(t testing.TB, flagsAndDeps ...interface{}) (*TestApplication, func())
NewApplication creates a New TestApplication along with a NewConfig It mocks the keystore with no keys or accounts by default
func NewApplicationEthereumDisabled ¶ added in v0.10.11
func NewApplicationEthereumDisabled(t *testing.T) (*TestApplication, func())
NewApplicationEthereumDisabled creates a new application with default config but ethereum disabled Useful for testing controllers
func NewApplicationWithConfig ¶
func NewApplicationWithConfig(t testing.TB, c *configtest.TestEVMConfig, flagsAndDeps ...interface{}) (*TestApplication, func())
NewApplicationWithConfig creates a New TestApplication with specified test config
func NewApplicationWithConfigAndKey ¶
func NewApplicationWithConfigAndKey(t testing.TB, c *configtest.TestEVMConfig, flagsAndDeps ...interface{}) (*TestApplication, func())
NewApplicationWithConfigAndKey creates a new TestApplication with the given testorm it will also provide an unlocked account on the keystore
func NewApplicationWithConfigAndKeyOnSimulatedBlockchain ¶ added in v0.8.4
func NewApplicationWithConfigAndKeyOnSimulatedBlockchain( t testing.TB, tc *configtest.TestEVMConfig, backend *backends.SimulatedBackend, flagsAndDeps ...interface{}, ) (app *TestApplication, cleanup func())
func NewApplicationWithKey ¶
func NewApplicationWithKey(t *testing.T, flagsAndDeps ...interface{}) (*TestApplication, func())
NewApplicationWithKey creates a new TestApplication along with a new config It uses the native keystore and will load any keys that are in the database
func (*TestApplication) Import ¶ added in v1.0.0
func (ta *TestApplication) Import(content string)
ImportKey adds private key to the application keystore and database
func (*TestApplication) MustSeedNewSession ¶ added in v0.8.4
func (ta *TestApplication) MustSeedNewSession() string
func (*TestApplication) NewAuthenticatingClient ¶
func (ta *TestApplication) NewAuthenticatingClient(prompter cmd.Prompter) *cmd.Client
func (*TestApplication) NewBox ¶
func (ta *TestApplication) NewBox() packr.Box
func (*TestApplication) NewClientAndRenderer ¶
func (ta *TestApplication) NewClientAndRenderer() (*cmd.Client, *RendererMock)
NewClientAndRenderer creates a new cmd.Client for the test application
func (*TestApplication) NewHTTPClient ¶
func (ta *TestApplication) NewHTTPClient() HTTPClientCleaner
func (*TestApplication) Start ¶ added in v0.8.2
func (ta *TestApplication) Start() error
func (*TestApplication) Stop ¶
func (ta *TestApplication) Stop() error
Stop will stop the test application and perform cleanup
type TransactionReceipter ¶ added in v0.10.11
type TriggerClock ¶
type TriggerClock struct {
// contains filtered or unexported fields
}
TriggerClock implements the AfterNower interface, but must be manually triggered to resume computation on After.
func NewTriggerClock ¶
func NewTriggerClock(t testing.TB) *TriggerClock
NewTriggerClock returns a new TriggerClock, that a test can manually fire to continue processing in a Clock dependency.
func (*TriggerClock) After ¶
func (t *TriggerClock) After(_ time.Duration) <-chan time.Time
After waits on a manual trigger.
func (TriggerClock) Now ¶ added in v0.8.2
func (t TriggerClock) Now() time.Time
Now returns the current local time
func (*TriggerClock) Trigger ¶
func (t *TriggerClock) Trigger()
Trigger sends a time to unblock the After call.
func (*TriggerClock) TriggerWithoutTimeout ¶ added in v0.8.2
func (t *TriggerClock) TriggerWithoutTimeout()
TriggerWithoutTimeout is a special case where we know the trigger might block but don't care