From 7079e65cfbadcc2fa366f74362e3d2b576f81745 Mon Sep 17 00:00:00 2001 From: Joaquin Gonzalez Date: Wed, 23 Jan 2019 16:31:30 -0300 Subject: [PATCH 1/5] Update definition for web3 (getPastLog method) --- types/web3/eth/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/web3/eth/index.d.ts b/types/web3/eth/index.d.ts index 1ed2a1094b..8d7a5fc823 100644 --- a/types/web3/eth/index.d.ts +++ b/types/web3/eth/index.d.ts @@ -122,7 +122,7 @@ export default interface Eth { fromBlock?: BlockType; toBlock?: BlockType; address?: string; - topics?: Array; + topics?: Array; }, cb?: Callback ): Promise; From 8e4195600d1e4c1df9d2fddfb365b3b95443f76d Mon Sep 17 00:00:00 2001 From: Joaquin Gonzalez Date: Thu, 24 Jan 2019 11:08:39 -0300 Subject: [PATCH 2/5] [Web3]: Add Test for getPastLogs --- types/web3/web3-tests.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/web3/web3-tests.ts b/types/web3/web3-tests.ts index e13c0a9254..9f30c4f1ad 100644 --- a/types/web3/web3-tests.ts +++ b/types/web3/web3-tests.ts @@ -1,6 +1,6 @@ import Web3 = require("web3"); import BigNumber = require("bn.js"); -import { TransactionReceipt } from "web3/types"; +import { TransactionReceipt, Log } from "web3/types"; import PromiEvent from "web3/promiEvent"; import { NEW_ABI_STANDARD, OLD_ABI_STANDARD } from "web3/test/abi-tests"; import { Provider, JsonRPCResponse } from "web3/providers"; @@ -37,6 +37,15 @@ web3.eth.setProvider(myProvider); // // web3.eth // -------------------------------------------------------------------------- +const logs: Promise = web3.eth.getPastLogs( + { + fromBlock: "latest", + address: contractAddress, + topics: [ + null, + "0x1" + ] +}) const storage: Promise = web3.eth.getStorageAt(contractAddress, 0); const balance1: Promise = web3.eth.getBalance(contractAddress); const balance2: Promise = web3.eth.getBalance(contractAddress, "latest"); From 87186d9d038e2f01524c02fb4f570fd50467d3e3 Mon Sep 17 00:00:00 2001 From: Joaquin Gonzalez Date: Thu, 24 Jan 2019 11:18:56 -0300 Subject: [PATCH 3/5] fix no-trailing-whitespace --- types/web3/web3-tests.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/types/web3/web3-tests.ts b/types/web3/web3-tests.ts index 9f30c4f1ad..91d811f2f1 100644 --- a/types/web3/web3-tests.ts +++ b/types/web3/web3-tests.ts @@ -37,15 +37,14 @@ web3.eth.setProvider(myProvider); // // web3.eth // -------------------------------------------------------------------------- -const logs: Promise = web3.eth.getPastLogs( - { - fromBlock: "latest", - address: contractAddress, - topics: [ - null, - "0x1" - ] -}) +const logs: Promise = web3.eth.getPastLogs({ + fromBlock: "latest", + address: contractAddress, + topics: [ + null, + "0x1" + ] +}); const storage: Promise = web3.eth.getStorageAt(contractAddress, 0); const balance1: Promise = web3.eth.getBalance(contractAddress); const balance2: Promise = web3.eth.getBalance(contractAddress, "latest"); @@ -54,7 +53,7 @@ web3.eth.getBalance(contractAddress, "latest", (error: Error, balance: BigNumber web3.eth.getBalance(contractAddress, 1, (error: Error, balance: BigNumber) => { }); const sendSignedTransactionTxReceipt0: PromiEvent = web3.eth.sendSignedTransaction("", - (error: Error, txHash: string) => { }); +(error: Error, txHash: string) => { }); const sendSignedTransactionTxReceipt1: PromiEvent = web3.eth.sendSignedTransaction("") .on("transactionHash", (txHash: string) => { }); const sendSignedTransactionTxReceipt2: PromiEvent = web3.eth.sendSignedTransaction("") From 295b6b3de148ba77e843e599920363d687ceb1d2 Mon Sep 17 00:00:00 2001 From: Joaquin Gonzalez Date: Thu, 24 Jan 2019 11:24:57 -0300 Subject: [PATCH 4/5] fix no-trailing-whitespace --- types/web3/web3-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/web3/web3-tests.ts b/types/web3/web3-tests.ts index 91d811f2f1..6e2fc5ae37 100644 --- a/types/web3/web3-tests.ts +++ b/types/web3/web3-tests.ts @@ -37,7 +37,7 @@ web3.eth.setProvider(myProvider); // // web3.eth // -------------------------------------------------------------------------- -const logs: Promise = web3.eth.getPastLogs({ +const logs: Promise = web3.eth.getPastLogs({ fromBlock: "latest", address: contractAddress, topics: [ From 0903c7eb27c2a57371accc552a935e8582319133 Mon Sep 17 00:00:00 2001 From: Joaquin Pablo Gonzalez Date: Thu, 24 Jan 2019 14:06:37 -0300 Subject: [PATCH 5/5] Update web3-tests.ts --- types/web3/web3-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/web3/web3-tests.ts b/types/web3/web3-tests.ts index 6e2fc5ae37..2ed12f0d8c 100644 --- a/types/web3/web3-tests.ts +++ b/types/web3/web3-tests.ts @@ -53,7 +53,7 @@ web3.eth.getBalance(contractAddress, "latest", (error: Error, balance: BigNumber web3.eth.getBalance(contractAddress, 1, (error: Error, balance: BigNumber) => { }); const sendSignedTransactionTxReceipt0: PromiEvent = web3.eth.sendSignedTransaction("", -(error: Error, txHash: string) => { }); + (error: Error, txHash: string) => { }); const sendSignedTransactionTxReceipt1: PromiEvent = web3.eth.sendSignedTransaction("") .on("transactionHash", (txHash: string) => { }); const sendSignedTransactionTxReceipt2: PromiEvent = web3.eth.sendSignedTransaction("")