polkaj
polkaj copied to clipboard
The balance does not correspond to the blockchain
Thank you for sharing the project. When I was using it, I found that it might not match the current version of polkadot node. When I got the balance, I found that the balance did not correspond. So I modified the source code, and finally it was matched. , The following is where I modified.
AccountInfo.java
public class AccountInfo {
private Long nonce;
/**
* Integer --> Long
*/
private Long refcount;
private AccountData data;
}
AccountInfoReader.java
public class AccountInfoReader implements ScaleReader<AccountInfo> {
@Override
public AccountInfo read(ScaleCodecReader rdr) {
AccountInfo result = new AccountInfo();
result.setNonce(rdr.readUint32());
/**
* rdr.readUByte() --> rdr.readUint32()
*/
result.setRefcount(rdr.readUint32());
result.setData(rdr.read(new AccountDataReader()));
return result;
}
}
Thank you! Can you make it as a Pull Request? Ideally with the test data, i.e. you encoded value which was failing to decode