Skip to content

Commit

Permalink
seperate magi and dual setValue gas
Browse files Browse the repository at this point in the history
  • Loading branch information
cliff0412 committed Feb 13, 2019
1 parent 9fbfec1 commit 1b39e92
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/DualClassWrapper.ts
Expand Up @@ -162,7 +162,7 @@ export class DualClassWrapper extends BaseContractWrapper {
if (this.web3Wrapper.isReadOnly()) return this.web3Wrapper.readOnlyReject();
return this.contract.methods
.setValue(index, newValue)
.send(await this.web3Wrapper.getTransactionOption(account, CST.SET_VALUE_GAS, option));
.send(await this.web3Wrapper.getTransactionOption(account, CST.DUAL_CLASS_SET_VALUE_GAS, option));
}

public static convertCustodianState(rawState: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/MagiWrapper.ts
Expand Up @@ -111,7 +111,7 @@ export class MagiWrapper extends BaseContractWrapper {
if (this.web3Wrapper.isReadOnly()) return this.web3Wrapper.readOnlyReject();
return this.contract.methods
.setValue(index, newValue)
.send(await this.web3Wrapper.getTransactionOption(account, CST.SET_VALUE_GAS, option));
.send(await this.web3Wrapper.getTransactionOption(account, CST.MAGI_SET_VALUE_GAS, option));
}

public async updateRoleManager(
Expand Down
6 changes: 3 additions & 3 deletions src/__snapshots__/DualClassWrapper.test.ts.snap
Expand Up @@ -562,7 +562,7 @@ Array [
Array [
Object {
"from": "account",
"gas": 100000,
"gas": 50000,
"gasPrice": 1000000000,
"nonce": 10,
},
Expand All @@ -582,12 +582,12 @@ exports[`setValue 4`] = `
Array [
Array [
"account",
100000,
50000,
Object {},
],
Array [
"account",
100000,
50000,
Object {
"gasLimit": 20000,
"gasPrice": 2000000000,
Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
Expand Up @@ -81,7 +81,8 @@ export const PROVIDER_MYETHER_MAIN = 'https://api.myetherapi.com/eth';
export const PROVIDER_INFURA_MAIN = 'https://mainnet.infura.io';
export const PROVIDER_INFURA_KOVAN = 'https://kovan.infura.io';
export const TRANSFER_TOKEN_GAS = 120000;
export const SET_VALUE_GAS = 100000;
export const MAGI_SET_VALUE_GAS = 100000;
export const DUAL_CLASS_SET_VALUE_GAS = 50000;
export const COLLECT_FEE_GAS = 40000;
export const ADD_ADDR_GAS = 40000;
export const REMOVE_ADDR_GAS = 40000;
Expand Down

0 comments on commit 1b39e92

Please sign in to comment.