You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When im trying to run get account info got ArrayIndexOutOfBoundsException Exception.
Full code:
import io.emeraldpay.polkaj.api.PolkadotApi;
import io.emeraldpay.polkaj.api.StandardCommands;
import io.emeraldpay.polkaj.apihttp.JavaHttpAdapter;
import io.emeraldpay.polkaj.apiws.JavaHttpSubscriptionAdapter;
import io.emeraldpay.polkaj.scaletypes.AccountInfo;
import io.emeraldpay.polkaj.tx.AccountRequests;
import io.emeraldpay.polkaj.types.Address;
import io.emeraldpay.polkaj.types.ByteData;
import io.emeraldpay.polkaj.types.DotAmount;
import io.emeraldpay.polkaj.types.DotAmountFormatter;
import io.emeraldpay.polkaj.types.Units;
public class Balance {
public static void main(String[] args) throws Exception {
String node_url = "Node";
try (PolkadotApi client = PolkadotApi.newBuilder().rpcCallAdapter(JavaHttpAdapter.newBuilder().connectTo(node_url).build()).build()) {
DotAmountFormatter formatter = DotAmountFormatter.autoFormatter();
AccountInfo accountInfo = AccountRequests.balanceOf(Address.from("Address")).execute(client).get();
System.out.println(accountInfo.getNonce());
}
}
}
Exception: Caused by: java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 69 out of bounds for byte[56]
at java.base/java.lang.System.arraycopy(Native Method)
at io.emeraldpay.polkaj.scale.ScaleCodecReader.readByteArray(ScaleCodecReader.java:141)
at io.emeraldpay.polkaj.scale.reader.UInt128Reader.read(UInt128Reader.java:23)
at io.emeraldpay.polkaj.scale.ScaleCodecReader.readUint128(ScaleCodecReader.java:100)
at io.emeraldpay.polkaj.scaletypes.BalanceReader.read(BalanceReader.java:16)
at io.emeraldpay.polkaj.scaletypes.BalanceReader.read(BalanceReader.java:10)
at io.emeraldpay.polkaj.scale.ScaleCodecReader.read(ScaleCodecReader.java:84)
at io.emeraldpay.polkaj.scaletypes.AccountDataReader.read(AccountDataReader.java:14)
at io.emeraldpay.polkaj.scaletypes.AccountDataReader.read(AccountDataReader.java:6)
at io.emeraldpay.polkaj.scale.ScaleCodecReader.read(ScaleCodecReader.java:84)
at io.emeraldpay.polkaj.scaletypes.AccountInfoReader.read(AccountInfoReader.java:12)
at io.emeraldpay.polkaj.scaletypes.AccountInfoReader.read(AccountInfoReader.java:6)
at io.emeraldpay.polkaj.scale.ScaleCodecReader.read(ScaleCodecReader.java:84)
at io.emeraldpay.polkaj.tx.AccountRequests$AddressBalance.apply(AccountRequests.java:91)
at io.emeraldpay.polkaj.tx.AccountRequests$AddressBalance.apply(AccountRequests.java:65)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:844)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
The text was updated successfully, but these errors were encountered:
When im trying to run get account info got
ArrayIndexOutOfBoundsException
Exception.Full code:
The text was updated successfully, but these errors were encountered: