Skip to content

Commit

Permalink
Merge pull request #5 from FinBook/master
Browse files Browse the repository at this point in the history
merge changes from master
  • Loading branch information
yizhoucao committed Jan 22, 2019
2 parents bf08da4 + 220bfcb commit b7e3ef7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/DualClassWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class DualClassWrapper extends BaseContractWrapper {
public async fetchPrice(account: string, option: ITransactionOption = {}) {
if (!this.web3Wrapper.isLocal()) return this.web3Wrapper.wrongEnvReject();
const gasPrice = option.gasPrice || (await this.web3Wrapper.getGasPrice());
const gasLimit = option.gasLimit || CST.START_CUSTODIAN_GAS;
const gasLimit = option.gasLimit || CST.FETCH_PRICE_GAS;
const nonce = option.nonce || (await this.web3Wrapper.getTransactionCount(this.address));
return this.contract.methods.fetchPrice().send({
from: account,
Expand Down Expand Up @@ -74,7 +74,7 @@ export default class DualClassWrapper extends BaseContractWrapper {
gasPrice: gasPrice,
gas: gasLimit
})
.on('transactionHash', txHash => resolve(txHash));
.on('transactionHash', (txHash: string) => resolve(txHash));
else
this.contract.methods
.create()
Expand All @@ -84,7 +84,7 @@ export default class DualClassWrapper extends BaseContractWrapper {
gasPrice: gasPrice,
gas: gasLimit
})
.on('transactionHash', txHash => resolve(txHash));
.on('transactionHash', (txHash: string) => resolve(txHash));
});
}

Expand All @@ -101,7 +101,7 @@ export default class DualClassWrapper extends BaseContractWrapper {
gasPrice: gasPrice,
gas: gasLimit
})
.on('transactionHash', txHash => resolve(txHash))
.on('transactionHash', (txHash: string) => resolve(txHash))
);
}

Expand All @@ -117,7 +117,7 @@ export default class DualClassWrapper extends BaseContractWrapper {
gasPrice: gasPrice,
gas: gasLimit
})
.on('transactionHash', txHash => resolve(txHash))
.on('transactionHash', (txHash: string) => resolve(txHash))
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Web3Wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default class Web3Wrapper {
.send({
from: from
})
.on('transactionHash', txHash => resolve(txHash));
.on('transactionHash', (txHash: string) => resolve(txHash));
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/__snapshots__/DualClassWrapper.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Array [
Array [
Object {
"from": "account",
"gas": 1000000,
"gas": 150000,
"gasPrice": 1000000000,
"nonce": 2,
},
Expand Down
5 changes: 3 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ export const RESET_GAS_LIMIT = 4000000;
export const EVENT_FETCH_BLOCK_INTERVAL = 100;
export const EVENT_FETCH_TIME_INVERVAL = 600000;
export const START_CUSTODIAN_GAS = 1000000;
export const START_MAGI_GAS = 1000000;
export const COMMIT_PRICE_GAS = 200000;
export const FETCH_PRICE_GAS = 150000;
export const START_MAGI_GAS = 120000;
export const COMMIT_PRICE_GAS = 60000;
export const DEFAULT_TX_GAS_LIMIT = 30000;

export const BTV_STATE = {
Expand Down

0 comments on commit b7e3ef7

Please sign in to comment.