XRPLF / xrpl4j

A 100% Java implementation to interact with the XRP Ledger.
ISC License
86 stars 48 forks source link

Throw JsonMappingException when sync block contain tx type like 'NFT ACCEPT OFFER' #325

Closed wandapen closed 1 year ago

wandapen commented 1 year ago

version: xrpl4j 2.5.0

att; When I sync block with tx with this code on block 75603952 and other block contains tx type "NFT ACCEPT OFFER" example block index: 75603952

mycode: blockNumber = 75603952

UnsignedInteger index = UnsignedInteger.valueOf(blockNumber); LedgerResult ledgerResult = xrplClient.ledger(LedgerRequestParams.builder() .ledgerSpecifier(LedgerSpecifier.of(LedgerIndex.of(index))).transactions(true).build());

I receive exception: JsonMappingException "problem: In direct mode, you must specify either the SellOffer or the BuyOffer."

append more logs:

org.xrpl.xrpl4j.client.JsonRpcClientErrorException: com.fasterxml.jackson.databind.JsonMappingException: Cannot construct instance of org.xrpl.xrpl4j.model.transactions.ImmutableNfTokenAcceptOffer, problem: In direct mode, you must specify either the SellOffer or the BuyOffer. at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: org.xrpl.xrpl4j.model.client.ledger.ImmutableLedgerResult$Json["ledger"]->org.xrpl.xrpl4j.model.ledger.ImmutableLedgerHeader$Json["transactions"]->java.util.ArrayList[35]) at org.xrpl.xrpl4j.client.JsonRpcClient.send(JsonRpcClient.java:142) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at feign.DefaultMethodHandler.invoke(DefaultMethodHandler.java:75) at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100) at com.sun.proxy.$Proxy3.send(Unknown Source) at org.xrpl.xrpl4j.client.JsonRpcClient.send(JsonRpcClient.java:114) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at feign.DefaultMethodHandler.invoke(DefaultMethodHandler.java:75) at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100) at com.sun.proxy.$Proxy3.send(Unknown Source) at org.xrpl.xrpl4j.client.XrplClient.ledger(XrplClient.java:736) at SendXrp.getBlock(SendXrp.java:281) at SendXrp.main(SendXrp.java:52) Caused by: com.fasterxml.jackson.databind.JsonMappingException: Cannot construct instance of org.xrpl.xrpl4j.model.transactions.ImmutableNfTokenAcceptOffer, problem: In direct mode, you must specify either the SellOffer or the BuyOffer. at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: org.xrpl.xrpl4j.model.client.ledger.ImmutableLedgerResult$Json["ledger"]->org.xrpl.xrpl4j.model.ledger.ImmutableLedgerHeader$Json["transactions"]->java.util.ArrayList[35]) at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:392) at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:363) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:371) at

nkramer44 commented 1 year ago

This should be fixed once #326 is merged and released.

nkramer44 commented 1 year ago

Hi @wandapen, this should be fixed in the v2.5.1 release. Please feel free to re-open this issue if you continue to see this error after upgrading.