Skip to content

feat(example): add update_with and deregister_with wrappers #11

Description

@0dillon

Summary

long_escrow has register_with, which lets the contract present its own address to the registry.
The registry also exposes update and deregister, and both authorize the same way — so both are
equally impossible to call from the command line, and neither has a wrapper.

The consequence is that registration is one-shot. An escrow registered with a wrong manifest is
stuck with it: register returns AlreadyRegistered forever and there is no path to fix it short
of deploying a new contract. Since the example exists to show the pattern an adopter should copy, it
is showing an incomplete one.

Acceptance Criteria

  • update_with and deregister_with exist, gated on config.buyer.require_auth() like
    register_with.
  • Both go through the local RegistryClient; the registry crate is still not a dependency —
    linking it copies the registry's exported functions into the escrow's wasm.
  • The Registrar trait gains matching declarations that stay in step with the registry.
  • Tests against the fake_registry stub cover both, including rejection without buyer auth.
  • The escrow's wasm size before and after is recorded in the pull request.

Tech Stack

Rust (edition 2021, toolchain 1.93.0 pinned in rust-toolchain.toml), soroban-sdk 27.0.4,
target wasm32v1-none. Build with stellar contract build, never cargo build. Tests are
#[cfg(test)] modules on Env::default(); run them with cargo test --all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: exampleexamples/long_escrowcomplexity: mediumHalf a day, some design judgement neededtype: featureAdds behaviour that does not exist yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions