update to Embark 4

This commit is contained in:
Jonathan Rainville 2019-04-16 15:09:07 -04:00 committed by Barry Gitarts
parent 2138905767
commit 2b1ffba6a4
17 changed files with 10383 additions and 13081 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ build/
lib/
node_modules/
.DS_Store
embarkArtifacts
.mypy_cache
__pycache__

View File

@ -1,4 +1,4 @@
import web3 from 'Embark/web3'
/*global web3*/
import { Q } from '@nozbe/watermelondb'
import database from '../db'
import { getPledges, getAllPledges } from '../utils/pledges'

View File

@ -1,9 +1,9 @@
/*global web3*/
import React, { createRef } from 'react'
import { Formik } from 'formik'
import LiquidPledging from 'Embark/contracts/LiquidPledging'
import {TextField, Button, MenuItem, Snackbar, InputAdornment} from '@material-ui/core'
import CloudUpload from '@material-ui/icons/CloudUpload'
import web3 from 'Embark/web3'
import { MySnackbarContentWrapper } from './base/SnackBars'
import { captureFile } from '../utils/ipfs'
import ImageViewer from './image/ImageViewer'

View File

@ -1,3 +1,4 @@
/*global web3*/
import React, { useContext, useState, useEffect } from 'react';
import { Formik } from 'formik';
import LiquidPledging from 'Embark/contracts/LiquidPledging';
@ -7,7 +8,6 @@ import Snackbar from '@material-ui/core/Snackbar';
import MenuItem from '@material-ui/core/MenuItem';
import FormControlLabel from '@material-ui/core/FormControlLabel'
import Switch from '@material-ui/core/Switch'
import web3 from 'Embark/web3'
import { MySnackbarContentWrapper } from './base/SnackBars'
import { currencies, TOKEN_ICON_API, getTokenLabel } from '../utils/currencies'
import { toEther } from '../utils/conversions'

View File

@ -1,4 +1,4 @@
import web3 from 'Embark/web3'
/*global web3*/
import React, { useMemo } from 'react'
import { Link } from 'react-router-dom'
import Typography from '@material-ui/core/Typography'

View File

@ -1,5 +1,5 @@
/*global web3*/
import EmbarkJS from 'Embark/EmbarkJS'
import web3 from 'Embark/web3'
import LiquidPledging from 'Embark/contracts/LiquidPledging'
import { useState, useEffect, useMemo, useContext } from 'react'
import { unnest } from 'ramda'

View File

@ -1,8 +1,8 @@
/*global web3*/
import React from 'react'
import { HashRouter as Router } from 'react-router-dom'
import EmbarkJS from 'Embark/EmbarkJS'
import LiquidPledging from 'Embark/contracts/LiquidPledging'
import web3 from 'Embark/web3'
import Snackbar from '@material-ui/core/Snackbar'
import { initVaultAndLP, vaultPledgingNeedsInit, standardTokenApproval, getLpAllowance } from './utils/initialize'
import { getAuthorizedPayments } from './utils/events'

View File

@ -1,4 +1,4 @@
import web3 from 'Embark/web3'
/*global web3*/
export const toEther = amount => web3.utils.fromWei(amount, 'ether')
export const toWei = (amount, scale = 'ether') => web3.utils.toWei(amount, scale)

View File

@ -1,4 +1,3 @@
import web3 from 'Embark/web3'
import SNT from 'Embark/contracts/SNT'
import sntIco from 'cryptocurrency-icons/svg/color/snt.svg'

View File

@ -1,8 +1,6 @@
/*global web3*/
import LiquidPledging from 'Embark/contracts/LiquidPledging'
import LPVault from 'Embark/contracts/LPVault'
import web3 from 'Embark/web3'
import { getLastBlockStored } from '../actions/lpEvents'
const AUTHORIZE_PAYMENT = 'AuthorizePayment'
export const GIVER_ADDED = 'GiverAdded'

View File

