-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1276 from smartcontractkit/bugs/runtime-etherscan…
…-host Use etherscan host from job run metadata
- Loading branch information
Showing
12 changed files
with
109 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import reducer, { IState } from '../../reducers' | ||
import { Action } from '../../reducers/config' | ||
|
||
describe('reducers/config', () => { | ||
it('returns an initial state', () => { | ||
const action = {} as Action | ||
const state = reducer({}, action) as IState | ||
|
||
expect(state.search).toEqual({ | ||
etherscanHost: undefined | ||
}) | ||
}) | ||
|
||
it('can update the search query', () => { | ||
const action = { | ||
type: 'UPSERT_JOB_RUN', | ||
data: { | ||
meta: { | ||
jobRun: { | ||
meta: { | ||
etherscanHost: 'ropsten.etherscan.io' | ||
} | ||
} | ||
} | ||
} | ||
} as Action | ||
const state = reducer({}, action) as IState | ||
|
||
expect(state.config).toEqual({ | ||
etherscanHost: 'ropsten.etherscan.io' | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export interface IState { | ||
etherscanHost?: string | ||
} | ||
|
||
export type Action = | ||
| { type: 'UPSERT_JOB_RUN'; data: any } | ||
| { type: '@@redux/INIT' } | ||
| { type: '@@INIT' } | ||
|
||
const initialState = { etherscanHost: undefined } | ||
|
||
export default (state: IState = initialState, action: Action) => { | ||
switch (action.type) { | ||
case 'UPSERT_JOB_RUN': | ||
return Object.assign({}, state, { | ||
etherscanHost: action.data.meta.jobRun.meta.etherscanHost | ||
}) | ||
default: | ||
return state | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters