Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1795 合约事件推送的SampleCode中BlockNumber是BigInteger所以直接复制过来用会编译错误 #1796

Open
wants to merge 2 commits into
base: release-3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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