Skip to content

Conversation

@JoeCap08055
Copy link
Collaborator

@JoeCap08055 JoeCap08055 commented Aug 22, 2025

Goal

The goal of this PR is to implement the extrinsics, RPCs and unit tests for Intents and IntentGroups.

Closes #2564

Discussion

Checklist

  • Updated Pallet Readme?
  • Updated js/api-augment for Custom RPC APIs?
  • Design doc(s) updated?
  • Unit Tests added?
  • e2e Tests added?
  • Benchmarks added?
  • Spec version incremented?

# Goal
The goal of this PR is to implement *only* the *types* and *pallet
storage* for the following new on-chain entities:
* Intents
* IntentGroups

Closes #2561

**NOTE:** No tests or benchmarks added in this PR, as it only contains
types and storage, no executable runtime code (coming in a separate PR)

# Checklist
- [x] Updated Pallet Readme?
- [ ] Updated js/api-augment for Custom RPC APIs?
- [x] Design doc(s) updated?
- [ ] Unit Tests added?
- [ ] e2e Tests added?
- [ ] Benchmarks added?
- [ ] Spec version incremented?
# Conflicts:
#	pallets/schemas/src/lib.rs
#	pallets/schemas/src/tests/other_tests.rs
#	pallets/schemas/src/types.rs
#	runtime/frequency/src/lib.rs
@codecov
Copy link

codecov bot commented Aug 22, 2025

Codecov Report

❌ Patch coverage is 93.86282% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pallets/schemas/src/types.rs 57.14% 9 Missing ⚠️
pallets/schemas/src/lib.rs 96.87% 8 Missing ⚠️
Files with missing lines Coverage Δ
common/primitives/src/schema.rs 43.75% <ø> (ø)
pallets/schemas/src/lib.rs 90.46% <96.87%> (+6.89%) ⬆️
pallets/schemas/src/types.rs 85.56% <57.14%> (-4.44%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented labels Aug 27, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented and removed metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented labels Aug 28, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented and removed metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented labels Aug 28, 2025
@JoeCap08055 JoeCap08055 marked this pull request as ready for review August 28, 2025 20:53
@JoeCap08055 JoeCap08055 requested review from aramikm, claireclark1, enddynayn, mattheworris, saraswatpuneet and shannonwells and removed request for a team and wilwade August 28, 2025 20:56
Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

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

Overall looks good.
Approving to unblock but there are some comments that needs attention before merging

Copy link
Collaborator

@saraswatpuneet saraswatpuneet left a comment

Choose a reason for hiding this comment

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

looks good, one question around update path

@github-actions github-actions bot removed metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented labels Aug 29, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented labels Aug 29, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented and removed metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented labels Aug 29, 2025
@JoeCap08055 JoeCap08055 merged commit 7b6fdcf into feat/schemas-permissions-development Aug 29, 2025
31 of 32 checks passed
@JoeCap08055 JoeCap08055 deleted the feat/intents-extrinsics-and-rpcs branch August 29, 2025 16:46
pub intent_group_id: u16,
/// The list of currently supported IntentIds for this IntentGroup
pub intent_ids: Option<Vec<IntentId>>,
pub intent_ids: Vec<IntentId>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this never meant to be an option?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what this will eventually look like... an upcoming PR in the epic will revisit these runtime APIs and responses, anyway

}

/// Adds a given schema to storage. The schema in question must be of length
/// Adds a given schema to storage. (testnet)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Following the existing pattern in the pallet, it exists but the call is filtered in the Runtime on Mainnet. Not sure why it's done that way vs a feature flag; that decision predates me.

// check that doesn't start with a decimal digit.
// (This also handles the case where the value is all numeric, because it would also
// start with a decimal digit.)
ensure!(namespace[0].is_ascii_alphabetic(), Error::<T>::InvalidSchemaNameCharacters);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: the comment isn't precisely true, otherwise you'd just check for !~[0-9]

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

Labels

metadata-changed Metadata has changed since the latest full release metadata-version-not-incremented Metadata has changed since the latest full release, but the version has not been incremented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants