FISCO-BCOS / FISCO-BCOS/java-sdk

获取event接口转换List<BigInteger>类型失败

Open
#309 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
58
Forks
62
PR merge metrics
No merged PRs in 30d

Description

java-sdk:2.7.2

event定义:`event LogBookNums(uint[] termNoMap, uint seqMap, uint[] fromMap ,uint[] toMap);`
编译java例子: `typedResponse.termNoMap = (List)eventValues.getNonIndexedValues().get(0).getValue();`
获取event对应值:
` List result =book.getLogBooknumsEvents(transactionReceipt);
result.stream().forEach(item->{
log.info("termNoMap :"+item.termNoMap );
});`
报错信息:java.lang.ClassCastException: org.fisco.bcos.sdk.abi.datatypes.generated.Uint256 cannot be cast to java.math.BigInteger

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the event definition and the failing cast from getNonIndexedValues().get(0), then trace how the generated LogBooknumsEventResponse exposes the uint[] values. Done means the event values can be retrieved in the expected list form without a ClassCastException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
blockchain
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.