Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
fbd78a5a
Commit
fbd78a5a
authored
Mar 15, 2018
by
Hayden Adams
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename web to web3Store, remove getBlock interval
parent
37d82f97
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
86 deletions
+101
-86
App.js
src/App.js
+63
-60
web3-actions.js
src/actions/web3-actions.js
+12
-6
constants.js
src/constants.js
+7
-4
index.js
src/reducers/index.js
+3
-3
web3-reducer.js
src/reducers/web3-reducer.js
+8
-5
initial-state.js
src/store/initial-state.js
+8
-8
No files found.
src/App.js
View file @
fbd78a5a
This diff is collapsed.
Click to expand it.
src/actions/web3-actions.js
View file @
fbd78a5a
...
...
@@ -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
})
src/constants.js
View file @
fbd78a5a
...
...
@@ -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
'
;
src/reducers/index.js
View file @
fbd78a5a
import
{
combineReducers
}
from
'
redux
'
;
import
web3
from
'
./web3-reducer
'
;
import
web3
Store
from
'
./web3-reducer
'
;
import
exchangeContracts
from
'
./exchangeContract-reducer
'
;
import
tokenContracts
from
'
./tokenContract-reducer
'
;
import
exchange
from
'
./exchange-reducer
'
;
export
default
combineReducers
({
web3
,
web3
Store
,
exchangeContracts
,
tokenContracts
,
exchange
...
...
src/reducers/web3-reducer.js
View file @
fbd78a5a
...
...
@@ -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
;
}
}
src/store/initial-state.js
View file @
fbd78a5a
...
...
@@ -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
:
{
web3
Store
:
{
connected
:
false
,
currentMaskAddress
:
''
,
metamaskLocked
:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment