Package convex.core
Class MergeContext
java.lang.Object
convex.core.MergeContext
Class representing the context to be used for a Belief merge/update function. This
context must be created by a Peer to perform a valid Belief merge. It can be safely
discarded after use.
SECURITY: contains a hot key pair! We need this to sign new belief updates
including any chains we want to communicate. Don't allow this to leak
anywhere!
-
Method Summary
Modifier and TypeMethodDescriptionstatic MergeContext
Create a MergeContextGet the address of the current Peer (the one performing the merge)Gets the Consensus State for this mergelong
Gets the timestamp of this merge<T extends ACell>
SignedData<T>sign(T value)
Sign a value using the keypair for this MergeContextwithTimestamp(long newTimestamp)
Updates the timestamp of this MergeContext
-
Method Details
-
create
Create a MergeContext- Parameters:
kp
- Keypairtimestamp
- Timestamps
- Consensus State- Returns:
- New MergeContext instance
-
getAccountKey
Get the address of the current Peer (the one performing the merge)- Returns:
- The Address of the peer.
-
sign
Sign a value using the keypair for this MergeContext- Type Parameters:
T
- Type of value- Parameters:
value
- Value to sign- Returns:
- Signed value
-
getTimeStamp
public long getTimeStamp()Gets the timestamp of this merge- Returns:
- Timestamp
-
withTimestamp
Updates the timestamp of this MergeContext- Parameters:
newTimestamp
- New timestamp- Returns:
- Updated MergeContext
-
getConsensusState
Gets the Consensus State for this merge- Returns:
- Consensus State
-