Skip to content

Commit

Permalink
FISCO-BCOS#1795 合约事件推送的SampleCode中BlockNumber是BigInteger所以直接复制过来用会编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxie authored and limingxie committed May 11, 2024
1 parent b989f5d commit 7b6eee5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions 3.x/zh_CN/docs/sdk/java_sdk/event_sub.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 7b6eee5

Please sign in to comment.