Documentation ¶
Index ¶
Constants ¶
const ClaimHashByteSize = 32
Variables ¶
This section is empty.
Functions ¶
func PublishClaim ¶
func PublishClaim( ctx context.Context, logger log.StandardLogger, sessionID string, memberIndex group.MemberIndex, channel net.BroadcastChannel, groupSize int, dishonestThreshold int, membershipValidator *group.MembershipValidator, claimSigner ClaimSigner, claimSubmitter ClaimSubmitter, claim *ClaimPreimage, ) error
func RegisterUnmarshallers ¶
func RegisterUnmarshallers(channel net.BroadcastChannel)
RegisterUnmarshallers initializes the given broadcast channel to be able to perform inactivity claim interactions by registering all the required protocol message unmarshallers.
Types ¶
type ClaimHash ¶
type ClaimHash [ClaimHashByteSize]byte
ClaimHash is a hash of the inactivity claim. The hashing algorithm used depends on the client code.
func ClaimHashFromBytes ¶
ClaimHashFromBytes converts bytes slice to ClaimHash. It requires provided bytes slice size to be exactly ClaimHashByteSize.
type ClaimPreimage ¶
type ClaimPreimage struct { Nonce *big.Int WalletPublicKey *ecdsa.PublicKey InactiveMembersIndexes []group.MemberIndex HeartbeatFailed bool }
ClaimPreimage represents an inactivity claim preimage.
func NewClaimPreimage ¶
func NewClaimPreimage( nonce *big.Int, walletPublicKey *ecdsa.PublicKey, inactiveMembersIndexes []group.MemberIndex, heartbeatFailed bool, ) *ClaimPreimage
type ClaimSigner ¶
type ClaimSigner interface { SignClaim(claim *ClaimPreimage) (*SignedClaimHash, error) VerifySignature(signedClaim *SignedClaimHash) (bool, error) }
type ClaimSubmitter ¶
type ClaimSubmitter interface { SubmitClaim( ctx context.Context, memberIndex group.MemberIndex, claim *ClaimPreimage, signatures map[group.MemberIndex][]byte, ) error }
type SignedClaimHash ¶
SignedClaimHash represents information pertaining to the process of signing an inactivity claim: the public key used during signing, the resulting signature and the hash of the inactivity claim that was used during signing.