feat: add remove_service_price to clear a configured service price#65
Merged
mikewheeleer merged 1 commit intoJun 24, 2026
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
remove_service_price(service_id)to the escrow contract, letting the adminclear a previously configured per-request price and free its storage slot.
DataKey::Admin, thenrequire_auth()); panics withNotInitialized(Enforce the documented 256-byte service-description cap in set_service_metadata #3) beforeinit.ContractPaused(Emit structured events on admin, price, and registration state changes #4) when paused,consistent with other admin mutations (
set_service_price,transfer_service_ownership,settle).DataKey::ServicePrice(service_id)and emitsprice_rm(service_id).Removed vs. set-to-zero
After removal,
get_service_priceandcompute_billingread back0, exactlyas for a never-priced service. The distinction is about storage, not the read
value: removal frees the storage slot and emits
price_rm, whereasset_service_price(service_id, 0)leaves a stored slot holding0. Documentedin the
///docs andREADME.md.Security notes
the sibling pricing/admin mutations.
0, so freeing theslot cannot under/over-bill; usage counters are left untouched.
Tests
set price then remove -> 0; idempotent no-op on never-priced; remove thenre-set;
compute_billingis 0 after removal; non-admin caller is rejected;price_rmevent payload asserted via testutilsEvents; remove while pausedpanics #4.
Closes #35
🤖 Generated with Claude Code