feat(cli): bounty + contract commands (chain v0.4.0)#49
Merged
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 CLI commands to create + query bounties and contracts (the chain v0.4.0 marketplace), mirroring the existing attestation command pattern (
resolve_signer→ buildRuntimeCall→build_sign_submit). Pins the chain crates tov0.4.0and syncs the constants manifest so the newly-compiledbounty+contractmodule macros resolve.ligate bounty(src/bounty.rs):post / claim / dispute / resolve / cancel / finalise→RuntimeCall::Bounty(..).postparses an--acceptancepredicate (any/attestor-set:<las1…>/payload-hashes:<lph1…>,…/peer-count:<n>).ligate contract(src/contract.rs):post / commit / deliver / accept / reject / resolve / cancel / finalize→RuntimeCall::Contracts(..)(plural variant, matching theContractsmodule struct). Reuses the 32-byte hex parser for--criteria-doc-hash+--commit-hash.ligate query(src/query.rs): addsbounty / dispute / contract / delivery / contract-disputeread subcommands hitting the chain REST routes (/modules/bounty/...,/modules/contracts/...).Cargo.toml: chain deps →v0.4.0; newbounty+contractgit deps (native); package0.2.x→0.3.0. SDK fork revs unchanged (v0.4.0 keeps v0.3.0's pins).constants.toml: synced verbatim toligate-chain's v0.4.0 manifest — addsBOUNTY_DISCRIMINANT = 22+CONTRACTS_DISCRIMINANT = 23(resolved via the existingCONSTANTS_MANIFEST_PATHenv var in CI). This is the same stale-manifest break that hit ligate-api.Constants-manifest sync
Bumping to v0.4.0 + adding the bounty/contract deps means the CLI now transitively compiles the
bounty+contractchain crates, whoseimpl_hash32_type!/ module macros requireBOUNTY_DISCRIMINANT(22) andCONTRACTS_DISCRIMINANT(23). The CLI keeps its ownconstants.tomlat the repo root, resolved byCONSTANTS_MANIFEST_PATH(set in.github/workflows/ci.yml+release.yml). Fixed bycp ligate-chain/constants.tomlover the CLI copy; both discriminants confirmed present.Test plan
cargo build --release --bin ligatecompiles (withSKIP_GUEST_BUILD=1 RISC0_SKIP_BUILD_KERNELS=1+ libclang env)cargo clippy --all-targets -- -D warningscleancargo fmt --all -- --checkcleancargo test --bin ligate— 24/24 pass (7 new: acceptance-predicate + hash32 parsers)ligate --version→v0.3.0;bounty/contract/querysubcommand trees +--ground/--decisionvalue-enums parse correctly (per-module variants distinct)