From 7b6eee5f44fcc03e3ccff9c27ffd7df1b937c087 Mon Sep 17 00:00:00 2001 From: limingxie Date: Sat, 11 May 2024 09:48:29 +0800 Subject: [PATCH] =?UTF-8?q?#1795=20=E5=90=88=E7=BA=A6=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E7=9A=84SampleCode=E4=B8=ADBlockNumber?= =?UTF-8?q?=E6=98=AFBigInteger=E6=89=80=E4=BB=A5=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E8=BF=87=E6=9D=A5=E7=94=A8=E4=BC=9A=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3.x/zh_CN/docs/sdk/java_sdk/event_sub.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/3.x/zh_CN/docs/sdk/java_sdk/event_sub.md b/3.x/zh_CN/docs/sdk/java_sdk/event_sub.md index 07aa865cb..1603534eb 100644 --- a/3.x/zh_CN/docs/sdk/java_sdk/event_sub.md +++ b/3.x/zh_CN/docs/sdk/java_sdk/event_sub.md @@ -205,10 +205,10 @@ contract Asset { EventSubParams params = new EventSubParams(); // 全部Event fromBlock设置为 -1 - params.setFromBlock(-1); + params.setFromBlock(new BigInteger("-1")); // toBlock设置为-1,处理至最新区块继续等待新的区块 - params.setToBlock(-1); + params.setToBlock(new BigInteger("-1")); // 注册事件 eventSubscribe.subscribeEvent(params, @@ -230,9 +230,9 @@ contract Asset { EventSubParams params = new EventSubParams(); // 从订阅时的最新区块区块开始,fromBlock设置为-1 - params.setFromBlock(-1); + params.setFromBlock(new BigInteger("-1")); // toBlock设置为-1,处理至最新区块继续等待新的区块 - params.setToBlock(-1); + params.setToBlock(new BigInteger("-1")); // topic0,TransferEvent(int256,string,string,uint256) params.addTopic(0, TopicTools.stringToTopic("TransferEvent(int256,string,string,uint256)"); @@ -261,9 +261,9 @@ contract Asset { EventSubParams params = new EventSubParams(); // 从订阅时的最新区块区块开始,fromBlock设置为-1 - params.setFromBlock(-1); + params.setFromBlock(new BigInteger("-1")); // toBlock设置为-1,处理至最新区块继续等待新的区块 - params.setToBlock(-1); + params.setToBlock(new BigInteger("-1")); // addresses设置为asset地址,匹配该合约地址 params.addAddress("0x06922a844c542df030a2a2be8f835892db99f324"); @@ -291,9 +291,9 @@ contract Asset { EventSubParams params = new EventSubParams(); // 从最初区块开始,fromBlock设置为1 - params.setFromBlock(1); + params.setFromBlock(new BigInteger("1")); // toBlock设置为-1,处理至最新区块继续等待新的区块 - params.setToBlock(-1); + params.setToBlock(new BigInteger("-1")); // addresses设置为asset地址,匹配该合约地址 params.addAddress("0x06922a844c542df030a2a2be8f835892db99f324"); @@ -344,8 +344,8 @@ contract Asset { eventSubscribe.start(); EventSubParams eventLogParams = new EventSubParams(); - eventLogParams.setFromBlock(-1); - eventLogParams.setToBlock(-1); + eventLogParams.setFromBlock(new BigInteger("-1")); + eventLogParams.setToBlock(new BigInteger("-1")); eventLogParams.addAddress(contractAddress); CryptoSuite invalidCryptoSuite = new CryptoSuite(client.getCryptoSuite().getCryptoTypeConfig());