@ -1,7 +1,7 @@
/*global web3*/
import LPVault from 'Embark/contracts/LPVault'
import LiquidPledging from 'Embark/contracts/LiquidPledging'
import SNT from 'Embark/contracts/SNT'
import web3 from 'Embark/web3'
export const initVaultAndLP = async () => {
let estimateGas;

View File

@ -1,4 +1,4 @@
import web3 from 'Embark/web3'
/*global web3*/
import LiquidPledging from 'Embark/contracts/LiquidPledging'
const { getPledgeDelegate, numberOfPledges, getPledge } = LiquidPledging.methods

View File

@ -27,14 +27,14 @@ module.exports = {
maxpeers: 0, // Maximum number of network peers (network disabled if set to 0) (default: 25)
proxy: true, // Proxy is used to present meaningful information about transactions
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", // Mnemonic used by the simulator to generate a wallet
simulatorBlocktime: 0, // Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining.
account: {
// numAccounts: 3, // When specified, creates accounts for use in the dapp. This option only works in the development environment, and can be used as a quick start option that bypasses the need for MetaMask in development. These accounts are unlocked and funded with the below settings.
// password: "config/development/password", // Password for the created accounts (as specified in the `numAccounts` setting). If `mineWhenNeeded` is enabled (and isDev is not), this password is used to create a development account controlled by the node.
// balance: "5 ether", // Balance to be given to the created accounts (as specified in the `numAccounts` setting)
devPassword: "config/development/devpassword" // [Parity-only] File with a void line to unlock the Parity dev account
accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/development/devpassword"
}
]
},
// merges with the settings in default
@ -62,14 +62,16 @@ module.exports = {
nodiscover: true,
maxpeers: 0,
proxy: true,
account: {
// "address": "", // When specified, uses that address instead of the default one for the network
password: "config/privatenet/password" // Password to unlock the account
},
accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/privatenet/password"
}
],
targetGasLimit: 8000000,
wsHost: "localhost",
wsPort: 8546,
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm",
simulatorBlocktime: 0
},
@ -86,12 +88,14 @@ module.exports = {
nodiscover: true,
maxpeers: 0,
proxy: true,
account: {
// address: "", // When specified, uses that address instead of the default one for the network
password: "config/privatenet/password" // Password to unlock the account
},
accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/privatenet/password"
}
],
targetGasLimit: 8000000,
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm",
simulatorBlocktime: 0
},
@ -100,16 +104,24 @@ module.exports = {
testnet: {
networkType: "testnet",
syncMode: "light",
account: {
accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/testnet/password"
}
]
},
rinkeby: {
networkType: "rinkeby",
syncMode: "light",
account: {
accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/testnet/password"
}
]
},
// merges with the settings in default
@ -119,9 +131,13 @@ module.exports = {
syncMode: "light",
rpcCorsDomain: "http://localhost:8000",
wsOrigins: "http://localhost:8000",
account: {
accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/livenet/password"
}
]
}
// you can name an environment with specific settings and then specify with

View File

@ -66,7 +66,6 @@ contract Pledges is AragonApp, LiquidPledgingStorage {
pledgeState = p.pledgeState;
}
////////////////////
// Internal methods
////////////////////
@ -153,6 +152,7 @@ contract Pledges is AragonApp, LiquidPledgingStorage {
return 0;
}
Pledge storage oldP = _findPledge(p.oldPledge);
return _getPledgeLevel(oldP) + 1; // a loop lookup
return _getPledgeLevel(oldP) + 1;
// a loop lookup
}
}

View File

@ -16,11 +16,12 @@
"webserver": "config/webserver.js"
},
"versions": {
"web3": "1.0.0-beta.34",
"web3": "1.0.0-beta",
"solc": "0.4.18",
"ipfs-api": "17.2.4"
},
"plugins": {
"embarkjs-connector-web3": {}
},
"options": {
"solc": {

23333
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -67,7 +67,7 @@
"cytoscape": "^3.3.0",
"cytoscape-cose-bilkent": "^4.0.0",
"cytoscape-dagre": "^2.2.2",
"embark": "4.0.0-alpha.2",
"embarkjs-connector-web3": "^4.0.0",
"eslint": "^5.9.0",
"eth-contract-class": "^0.0.12",
"formik": "^1.3.2",