Skip to content

feat(cli): bounty + contract commands (chain v0.4.0)#49

Merged
proofmancer merged 1 commit into
mainfrom
feat/bounty-contract-commands
May 29, 2026
Merged

feat(cli): bounty + contract commands (chain v0.4.0)#49
proofmancer merged 1 commit into
mainfrom
feat/bounty-contract-commands

Conversation

@proofmancer

Copy link
Copy Markdown
Contributor

Summary

Adds CLI commands to create + query bounties and contracts (the chain v0.4.0 marketplace), mirroring the existing attestation command pattern (resolve_signer → build RuntimeCallbuild_sign_submit). Pins the chain crates to v0.4.0 and syncs the constants manifest so the newly-compiled bounty + contract module macros resolve.

  • ligate bounty (src/bounty.rs): post / claim / dispute / resolve / cancel / finaliseRuntimeCall::Bounty(..). post parses an --acceptance predicate (any / attestor-set:<las1…> / payload-hashes:<lph1…>,… / peer-count:<n>).
  • ligate contract (src/contract.rs): post / commit / deliver / accept / reject / resolve / cancel / finalizeRuntimeCall::Contracts(..) (plural variant, matching the Contracts module struct). Reuses the 32-byte hex parser for --criteria-doc-hash + --commit-hash.
  • ligate query (src/query.rs): adds bounty / dispute / contract / delivery / contract-dispute read subcommands hitting the chain REST routes (/modules/bounty/..., /modules/contracts/...).
  • Cargo.toml: chain deps → v0.4.0; new bounty + contract git deps (native); package 0.2.x0.3.0. SDK fork revs unchanged (v0.4.0 keeps v0.3.0's pins).
  • constants.toml: synced verbatim to ligate-chain's v0.4.0 manifest — adds BOUNTY_DISCRIMINANT = 22 + CONTRACTS_DISCRIMINANT = 23 (resolved via the existing CONSTANTS_MANIFEST_PATH env 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 + contract chain crates, whose impl_hash32_type! / module macros require BOUNTY_DISCRIMINANT (22) and CONTRACTS_DISCRIMINANT (23). The CLI keeps its own constants.toml at the repo root, resolved by CONSTANTS_MANIFEST_PATH (set in .github/workflows/ci.yml + release.yml). Fixed by cp ligate-chain/constants.toml over the CLI copy; both discriminants confirmed present.

Test plan

  • cargo build --release --bin ligate compiles (with SKIP_GUEST_BUILD=1 RISC0_SKIP_BUILD_KERNELS=1 + libclang env)
  • cargo clippy --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • cargo test --bin ligate — 24/24 pass (7 new: acceptance-predicate + hash32 parsers)
  • ligate --versionv0.3.0; bounty / contract / query subcommand trees + --ground / --decision value-enums parse correctly (per-module variants distinct)
  • Live posting deferred — needs a funded signing key (no real txs submitted from this branch)

@proofmancer proofmancer merged commit 5b314f1 into main May 29, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant