Skip to content

Add tests for PreImage#470

Merged
rockbmb merged 1 commit into
open-web3-stack:masterfrom
andreitrand:andreitrand-pet-tests-preimage
Nov 4, 2025
Merged

Add tests for PreImage#470
rockbmb merged 1 commit into
open-web3-stack:masterfrom
andreitrand:andreitrand-pet-tests-preimage

Conversation

@andreitrand
Copy link
Copy Markdown
Contributor

Add tests which verify PreImage behavior:

    1. A standard account registers (notes) and unregisters (unnotes) a preimage
    1. A manager account requests and unrequests a preimage hash
    1. A manager account requests a preimage hash once then unrequests it multiple times
    1. A manager account requests and unrequests the hash of a previously-registered preimage
    1. A standard account should not be able to register and unregister preimage hashes

Issue: #453

Add tests which verify PreImage behavior:
- 1) A standard account registers (notes) and unregisters (unnotes) a preimage
- 2) A manager account requests and unrequests a preimage hash
- 3) A manager account requests a preimage hash once then unrequests it multiple times
- 4) A manager account requests and unrequests the hash of a previously-registered preimage
- 5) A standard account should not be able to register and unregister preimage hashes

Issue: open-web3-stack#453
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

The code looks good overall and the new tests cover the intended scenarios. The refactoring to move preimage tests into a dedicated file is a good improvement. I've found a few minor issues related to code clarity, redundancy, and use of magic numbers.

Comment thread packages/shared/src/preimage.ts
Comment thread packages/shared/src/preimage.ts
Comment thread packages/shared/src/preimage.ts
Comment thread packages/shared/src/preimage.ts
Comment thread packages/shared/src/preimage.ts
Comment thread packages/shared/src/preimage.ts
@rockbmb rockbmb merged commit 501de91 into open-web3-stack:master Nov 4, 2025
215 of 223 checks passed
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 4, 2025
Add additional tests which verify PreImage behavior:

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 7, 2025
Add additional tests which verify PreImage behavior:

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 9, 2025
Add additional tests which verify PreImage behavior:

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 10, 2025
Add additional tests which verify PreImage behavior:

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 11, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 11, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 11, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 12, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 19, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 19, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
andreitrand added a commit to andreitrand/polkadot-ecosystem-tests that referenced this pull request Nov 20, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: open-web3-stack#470.
Also address outstanding comments from the original PR.
rockbmb pushed a commit that referenced this pull request Nov 20, 2025
Add additional tests which verify PreImage behavior:
- 1) A manager account requests a preimage hash once then unrequests it multiple times (added additional checks)
- 2) Check the noting and unnoting of empty images
- 3) Check the noting and unnoting of oversized images
- 4) Check the repeated noting and unnoting of the same preimage
- 5) Check preimage behavior when requesting, noting, unrequesting and unnoting occur in different orders
- 6) Check the "ensure_updated" extrinsic applies fees depending on the update ratio

Several utility functions have been moved to the helpers file as they are shared with other test files.

This is a continuation of the PR: #470.
Also address outstanding comments from the original PR.
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