Skip to content

Commit

Permalink
Add key to peer data record output
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Jan 14, 2025
1 parent c14cf95 commit 2390cd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions convex-core/src/main/java/convex/core/cvm/Peer.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public static Peer fromData(AKeyPair keyPair,AMap<Keyword, ACell> peerData) {
Order co=((Order) peerData.get(Keywords.ORDER));
long hpos=((CVMLong) peerData.get(Keywords.HISTORY)).longValue();
long timestamp=((CVMLong) peerData.get(Keywords.TIMESTAMP)).longValue();
// This gets inferred from keypair, caller might want to check it is correct though!
// AccountKey key=AccountKey.parse(peerData.get(Keywords.KEY));


return new Peer(keyPair,belief,co,pos,state,genesis,hpos,results,timestamp);
}

Expand All @@ -155,6 +159,7 @@ public AMap<Keyword, ACell> toData() {
Keywords.RESULTS,blockResults,
Keywords.POSITION,CVMLong.create(statePosition),
Keywords.STATE,state,
Keywords.KEY,peerKey,
Keywords.GENESIS,genesis,
Keywords.TIMESTAMP,timestamp
);
Expand Down

0 comments on commit 2390cd0

Please sign in to comment.