Documentation ¶
Index ¶
- Constants
- func AddPrivateKey(config *TestConfig, src string)
- func BasicAuthGet(url string) *http.Response
- func BasicAuthPatch(url string, contentType string, body io.Reader) *http.Response
- func BasicAuthPost(url string, contentType string, body io.Reader) *http.Response
- func BigHexInt(val interface{}) hexutil.Big
- func CheckStatusCode(t *testing.T, resp *http.Response, expected int)
- func CloseGock(t *testing.T)
- func CreateBridgeTypeViaWeb(t *testing.T, app *TestApplication, payload string) models.BridgeType
- func CreateJobRunViaWeb(t *testing.T, app *TestApplication, j models.JobSpec, body ...string) models.JobRun
- func CreateTxAndAttempt(store *store.Store, from common.Address, sentAt uint64) *models.Tx
- func FixtureCreateJobViaWeb(t *testing.T, app *TestApplication, path string) models.JobSpec
- func IndexableBlockNumber(n int64) *models.IndexableBlockNumber
- func JSONFromFixture(path string) models.JSON
- func JSONFromString(body string, args ...interface{}) models.JSON
- func JSONResultFromFixture(path string) models.JSON
- func LoadJSON(file string) []byte
- func LogFromFixture(path string) ethtypes.Log
- func MarkJobRunPending(jr models.JobRun, i int) models.JobRun
- func MustParseWebURL(str string) models.WebURL
- func NewAddress() common.Address
- func NewBridgeType(info ...string) models.BridgeType
- func NewEthereumListener() (*services.EthereumListener, func())
- func NewHTTPMockServer(t *testing.T, status int, wantMethod string, response string, ...) (*httptest.Server, func())
- func NewHash() common.Hash
- func NewJob() models.JobSpec
- func NewJobWithLogInitiator() models.JobSpec
- func NewJobWithSchedule(sched string) models.JobSpec
- func NewJobWithWebInitiator() models.JobSpec
- func NewRunLog(jobID string, addr common.Address, json string) ethtypes.Log
- func NewStore() (*store.Store, func())
- func NewStoreWithConfig(config *TestConfig) (*store.Store, func())
- func NewTask(taskType string, json ...string) models.TaskSpec
- func NewTx(from common.Address, sentAt uint64) *models.Tx
- func NewWSServer(msg string) *httptest.Server
- func NullString(val interface{}) null.String
- func NullTime(val interface{}) null.Time
- func NullableTime(t time.Time) null.Time
- func ObserveLogs() *observer.ObservedLogs
- func ParseISO8601(s string) time.Time
- func ParseNullableTime(s string) null.Time
- func ParseResponseBody(resp *http.Response) []byte
- func RunResultWithError(err error) models.RunResult
- func RunResultWithValue(val string) models.RunResult
- func StringToRunLogData(str string) hexutil.Bytes
- func UpdateJobRunViaWeb(t *testing.T, app *TestApplication, jr models.JobRun, body string) models.JobRun
- func WaitForJobRunStatus(t *testing.T, store *store.Store, jr models.JobRun, status string) models.JobRun
- func WaitForJobRunToComplete(t *testing.T, store *store.Store, jr models.JobRun) models.JobRun
- func WaitForJobRunToPend(t *testing.T, store *store.Store, jr models.JobRun) models.JobRun
- func WaitForRuns(t *testing.T, j models.JobSpec, store *store.Store, want int) []models.JobRun
- func WebURL(unparsed string) models.WebURL
- type CallbackAuthenticator
- type CommonJSON
- type EmptyAppFactory
- type EmptyApplication
- type EmptyRunner
- type EthMock
- func (mock *EthMock) AllCalled() bool
- func (mock *EthMock) Call(result interface{}, method string, args ...interface{}) error
- func (mock *EthMock) EnsureAllCalled(t *testing.T)
- func (mock *EthMock) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (models.EthSubscription, error)
- func (mock *EthMock) Register(method string, response interface{}, ...)
- func (mock *EthMock) RegisterError(method, errMsg string)
- func (mock *EthMock) RegisterNewHead(blockNumber int64) chan models.BlockHeader
- func (mock *EthMock) RegisterNewHeads() chan models.BlockHeader
- func (mock *EthMock) RegisterSubscription(name string, channels ...interface{}) MockSubscription
- type InstanceAppFactory
- type InstantClock
- type MockCountingPrompt
- type MockCron
- type MockCronEntry
- type MockHeadTrackable
- type MockResponse
- type MockSubscription
- type NeverClock
- type NeverSleeper
- type RendererMock
- type SettableClock
- type TestApplication
- type TestConfig
Constants ¶
View Source
const Password = "password"
View Source
const RootDir = "/tmp/chainlink_test"
View Source
const Username = "testusername"
Variables ¶
This section is empty.
Functions ¶
func AddPrivateKey ¶
func AddPrivateKey(config *TestConfig, src string)
func BasicAuthGet ¶
func BasicAuthPatch ¶
func BasicAuthPost ¶
func CreateBridgeTypeViaWeb ¶
func CreateBridgeTypeViaWeb( t *testing.T, app *TestApplication, payload string, ) models.BridgeType
func CreateJobRunViaWeb ¶
func CreateTxAndAttempt ¶
func FixtureCreateJobViaWeb ¶
func IndexableBlockNumber ¶
func IndexableBlockNumber(n int64) *models.IndexableBlockNumber
func JSONFromFixture ¶
func JSONFromString ¶
func JSONResultFromFixture ¶
func LogFromFixture ¶
func MustParseWebURL ¶
func NewAddress ¶
func NewBridgeType ¶
func NewBridgeType(info ...string) models.BridgeType
func NewEthereumListener ¶
func NewEthereumListener() (*services.EthereumListener, func())
func NewHTTPMockServer ¶
func NewJobWithLogInitiator ¶
func NewJobWithSchedule ¶
func NewJobWithWebInitiator ¶
func NewStoreWithConfig ¶
func NewStoreWithConfig(config *TestConfig) (*store.Store, func())
func NewWSServer ¶
func NullString ¶
func ObserveLogs ¶
func ObserveLogs() *observer.ObservedLogs
func ParseISO8601 ¶
func ParseNullableTime ¶
func ParseResponseBody ¶
func RunResultWithError ¶
func RunResultWithValue ¶
func StringToRunLogData ¶
func UpdateJobRunViaWeb ¶
func WaitForJobRunStatus ¶
func WaitForJobRunToComplete ¶
func WaitForJobRunToPend ¶
func WaitForRuns ¶
Types ¶
type CallbackAuthenticator ¶
func (CallbackAuthenticator) Authenticate ¶
func (a CallbackAuthenticator) Authenticate(store *store.Store, pwd string)
type CommonJSON ¶
func ParseCommonJSON ¶
func ParseCommonJSON(body io.Reader) CommonJSON
type EmptyAppFactory ¶
type EmptyAppFactory struct{}
func (EmptyAppFactory) NewApplication ¶
func (f EmptyAppFactory) NewApplication(config store.Config) services.Application
type EmptyApplication ¶
type EmptyApplication struct{}
func (*EmptyApplication) GetStore ¶
func (a *EmptyApplication) GetStore() *store.Store
func (*EmptyApplication) Start ¶
func (a *EmptyApplication) Start() error
func (*EmptyApplication) Stop ¶
func (a *EmptyApplication) Stop() error
type EmptyRunner ¶
type EmptyRunner struct{}
func (EmptyRunner) Run ¶
func (r EmptyRunner) Run(app services.Application) error
type EthMock ¶
type EthMock struct { Responses []MockResponse Subscriptions []MockSubscription // contains filtered or unexported fields }
func MockEthOnStore ¶
func (*EthMock) EnsureAllCalled ¶
func (*EthMock) EthSubscribe ¶
func (*EthMock) RegisterError ¶
func (*EthMock) RegisterNewHead ¶
func (mock *EthMock) RegisterNewHead(blockNumber int64) chan models.BlockHeader
func (*EthMock) RegisterNewHeads ¶
func (mock *EthMock) RegisterNewHeads() chan models.BlockHeader
func (*EthMock) RegisterSubscription ¶
func (mock *EthMock) RegisterSubscription(name string, channels ...interface{}) MockSubscription
type InstanceAppFactory ¶
type InstanceAppFactory struct {
App services.Application
}
func (InstanceAppFactory) NewApplication ¶
func (f InstanceAppFactory) NewApplication(config store.Config) services.Application
type InstantClock ¶
type InstantClock struct{}
func (InstantClock) Now ¶
func (InstantClock) Now() time.Time
type MockCountingPrompt ¶
func (*MockCountingPrompt) Prompt ¶
func (p *MockCountingPrompt) Prompt(string) string
type MockCron ¶
type MockCron struct {
Entries []MockCronEntry
}
func NewMockCron ¶
func NewMockCron() *MockCron
func (*MockCron) RunEntries ¶
func (mc *MockCron) RunEntries()
type MockCronEntry ¶
type MockCronEntry struct { Schedule string Function func() }
type MockHeadTrackable ¶
func (*MockHeadTrackable) Connect ¶
func (m *MockHeadTrackable) Connect() error
func (*MockHeadTrackable) Disconnect ¶
func (m *MockHeadTrackable) Disconnect()
func (*MockHeadTrackable) OnNewHead ¶
func (m *MockHeadTrackable) OnNewHead(*models.BlockHeader)
type MockResponse ¶
type MockResponse struct {
// contains filtered or unexported fields
}
type MockSubscription ¶
type MockSubscription struct { Errors chan error // contains filtered or unexported fields }
func EmptyMockSubscription ¶
func EmptyMockSubscription() MockSubscription
func (MockSubscription) Err ¶
func (mes MockSubscription) Err() <-chan error
func (MockSubscription) Unsubscribe ¶
func (mes MockSubscription) Unsubscribe()
type NeverClock ¶
type NeverClock struct{}
func (NeverClock) Now ¶
func (NeverClock) Now() time.Time
type NeverSleeper ¶
type NeverSleeper struct{}
func (NeverSleeper) Duration ¶
func (ns NeverSleeper) Duration() time.Duration
func (NeverSleeper) Reset ¶
func (ns NeverSleeper) Reset()
func (NeverSleeper) Sleep ¶
func (ns NeverSleeper) Sleep()
type RendererMock ¶
type RendererMock struct {
Renders []interface{}
}
func NewClientAndRenderer ¶
func NewClientAndRenderer(config store.Config) (*cmd.Client, *RendererMock)
func (*RendererMock) Render ¶
func (rm *RendererMock) Render(v interface{}) error
type SettableClock ¶
type SettableClock struct {
// contains filtered or unexported fields
}
func UseSettableClock ¶
func UseSettableClock(s *store.Store) *SettableClock
func (*SettableClock) Now ¶
func (clock *SettableClock) Now() time.Time
func (*SettableClock) SetTime ¶
func (clock *SettableClock) SetTime(t time.Time)
type TestApplication ¶
type TestApplication struct { *services.ChainlinkApplication Server *httptest.Server // contains filtered or unexported fields }
func NewApplication ¶
func NewApplication() (*TestApplication, func())
func NewApplicationWithConfig ¶
func NewApplicationWithConfig(tc *TestConfig) (*TestApplication, func())
func NewApplicationWithKeyStore ¶
func NewApplicationWithKeyStore() (*TestApplication, func())
func (*TestApplication) InstantClock ¶
func (ta *TestApplication) InstantClock() InstantClock
func (*TestApplication) MockEthClient ¶
func (ta *TestApplication) MockEthClient() *EthMock
func (*TestApplication) Stop ¶
func (ta *TestApplication) Stop() error
type TestConfig ¶
func NewConfig ¶
func NewConfig() (*TestConfig, func())
func NewConfigWithWSServer ¶
func NewConfigWithWSServer(wsserver *httptest.Server) *TestConfig
func (*TestConfig) SetEthereumServer ¶
func (tc *TestConfig) SetEthereumServer(wss *httptest.Server)
Click to show internal directories.
Click to hide internal directories.