aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-03 20:50:25 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-10-04 16:14:19 +0800
commit44abf283ec80cbb33f0b6aad12cd1a7dc657debd (patch)
treea09885e95a1b04c32a3c1c02a8d7c4e66ec51db6
parent671bc7c91731828a4ee484994dacf7d3beb800e3 (diff)
downloaddexon-sol-tools-44abf283ec80cbb33f0b6aad12cd1a7dc657debd.tar
dexon-sol-tools-44abf283ec80cbb33f0b6aad12cd1a7dc657debd.tar.gz
dexon-sol-tools-44abf283ec80cbb33f0b6aad12cd1a7dc657debd.tar.bz2
dexon-sol-tools-44abf283ec80cbb33f0b6aad12cd1a7dc657debd.tar.lz
dexon-sol-tools-44abf283ec80cbb33f0b6aad12cd1a7dc657debd.tar.xz
dexon-sol-tools-44abf283ec80cbb33f0b6aad12cd1a7dc657debd.tar.zst
dexon-sol-tools-44abf283ec80cbb33f0b6aad12cd1a7dc657debd.zip
Add keccak256 on web3_wrapper
-rw-r--r--src/web3_wrapper.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts
index 653205988..7576f3d40 100644
--- a/src/web3_wrapper.ts
+++ b/src/web3_wrapper.ts
@@ -112,6 +112,10 @@ export class Web3Wrapper {
const logs = await this.sendRawPayloadAsync(payload);
return logs;
}
+ public keccak256(data: string): string {
+ const hash = this.web3.sha3(data);
+ return hash;
+ }
private getContractInstance<A extends Web3.ContractInstance>(abi: Web3.ContractAbi, address: string): A {
const web3ContractInstance = this.web3.eth.contract(abi).at(address);
const contractInstance = new Contract(web3ContractInstance, this.defaults) as any as A;