diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-02-01 06:55:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-01 06:55:50 +0800 |
commit | 6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2 (patch) | |
tree | 5a7b3b1601cf34c14be2ba462f5fd2db711e1f2b /packages/0x.js/contract_templates | |
parent | 75539bf67537f202bc1075b096fd70f64705867e (diff) | |
parent | 78fbf0f7bade62a3d1c36bddf20cbe89c86aac18 (diff) | |
download | dexon-sol-tools-6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2.tar dexon-sol-tools-6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2.tar.gz dexon-sol-tools-6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2.tar.bz2 dexon-sol-tools-6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2.tar.lz dexon-sol-tools-6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2.tar.xz dexon-sol-tools-6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2.tar.zst dexon-sol-tools-6682abf89dcdf566f05f8d88cb6af06c4bb1f6a2.zip |
Merge pull request #354 from 0xProject/feature/tslint-config/underscore-protected-members
Modify lint rules to enforce underscore for protected members
Diffstat (limited to 'packages/0x.js/contract_templates')
3 files changed, 8 insertions, 8 deletions
diff --git a/packages/0x.js/contract_templates/contract.handlebars b/packages/0x.js/contract_templates/contract.handlebars index 3e501cce6..d3fe1b8cc 100644 --- a/packages/0x.js/contract_templates/contract.handlebars +++ b/packages/0x.js/contract_templates/contract.handlebars @@ -20,6 +20,6 @@ export class {{contractName}}Contract extends BaseContract { {{/each}} constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { super(web3ContractInstance, defaults); - classUtils.bindAll(this, ['web3ContractInstance', 'defaults']); + classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']); } } // tslint:disable:max-file-line-count diff --git a/packages/0x.js/contract_templates/partials/call.handlebars b/packages/0x.js/contract_templates/partials/call.handlebars index ef4bda724..0475136f0 100644 --- a/packages/0x.js/contract_templates/partials/call.handlebars +++ b/packages/0x.js/contract_templates/partials/call.handlebars @@ -5,8 +5,8 @@ public {{this.name}} = { ): Promise<{{> return_type outputs=outputs}}> { const self = this as {{contractName}}Contract; const result = await promisify<{{> return_type outputs=outputs}}>( - self.web3ContractInstance.{{this.name}}.call, - self.web3ContractInstance, + self._web3ContractInstance.{{this.name}}.call, + self._web3ContractInstance, )( {{> params inputs=inputs}} ); diff --git a/packages/0x.js/contract_templates/partials/tx.handlebars b/packages/0x.js/contract_templates/partials/tx.handlebars index 8a43e5319..9df83266a 100644 --- a/packages/0x.js/contract_templates/partials/tx.handlebars +++ b/packages/0x.js/contract_templates/partials/tx.handlebars @@ -9,7 +9,7 @@ public {{this.name}} = { {{/this.payable}} ): Promise<string> { const self = this as {{contractName}}Contract; - const txDataWithDefaults = await self.applyDefaultsToTxDataAsync( + const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( txData, self.{{this.name}}.estimateGasAsync.bind( self, @@ -17,7 +17,7 @@ public {{this.name}} = { ), ); const txHash = await promisify<string>( - self.web3ContractInstance.{{this.name}}, self.web3ContractInstance, + self._web3ContractInstance.{{this.name}}, self._web3ContractInstance, )( {{> params inputs=inputs}} txDataWithDefaults, @@ -29,11 +29,11 @@ public {{this.name}} = { txData: TxData = {}, ): Promise<number> { const self = this as {{contractName}}Contract; - const txDataWithDefaults = await self.applyDefaultsToTxDataAsync( + const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( txData, ); const gas = await promisify<number>( - self.web3ContractInstance.{{this.name}}.estimateGas, self.web3ContractInstance, + self._web3ContractInstance.{{this.name}}.estimateGas, self._web3ContractInstance, )( {{> params inputs=inputs}} txDataWithDefaults, @@ -45,7 +45,7 @@ public {{this.name}} = { txData: TxData = {}, ): string { const self = this as {{contractName}}Contract; - const abiEncodedTransactionData = self.web3ContractInstance.{{this.name}}.getData(); + const abiEncodedTransactionData = self._web3ContractInstance.{{this.name}}.getData(); return abiEncodedTransactionData; }, }; |