Skip to content

Provide access to consumed resources in tests#3869

Closed
deuszx wants to merge 15 commits intomainfrom
provide-access-to-consumed-resources-in-tests
Closed

Provide access to consumed resources in tests#3869
deuszx wants to merge 15 commits intomainfrom
provide-access-to-consumed-resources-in-tests

Conversation

@deuszx
Copy link
Contributor

@deuszx deuszx commented May 1, 2025

Motivation

Messages may be sent with resource grants so that the message receiver doesn't have to pay any fees to receive the message. However, figuring out how much resources to include in the grant is not trivial.

Proposal

Allow writing integration tests that assert if a block consumed less resources than those that would be provided for a grant.

Test Plan

TODO: this needs a test.

Release Plan

  • These changes follow the usual release cycle, because this adds a new breaking change to the SDK.

Links

Builds on top of Janito's PR #3781.

jvff and others added 15 commits April 16, 2025 06:01
Prepare to propagate the consumed resources back to integration tests
using the SDK.
Prepare to propagate the consumed resources back to integration tests
using the SDK.
Prepare to propagate the consumed resources back to integration tests
using the SDK.
Prepare to propagate the consumed resources back to integration tests
using the SDK.
Prepare to propagate the consumed resources back to integration tests
using the SDK.
Contains the certificate and the consumed resources.
Include the consumed resources with the certificate.
Use the new type so that the caller can check the consumed resources.
Use the new type for consistency.
Use the type returned by the `ActiveChain` methods that add a block.
Provide the same API used by some example integration tests.
Provide a similar API used by some example integration tests.
Remove the unnecessary `unwrap`s now that the API was tweaked.
A method to help writing assertions that a block used less resources
than those provided by a grant.
@deuszx deuszx closed this May 1, 2025
@deuszx deuszx deleted the provide-access-to-consumed-resources-in-tests branch May 1, 2025 15:48
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.

2 participants