Change custom network typing
This commit is contained in:
parent
dd896d197d
commit
86f8302d2b
|
@ -7,12 +7,10 @@ import {
|
|||
import { CustomNetworkConfig } from 'reducers/config/networks/typings';
|
||||
|
||||
// TODO: this doesn't accurately represent state, as
|
||||
interface State1 {
|
||||
export interface State {
|
||||
[customNetworkId: string]: CustomNetworkConfig;
|
||||
}
|
||||
|
||||
export type State = Partial<State1>;
|
||||
|
||||
const addCustomNetwork = (state: State, { payload }: AddCustomNetworkAction): State => ({
|
||||
...state,
|
||||
[payload.id]: payload.config
|
||||
|
|
|
@ -35,7 +35,7 @@ export const getNetworkContracts = (state: AppState): NetworkContract[] | null =
|
|||
return network ? network.contracts : [];
|
||||
};
|
||||
|
||||
export const getCustomNetworkConfigs = (state: AppState): (CustomNetworkConfig | undefined)[] => {
|
||||
export const getCustomNetworkConfigs = (state: AppState): CustomNetworkConfig[] => {
|
||||
const { customNetworks } = getNetworks(state);
|
||||
return Object.values(customNetworks);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue