Skip to content

Commit

Permalink
udpate gas usage
Browse files Browse the repository at this point in the history
  • Loading branch information
cliff0412 committed Mar 8, 2019
1 parent 8a5fecc commit 4d836d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Web3Wrapper.ts
Expand Up @@ -144,7 +144,7 @@ export class Web3Wrapper {
option: ITransactionOption = {}
): Promise<any> {
const gasPrice = option.gasPrice || (await this.getGasPrice());
const gasLimit = option.gasLimit || CST.DEFAULT_TX_GAS_LIMIT;
const gasLimit = option.gasLimit || CST.SEND_ETH_GAS;
const nonce = option.nonce || (await this.getTransactionCount(from));

return this.web3.eth.sendTransaction({
Expand All @@ -166,7 +166,7 @@ export class Web3Wrapper {
): Promise<any> {
if (this.isReadOnly()) return this.readOnlyReject();
const gasPrice = option.gasPrice || (await this.getGasPrice());
const gasLimit = option.gasLimit || CST.DEFAULT_TX_GAS_LIMIT;
const gasLimit = option.gasLimit || CST.TRANSFER_TOKEN_GAS;
const nonce = option.nonce || (await this.getTransactionCount(from));
const erc20Contract = this.createContract(erc20Abi.abi, contractAddress);

Expand Down
2 changes: 1 addition & 1 deletion src/__snapshots__/Web3Wrapper.eth.test.ts.snap
Expand Up @@ -96,7 +96,7 @@ Array [
Array [
Object {
"from": "from",
"gas": 30000,
"gas": 21000,
"gasPrice": 1000000000,
"nonce": 10,
"to": "to",
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Expand Up @@ -107,6 +107,7 @@ export const UPDATE_OPERATOR = 100000;
export const COMMIT_PRICE_GAS = 80000;
export const UPDATE_ROLE_MANAGER_GAS = 1000000;
export const DEFAULT_TX_GAS_LIMIT = 30000;
export const SEND_ETH_GAS = 21000;
export const START_ROUND_GAS = 300000;
export const END_ROUND_GAS = 300000;

Expand Down

0 comments on commit 4d836d3

Please sign in to comment.