Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incentives: Heartbeat Transaction Support #548

Merged
merged 6 commits into from
Jan 15, 2025

Conversation

gmalouf
Copy link
Contributor

@gmalouf gmalouf commented Dec 4, 2024

No description provided.

@gmalouf gmalouf self-assigned this Dec 4, 2024
@gmalouf gmalouf requested a review from a team as a code owner December 4, 2024 17:23
@gmalouf gmalouf requested a review from onetechnical December 4, 2024 17:23
@gmalouf gmalouf changed the title Basic heartbeat transaction parsing support. Incentives: Basic heartbeat transaction parsing support. Dec 18, 2024
@gmalouf gmalouf requested a review from algorandskiy December 20, 2024 15:57
re_enc = encoding.msgpack_encode(encoding.msgpack_decode(enc))
self.assertEqual(enc, re_enc)

self.assertEqual(transaction.HeartbeatTxn.undictify(hb.dictify()), hb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we used to have so-called "golden" tests - txn created by algod in base64 decoded in a test and some fields compared, serialized back and compared back to golden

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the pattern already here. I think I see some of those golden tests in indexer, thought it was message-pack encoded?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'll add sdk-testing test case as a followup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added support in latest push.

@gmalouf gmalouf requested a review from algorandskiy January 13, 2025 20:08
@gmalouf gmalouf changed the title Incentives: Basic heartbeat transaction parsing support. Incentives: Heartbeat Transaction Support Jan 13, 2025
algosdk/transaction.py Outdated Show resolved Hide resolved
algosdk/transaction.py Show resolved Hide resolved
algosdk/transaction.py Show resolved Hide resolved
tests/steps/other_v2_steps.py Outdated Show resolved Hide resolved
@@ -405,6 +405,25 @@ def test_stateproof_txn(self):
encoding.msgpack_encode(encoding.msgpack_decode(stateprooftxn)),
)

def test_heartbeat_txn(self):
heartbeattxn = (
"hqJmdmqiZ2jEIDluDCudpBECh7Xg6253Qe2hY3T/SbzZSPR2Hn4Nlmw4omhihaFhxCC"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe to use the same golden as in other SDK test for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they have to match, but this is one we also use in indexer API tests, kind of like it being separate from the cross-SDK ones.

algosdk/transaction.py Show resolved Hide resolved
@gmalouf gmalouf requested a review from algorandskiy January 14, 2025 20:36
@algorandskiy algorandskiy reopened this Jan 15, 2025
@algorandskiy algorandskiy merged commit 33e446b into develop Jan 15, 2025
11 checks passed
@gmalouf gmalouf deleted the gmalouf/heartbeat-support branch January 15, 2025 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants