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
7add2a91
Unverified
Commit
7add2a91
authored
May 08, 2020
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove a couple more state constants
parent
5f36437c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
Transactions.tsx
src/contexts/Transactions.tsx
+4
-6
No files found.
src/contexts/Transactions.tsx
View file @
7add2a91
...
@@ -5,9 +5,6 @@ import TxnPopup from '../components/TxnPopup'
...
@@ -5,9 +5,6 @@ import TxnPopup from '../components/TxnPopup'
import
{
useWeb3React
}
from
'
../hooks
'
import
{
useWeb3React
}
from
'
../hooks
'
import
{
useBlockNumber
,
usePopups
}
from
'
./Application
'
import
{
useBlockNumber
,
usePopups
}
from
'
./Application
'
const
BLOCK_NUMBER_CHECKED
=
'
BLOCK_NUMBER_CHECKED
'
const
SUMMARY
=
'
summary
'
const
ADD
=
'
ADD
'
const
ADD
=
'
ADD
'
const
CHECK
=
'
CHECK
'
const
CHECK
=
'
CHECK
'
const
FINALIZE
=
'
FINALIZE
'
const
FINALIZE
=
'
FINALIZE
'
...
@@ -15,6 +12,7 @@ const FINALIZE = 'FINALIZE'
...
@@ -15,6 +12,7 @@ const FINALIZE = 'FINALIZE'
interface
TransactionState
{
interface
TransactionState
{
[
chainId
:
number
]:
{
[
chainId
:
number
]:
{
[
txHash
:
string
]:
{
[
txHash
:
string
]:
{
blockNumberChecked
:
any
response
:
{
response
:
{
customData
?:
any
customData
?:
any
summary
:
any
summary
:
any
...
@@ -62,7 +60,7 @@ function reducer(state: TransactionState, { type, payload }): TransactionState {
...
@@ -62,7 +60,7 @@ function reducer(state: TransactionState, { type, payload }): TransactionState {
...
state
[
networkId
],
...
state
[
networkId
],
[
hash
]:
{
[
hash
]:
{
...
state
[
networkId
]?.[
hash
],
...
state
[
networkId
]?.[
hash
],
[
BLOCK_NUMBER_CHECKED
]
:
blockNumber
blockNumberChecked
:
blockNumber
}
}
}
}
}
}
...
@@ -129,7 +127,7 @@ export function Updater() {
...
@@ -129,7 +127,7 @@ export function Updater() {
let
stale
=
false
let
stale
=
false
Object
.
keys
(
allTransactions
)
Object
.
keys
(
allTransactions
)
.
filter
(
.
filter
(
hash
=>
!
allTransactions
[
hash
].
receipt
&&
allTransactions
[
hash
]
[
BLOCK_NUMBER_CHECKED
]
!==
globalBlockNumber
hash
=>
!
allTransactions
[
hash
].
receipt
&&
allTransactions
[
hash
]
.
blockNumberChecked
!==
globalBlockNumber
)
)
.
forEach
(
hash
=>
{
.
forEach
(
hash
=>
{
library
library
...
@@ -191,7 +189,7 @@ export function useTransactionAdder() {
...
@@ -191,7 +189,7 @@ export function useTransactionAdder() {
if
(
!
hash
)
{
if
(
!
hash
)
{
throw
Error
(
'
No transaction hash found.
'
)
throw
Error
(
'
No transaction hash found.
'
)
}
}
add
(
chainId
,
hash
,
{
...
response
,
customData
:
customData
,
[
SUMMARY
]:
summary
})
add
(
chainId
,
hash
,
{
...
response
,
customData
:
customData
,
summary
})
},
},
[
chainId
,
add
]
[
chainId
,
add
]
)
)
...
...
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