Skip to main content

โšก Extrinsics

Unlike most FRAME pallets, pallet-commitment intentionally exposes very few extrinsics.

The commitment engine is designed to be consumed through its public trait interfaces rather than called directly by end users.

This keeps protocol logic inside usage pallets while allowing the commitment engine to remain generic and reusable.


๐Ÿง  Why Only Minimal Extrinsics?โ€‹

The commitment pallet does not know:

  • why a commitment exists
  • which digest should be used
  • when commitments are allowed
  • which validations should apply

Those decisions belong entirely to the consumer pallet.

For this reason there are no extrinsics for:

  • placing commitments
  • raising commitments
  • resolving commitments
  • creating indexes
  • managing pools
  • updating digests

All of these operations are performed through the public commitment traits.


๐Ÿš€ Reserve Fundingโ€‹

The only production extrinsics manage the native commitment reserve.

These reserve funds become the default funding source for future commitment operations.

ExtrinsicDescriptionWhen to Use
deposit_reserve(Asset, Precision)Moves free balance into the native commitment reserve.Preparing funds before creating commitments.
withdraw_reserve(Option<Asset>)Releases reserved funds back into free balance.Recovering unused reserve funds.

The reserve uses the pallet's built-in hold reason:

HoldReason::PrepareForCommit

Consumer pallets may then create commitments using these reserved funds efficiently without repeatedly inspecting free or usable balances.

โš™ Reserve Behaviorโ€‹

Reserve funding supports both exact and best-effort deposits.

deposit_reserve(
amount,
Precision::Exact
)

requires the full amount.

Whereas

deposit_reserve(
amount,
Precision::BestEffort
)

deposits as much as possible when sufficient liquid balance is unavailable.

Similarly,

withdraw_reserve(None)

withdraws the entire reserve.

while

withdraw_reserve(Some(amount))

withdraws only the requested amount.


๐Ÿงช Development Inspectorsโ€‹

When compiled with:

feature = "dev"

the pallet exposes additional inspector extrinsics intended for development, testing, benchmarking, and runtime exploration.

These dispatchables provide convenient access to the pallet's inspection APIs without affecting the production execution model.

The available inspector extrinsics are documented in the next section.


๐Ÿ“Œ In One Sentenceโ€‹

pallet-commitment intentionally exposes only reserve management extrinsics, while all commitment lifecycle operations are performed through trait-based dispatch by consumer pallets.


๐Ÿš€ Next Stepโ€‹

Now that the dispatch surface is complete, the remaining sections cover the pallet's development and production related surfaces. The next section focusses on development-only query extrinsics.

๐Ÿ‘‰ Core -> Inspectors