forked from HeathWallace/coinface
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conditionally use struct or a no-op based on NODE_ENV
- Loading branch information
Dan Hughes
committed
Feb 21, 2018
1 parent
623150d
commit b58532e
Showing
5 changed files
with
71 additions
and
14 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,17 +1,18 @@ | ||
// https://github.com/HeathWallace/ethereum-pos/issues/28 | ||
// import { struct } from 'superstruct'; | ||
import { struct as structLib } from '../lib/superstruct'; | ||
import env from '../utils/environment'; | ||
|
||
const struct = () => x => x; | ||
const structFake = () => x => x; | ||
structFake.union = () => {}; | ||
|
||
const struct = env.NODE_ENV === 'production' ? structFake : structLib; | ||
|
||
export const Transaction = struct({ | ||
'address': 'string', | ||
'topics': ['string'], | ||
'data': 'string', | ||
'blockNumber': 'string', | ||
'timeStamp': 'string', | ||
'gasPrice': 'string', | ||
'gasUsed': 'string', | ||
'logIndex': 'string', | ||
'from': 'string', | ||
'timestamp': 'number', | ||
'to': 'string', | ||
'tokenInfo': struct.union(['boolean', 'object']), // API is inconsistent with what it returns here. | ||
'transactionHash': 'string', | ||
'transactionIndex': 'string', | ||
'type': 'string', | ||
'value': 'string', | ||
}); |
Empty file.