Could be something changed in underlying JVM implementation but the Comparator in AccountKeysList isn't sorting accounts as expected. It seemed to have been working fine up till 1.17.2.
This code:
AccountKeysList keysList = new AccountKeysList();
keysList.add( new AccountMeta(new PublicKey("G75kGJiizyFNdnvvHxkrBrcwLomGJT2CigdXnsYzrFHv"), true, true) );
keysList.add( new AccountMeta(new PublicKey("BQWWFhzBdw2vKKBUX17NHeFbCoFQHfRARpdztPE2tDJ"), true, false) );
keysList.add( new AccountMeta(new PublicKey("11111111111111111111111111111111"), false, false) );
List<AccountMeta> keys = keysList.getList();
keys.forEach( k -> System.out.println(k.getPublicKey() + " isSigner? " + k.isSigner() + " isWritable? " + k.isWritable()) );
Hi,
Could be something changed in underlying JVM implementation but the Comparator in AccountKeysList isn't sorting accounts as expected. It seemed to have been working fine up till 1.17.2.
This code:
Returns:
The signers and writables should appear first.