Skip to content

Add contract events for TTL extension and protocol fee recipient updates - #642

Open
JamesVictor-O wants to merge 1 commit into
accesslayerorg:mainfrom
JamesVictor-O:feat/573-ttl-and-fee-recipient-events
Open

Add contract events for TTL extension and protocol fee recipient updates#642
JamesVictor-O wants to merge 1 commit into
accesslayerorg:mainfrom
JamesVictor-O:feat/573-ttl-and-fee-recipient-events

Conversation

@JamesVictor-O

Copy link
Copy Markdown
Contributor

Summary

  • Emit a TtlExtendedEvent on TTL extension with creator_id, extended_at_ledger, and new_expiry_ledger fields (previously the event carried only a bare u32 expiry value).
  • Add an updated_at_ledger field to ProtocolFeeRecipientUpdatedEvent, emitted from both set_protocol_fee_recipient and update_protocol_fee_recipient.
  • Add a shared assert_event(env, contract_id, topics, expected_data) test helper in contract_test_env that finds the most recent event matching a contract id + topics tuple and asserts the decoded data, with a clear mismatch message naming the contract, topics, and expected/actual payloads.
  • Update TTL and fee-recipient event tests to use the new helper and assert the new fields.
  • Regenerate affected test_snapshots fixtures to reflect the new event payload shapes.

Test plan

  • cargo test --workspace (143 test result blocks, all passing)
  • cargo fmt --all -- --check

Closes #573

Both admin/lifecycle events previously carried minimal or no field data,
leaving indexers without a stable schema to parse. TTL extension now
emits creator_id, extended_at_ledger, and new_expiry_ledger; the fee
recipient update event gains an updated_at_ledger field. Adds a shared
assert_event test helper so future event tests can assert topics+data
in one call instead of hand-rolled filtering.

Closes accesslayerorg#573
@Chucks1093

Copy link
Copy Markdown
Contributor

I see what you have done here, tracking TTL extensions and fee recipient changes as distinct events makes the history easier to audit. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add contract events for TTL extension and protocol fee recipient updates with shared event assertion helper

2 participants