Skip to content

Commit

Permalink
Sync heartbeat fields with go-algorand, make TxnHeartbeatFields expli…
Browse files Browse the repository at this point in the history
…cit pointer type on Transaction.
  • Loading branch information
gmalouf committed Dec 18, 2024
1 parent dd91383 commit 888e100
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions types/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ type HeartbeatTxnFields struct {
_struct struct{} `codec:",omitempty,omitemptyarray"`

// HeartbeatAddress is the account this txn is proving onlineness for.
HbAddress Address `codec:"hbad"`
HbAddress Address `codec:"a"`

// HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online.
HbProof HeartbeatProof `codec:"hbprf"`
HbProof HeartbeatProof `codec:"prf"`

// The final three fields are included to allow early, concurrent check of
// the HbProof.

// HbSeed must be the block seed for this transaction's firstValid
// block. It is the message that must be signed with HbAddress's part key.
HbSeed Seed `codec:"hbsd"`
HbSeed Seed `codec:"sd"`

// HbVoteID must match the HbAddress account's current VoteID.
HbVoteID OneTimeSignatureVerifier `codec:"hbvid"`
HbVoteID OneTimeSignatureVerifier `codec:"vid"`

// HbKeyDilution must match HbAddress account's current KeyDilution.
HbKeyDilution uint64 `codec:"hbkd"`
HbKeyDilution uint64 `codec:"kd"`
}
6 changes: 5 additions & 1 deletion types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ type Transaction struct {
AssetFreezeTxnFields
ApplicationFields
StateProofTxnFields
HeartbeatTxnFields

// By making HeartbeatTxnFields a pointer we save a ton of space of the
// Transaction object. Unlike other txn types, the fields will be
// embedded under a named field in the transaction encoding.
*HeartbeatTxnFields `codec:"hb"`
}

// SignedTxn wraps a transaction and a signature. The encoding of this struct
Expand Down

0 comments on commit 888e100

Please sign in to comment.