Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/dependencies #198

Merged
merged 22 commits into from Jul 31, 2019
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Fixing additional build issues

  • Loading branch information
Freydal committed Jul 30, 2019
commit 49984ec6fde7fe79d7e573cb7cc617d2fe285c56
@@ -126,7 +126,7 @@ class Create {
const rawRes = await fetch("https://ethgasstation.info/json/ethgasAPI.json");
const parsed = await rawRes.json();
const gasPriceGwei = parsed["safeLow"] ? parsed["safeLow"].toString() : "5";
this.gasPriceWei = new BigNumber(this.web3.utils.toWei(gasPriceGwei, "Gwei"));
this.gasPriceWei = new BigNumber(this.web3.utils.toWei(gasPriceGwei, "Gwei").toString());

this.initialized = true;
}
@@ -306,7 +306,7 @@ class Create {
* create.convertToWei(100) // > "100000000000000000000" (BigNumber)
* ```
*/
convertToWei(etherAmount: string | BigNumber): Promise<string> {
convertToWei(etherAmount: string | BigNumber): string {
return this.web3.utils.toWei(etherAmount.toString());
}

@@ -323,7 +323,7 @@ class Create {
* create.convertToWei(100000000000000000000) // > "100" (BigNumber)
* ```
*/
convertFromWei(weiAmount: string | BigNumber): Promise<string> {
convertFromWei(weiAmount: string | BigNumber): string {
return this.web3.utils.fromWei(weiAmount.toString());
}

@@ -244,7 +244,7 @@ class Gov {
public challenges: Map<StoreChallenge>;
public proposals: Map<Proposal>;

public networkId: string;
public networkId: number;
public coinbase: string;

public kosu: Kosu;
@@ -1,6 +1,6 @@
import { BigNumber } from "@0x/utils";
import { Web3Wrapper } from "@0x/web3-wrapper";
import { artifacts, DeployedAddresses, KosuTokenContract } from "@kosu/system-contracts";
import { DeployedAddresses, KosuTokenContract } from "@kosu/system-contracts";
import { TransactionReceiptWithDecodedLogs } from "ethereum-protocol";
import Web3 from "web3";

@@ -78,7 +78,6 @@ export class KosuToken {
}

this.contract = new KosuTokenContract(
artifacts.KosuToken.compilerOutput.abi,
this.address,
this.web3Wrapper.getProvider(),
{ from: coinbase },
@@ -1,6 +1,6 @@
import { BigNumber } from "@0x/utils";
import { Web3Wrapper } from "@0x/web3-wrapper";
import { artifacts, DeployedAddresses, OrderGatewayContract } from "@kosu/system-contracts";
import { DeployedAddresses, OrderGatewayContract } from "@kosu/system-contracts";
import Web3 from "web3";

import { OrderSerializer } from "./OrderSerializer";
@@ -65,7 +65,6 @@ export class OrderGateway {
*/
private async init(options: KosuOptions): Promise<void> {
const networkId = options.networkId || (await options.web3.eth.net.getId());
const abi = artifacts.OrderGateway.compilerOutput.abi;

if (!this.address) {
this.address = DeployedAddresses[networkId].OrderGateway;
@@ -75,7 +74,7 @@ export class OrderGateway {
throw new Error("Invalid network for OrderGateway");
}

this.contract = new OrderGatewayContract(abi, this.address, this.web3.currentProvider, {
this.contract = new OrderGatewayContract(this.address, this.web3.currentProvider, {
from: await this.web3.eth.getCoinbase().catch(
/* istanbul ignore next */
() => undefined,
@@ -1,6 +1,6 @@
import { BigNumber } from "@0x/utils";
import { Web3Wrapper } from "@0x/web3-wrapper";
import { artifacts, DeployedAddresses, PosterRegistryContract } from "@kosu/system-contracts";
import { DeployedAddresses, PosterRegistryContract } from "@kosu/system-contracts";
import { TransactionReceiptWithDecodedLogs } from "ethereum-protocol";
import Web3 from "web3";

@@ -71,7 +71,6 @@ export class PosterRegistry {
}

this.contract = new PosterRegistryContract(
artifacts.PosterRegistry.compilerOutput.abi,
this.address,
this.web3Wrapper.getProvider(),
{ from: coinbase },
@@ -1,6 +1,6 @@
import { BigNumber } from "@0x/utils";
import { Web3Wrapper } from "@0x/web3-wrapper";
import { artifacts, DeployedAddresses, TreasuryContract } from "@kosu/system-contracts";
import { DeployedAddresses, TreasuryContract } from "@kosu/system-contracts";
import { TransactionReceiptWithDecodedLogs } from "ethereum-protocol";
import Web3 from "web3";

@@ -79,7 +79,6 @@ export class Treasury {
}

this.contract = new TreasuryContract(
artifacts.Treasury.compilerOutput.abi,
this.address,
this.web3Wrapper.getProvider(),
{ from: this.coinbase },
@@ -1,6 +1,6 @@
import { BigNumber } from "@0x/utils";
import { Web3Wrapper } from "@0x/web3-wrapper";
import { artifacts, DeployedAddresses, ValidatorRegistryContract } from "@kosu/system-contracts";
import { DeployedAddresses, ValidatorRegistryContract } from "@kosu/system-contracts";
import { TransactionReceiptWithDecodedLogs } from "ethereum-protocol";
import Web3 from "web3";

@@ -52,7 +52,6 @@ export class ValidatorRegistry {
}

this.contract = new ValidatorRegistryContract(
artifacts.ValidatorRegistry.compilerOutput.abi,
this.address,
this.web3Wrapper.getProvider(),
{ from: this.coinbase },
@@ -1,6 +1,6 @@
import { BigNumber } from "@0x/utils";
import { Web3Wrapper } from "@0x/web3-wrapper";
import { artifacts, DeployedAddresses, VotingContract } from "@kosu/system-contracts";
import { DeployedAddresses, VotingContract } from "@kosu/system-contracts";
import { TransactionReceiptWithDecodedLogs } from "ethereum-protocol";
import Web3 from "web3";

@@ -53,7 +53,6 @@ export class Voting {
}

this.contract = new VotingContract(
artifacts.Voting.compilerOutput.abi,
this.address,
this.web3Wrapper.getProvider(),
{ from: this.coinbase },
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.