Skip to content

Commit

Permalink
Make the pending transaction endpoint notice heartbeats
Browse files Browse the repository at this point in the history
  • Loading branch information
jannotti committed Nov 27, 2024
1 parent 3a0abc4 commit 521cf5f
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 100 deletions.
2 changes: 1 addition & 1 deletion daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
},
"/v2/accounts/{address}": {
"get": {
"description": "Given a specific account public key, this call returns the accounts status, balance and spendable amounts",
"description": "Given a specific account public key, this call returns the account's status, balance and spendable amounts",
"tags": [
"public",
"nonparticipating"
Expand Down
2 changes: 1 addition & 1 deletion daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,7 @@
},
"/v2/accounts/{address}": {
"get": {
"description": "Given a specific account public key, this call returns the accounts status, balance and spendable amounts",
"description": "Given a specific account public key, this call returns the account's status, balance and spendable amounts",
"operationId": "AccountInformation",
"parameters": [
{
Expand Down
188 changes: 94 additions & 94 deletions daemon/algod/api/server/v2/generated/nonparticipating/public/routes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions data/transactions/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func (tx Header) Alive(tc TxnContext) error {

// MatchAddress checks if the transaction touches a given address.
func (tx Transaction) MatchAddress(addr basics.Address, spec SpecialAddresses) bool {
return slices.Contains(tx.RelevantAddrs(spec), addr)
return slices.Contains(tx.relevantAddrs(spec), addr)
}

var errKeyregTxnFirstVotingRoundGreaterThanLastVotingRound = errors.New("transaction first voting round need to be less than its last voting round")
Expand Down Expand Up @@ -714,9 +714,8 @@ func (tx Header) Last() basics.Round {
return tx.LastValid
}

// RelevantAddrs returns the addresses whose balance records this transaction will need to access.
// The header's default is to return just the sender and the fee sink.
func (tx Transaction) RelevantAddrs(spec SpecialAddresses) []basics.Address {
// relevantAddrs returns the addresses whose balance records this transaction will need to access.
func (tx Transaction) relevantAddrs(spec SpecialAddresses) []basics.Address {
addrs := []basics.Address{tx.Sender, spec.FeeSink}

switch tx.Type {
Expand All @@ -733,6 +732,8 @@ func (tx Transaction) RelevantAddrs(spec SpecialAddresses) []basics.Address {
if !tx.AssetTransferTxnFields.AssetSender.IsZero() {
addrs = append(addrs, tx.AssetTransferTxnFields.AssetSender)
}
case protocol.HeartbeatTx:
addrs = append(addrs, tx.HeartbeatTxnFields.HbAddress)
}

return addrs
Expand Down

0 comments on commit 521cf5f

Please sign in to comment.