Skip to content

Commit

Permalink
Phoenix: implement Market deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
skynetcap committed Nov 19, 2023
1 parent 0855129 commit f3bc230
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions phoenix/src/test/java/PhoenixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,15 @@ public void phoenixGetMarketDetailTest() throws RpcException, IOException {
});

var traders = phoenixMarket.getTraders();
traders.forEach((publicKey, phoenixTraderState) -> {
log.info("Trader Pubkey: {}, State: {}", publicKey.toBase58(), phoenixTraderState.toString());
});
// traders.forEach((publicKey, phoenixTraderState) -> {
// log.info("Trader Pubkey: {}, State: {}", publicKey.toBase58(), phoenixTraderState.toString());
// });

traders.entrySet().stream().sorted((o1, o2) -> Math.toIntExact((int) o2.getValue().getQuoteLotsLocked() - (int) o1.getValue().getQuoteLotsLocked()))
.forEach(publicKeyPhoenixTraderStateEntry -> {
log.info("Trader Pubkey: {}, State: {}", publicKeyPhoenixTraderStateEntry.getKey().toBase58(),
publicKeyPhoenixTraderStateEntry.getValue().toString());
});
}

@Test
Expand Down

0 comments on commit f3bc230

Please sign in to comment.