Commit fbd78a5a authored by Hayden Adams's avatar Hayden Adams

rename web to web3Store, remove getBlock interval

parent 37d82f97
This diff is collapsed.
......@@ -8,7 +8,8 @@ import {
FACTORY_CONTRACT_READY,
SET_NETWORK_MESSAGE,
SET_BLOCK_TIMESTAMP,
SET_EXCHANGE_TYPE
SET_EXCHANGE_TYPE,
PUT_WEB3_IN_STORE
} from '../constants';
// this actions folder is actually full of action creators
......@@ -63,3 +64,8 @@ export const setExchangeType = (exchangeType) => ({
type: SET_EXCHANGE_TYPE,
exchangeType
});
export const putWeb3InStore = (globalWeb3) => ({
type: PUT_WEB3_IN_STORE,
globalWeb3
})
......@@ -42,3 +42,6 @@ export const SET_EXCHANGE_INPUT_VALUE = 'SET_EXCHANGE_INPUT_VALUE';
export const SET_EXCHANGE_OUTPUT_VALUE = 'SET_EXCHANGE_OUTPUT_VALUE';
export const SET_EXCHANGE_RATE = 'SET_EXCHANGE_RATE';
export const SET_EXCHANGE_FEE = 'SET_EXCHANGE_FEE';
// test setInteractionState
export const PUT_WEB3_IN_STORE = 'PUT_WEB3_IN_STORE';
import { combineReducers } from 'redux';
import web3 from './web3-reducer';
import web3Store from './web3-reducer';
import exchangeContracts from './exchangeContract-reducer';
import tokenContracts from './tokenContract-reducer';
import exchange from './exchange-reducer';
export default combineReducers({
web3,
web3Store,
exchangeContracts,
tokenContracts,
exchange
......
......@@ -9,11 +9,12 @@ import {
FACTORY_CONTRACT_READY,
SET_NETWORK_MESSAGE,
SET_BLOCK_TIMESTAMP,
SET_EXCHANGE_TYPE
SET_EXCHANGE_TYPE,
PUT_WEB3_IN_STORE
} from '../constants';
export default (state = {}, action) => {
const { connected, currentMaskAddress, metamaskLocked, interaction, factoryContract, networkMessage, timestamp, exchangeType } = action
const { connected, currentMaskAddress, metamaskLocked, interaction, factoryContract, networkMessage, timestamp, exchangeType, globalWeb3 } = action
switch (action.type) {
case WEB3_CONNECTION_SUCCESSFUL:
return Object.assign({}, state, { connected: connected });
......@@ -35,6 +36,8 @@ export default (state = {}, action) => {
return Object.assign({}, state, { blockTimestamp: timestamp });
case SET_EXCHANGE_TYPE:
return Object.assign({}, state, { exchangeType: exchangeType });
case PUT_WEB3_IN_STORE:
return Object.assign({}, state, { globalWeb3: globalWeb3 });
default: return state;
}
}
......@@ -11,7 +11,7 @@ export default {
// lets check if metamask is installed
// also, lets assume that we're disconnected initially
// we're going to need to include a seperate nest for exchange actions
web3: {
web3Store: {
connected: false,
currentMaskAddress: '',
metamaskLocked: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment