Skip to content

Commit

Permalink
Improve pythWebsocketTest
Browse files Browse the repository at this point in the history
  • Loading branch information
skynetcapital committed Jun 27, 2021
1 parent 25d2e7a commit 555a545
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/test/java/org/p2p/solanaj/core/WebsocketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.p2p.solanaj.rpc.Cluster;
import org.p2p.solanaj.ws.SubscriptionWebSocketClient;

import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

Expand All @@ -23,13 +24,20 @@ public void pythWebsocketTest() {
devnetClient.accountSubscribe(
PublicKey.valueOf("E36MyBbavhYKHVLWR79GiReNNnBDiHj6nWA7htbkNZbh").toBase58(),
data -> {
Map<String, String> map = (Map<String, String>) data;
Map<String, Object> map = (Map<String, Object>) data;
String base64 = (String)((List) map.get("data")).get(0);
LOGGER.info(
String.format(
"Event = %s",
map
)
);
LOGGER.info(
String.format(
"Data = %s",
base64
)
);
}
);

Expand Down

0 comments on commit 555a545

Please sign in to comment.