hopr_internal_types

Module tickets

Source
Expand description

Implements types for tickets.

Structs§

AcknowledgedTicket
Contains acknowledgment information and the respective ticket
RedeemableTicket
Represents a winning ticket that can be successfully redeemed on chain.
Ticket
Contains the overall description of a ticket with a signature.
TicketBuilder
Builder for Ticket and VerifiedTicket.
TransferableWinningTicket
Represents a ticket that could be transferred over the wire and independently verified again by the other party.
UnacknowledgedTicket
Represents a VerifiedTicket with an unknown other part of the HalfKey. Once the other HalfKey is known (forming a Response), it can be acknowledged.
VerifiedTicket
Holds a ticket that has been already verified. This structure guarantees that Ticket::get_hash() of VerifiedTicket::verified_ticket() is always equal to VerifiedTicket::verified_hash

Enums§

AcknowledgedTicketStatus
Status of the acknowledged ticket.

Constants§

ALWAYS_WINNING
Encodes 100% winning probability
NEVER_WINNING
Encodes 0% winning probability

Functions§

f64_to_win_prob
Encodes [0.0f64, 1.0f64] to [0x00000000000000, 0xffffffffffffff]
win_prob_to_f64
Decodes [0x00000000000000, 0xffffffffffffff] to [0.0f64, 1.0f64]

Type Aliases§

EncodedWinProb
Winning probability encoded in 7-byte representation