Clarify i_with semantics and add generic asset-presence helpers#31
Open
sandykwl wants to merge 1 commit intosidan-lab:mainfrom
Open
Clarify i_with semantics and add generic asset-presence helpers#31sandykwl wants to merge 1 commit intosidan-lab:mainfrom
sandykwl wants to merge 1 commit intosidan-lab:mainfrom
Conversation
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.
This PR addresses #30 by making the singleton assumption in
i_withexplicit and adding clear, non-breaking helpers for general asset presence.Changes
i_with_any- predicate matching inputs that contain the asset (quantity > 0).inputs_with_any- list helper usingi_with_any.i_with_singleton- explicit predicate for singleton/NFT use-cases (quantity == 1).i_with- behavior unchanged; doc now points to the explicit helpers.inputs_with- now states it matchesquantity == 1.Rationale
i_withpreviously enforcedquantity == 1without reflecting this in its name or docs, which could exclude valid fungible-asset inputs.This PR improves API clarity while preserving existing behavior to avoid breaking downstream usages. The new helpers provide explicit, composable semantics for both general presence and singleton checks.
Compatibility
Refs #30