Add just file to simplify local testing - #136
Open
ikripaka wants to merge 54 commits into
Open
Conversation
…imization Add CompiledProgram to the Program structure
…_hash Add get_tapleaf_hash function to the Program struct
CI runs `cargo clippy --workspace --all-targets --all-features` under `RUSTFLAGS: -Dwarnings`, so a pedantic warning fails the build. This branch carried twenty-two of them: six in the SDK and sixteen in the binding. Most are mechanical — backticks around SimplicityHL, OP_RETURN and BitMachine in prose, `#[must_use]` on three accessors that return a value and touch nothing, `if let` where a `match` destructured a single pattern. Two are judgement calls, both recorded where they are made. `Option<String>` stays on the four binding entry points clippy wants borrowed. wasm-bindgen implements no `OptionFromWasmAbi` for `&str`, so an optional string argument has to arrive owned; the alternative is not a nicer signature but a crate that does not compile. The allow sits on each function with the reason above it rather than at the crate root, so a genuine case elsewhere still fails. `required_signature` stops returning `Result`. It parses a name it has already proved non-empty and has no failing path, and a `?` at its call site claimed otherwise. `add_contract_input` keeps its nine arguments: it is the binding surface a caller reaches for, and folding them into a parameter object would move the shape into JavaScript for a lint. Claude-Session: https://claude.ai/code/session_0133RUq5DKdBerk4ypVdpAZK
Pass the workspace clippy gate with warnings denied
…-with-state Add support for git rev and tag during installation
…ith-flattened-simf feat: add writing dev information to metadata.json file
Silence Git errors during `simplex install`
Remove #[must_use] from set_storage_at function
A wallet driving this SDK from JavaScript could not express several things a covenant spend needs, and one of them was silently wrong. - Issuance is exposed on both input shapes, so a transaction that creates an asset can be assembled from JavaScript. - A contract's parameters carry their declared types across the boundary, instead of arriving as untyped values the caller had to guess at. - A covenant being spent is rebuilt from the same parts it was committed to, so the leaf that is revealed matches the one in the tree. - A transaction can declare the height it may not be mined before, which a timelocked covenant requires. A zero height is treated as no height, because writing zero into an input reads back as a constraint that can never be met and refuses every spend. - A covenant that refuses now says what the transaction declared, naming the locktime and the sequence, so a refusal can be diagnosed without a debugger.
Four free functions sat at the crate root where the review asked why they were there. None of them is used by more than one type. - Reading an id and the issuer contract built from it move onto `TransactionBuilder`, beside the other private helpers its inputs already use. - Writing an id and the report built from it move onto `IssuanceReport`, which is the only thing that returns them. - Both locktime setters document the panic they carry: `LockTime` is a height below `500_000_000` and a time at or above it, and the wrong side of that boundary aborts the module. No exported binding changes.
A height ends at 499_999_999 and 500_000_000 is already a time, so the note named the first value that aborts as though it were allowed.
Two unrelated things carried the word. Elements calls the document an issuer publishes about an asset its *contract*, and mixes a hash of it with the outpoint being spent to derive the asset id; that sense stays, because `ContractHash` is Elements' own type and the SDK uses the word at `crates/sdk/src/utils.rs`. The other sense was borrowed from Ethereum for a Simplicity program that locks money. In Bitcoin and Elements that is a covenant, which is what this crate already called it at the two places nobody exports: the error `dryRunContractInput` raised said "is not a covenant input", and the comment in `program_input` said "the covenant being spent". `Contract`, `contractAddress`, `contractParameterTypes`, `addContractInput`, `addContractIssuanceInput` and `dryRunContractInput` take the chain's word. `read_id` and `write_id` go with them. Neither read nor wrote: each was one direction of the byte-order flip between an id as displayed and the bytes it is made of. `ContractHash` is `#[hash_newtype(backward)]` and `Midstate` sets `DISPLAY_BACKWARD`, so `from_str` and `to_string` already do exactly this. The four on-chain issuance vectors still derive the assets Liquid holds, which is what proves the substitution. The length check `read_id` carried stays, because `from_str` alone reports a wrong-length id and a non-hex id with the same sentence. Written by Claude.
Build and sign covenant spends from JavaScript
…and bump HL version to `0.7.2` (#134) * fix: deps installation in fixtures * fix: add simplex install command to fixtures.yml * fix: move simplex install command after cd * fix: add simplex install in one more place * fix: delete intermediate dependency in a fixture * feat: add --all flag to the simplex clean command * fmt: apply cargo fmt * bump: SimplicityHL version to 0.7.2 * refactor: fix review comemnts
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.
Add a
justfile for local test simplification