Skip to content

fix: implement MarketFactory C-01 through C-04 - #1173

Merged
Ehonrie merged 2 commits into
Netwalls:mainfrom
MJigah:fix/market-factory-c01-c04
Jul 29, 2026
Merged

fix: implement MarketFactory C-01 through C-04#1173
Ehonrie merged 2 commits into
Netwalls:mainfrom
MJigah:fix/market-factory-c01-c04

Conversation

@MJigah

@MJigah MJigah commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

- C-01 (Netwalls#1019): add MarketInfo/MarketData to shared/src/types.rs, and
  fix two pre-existing compile breaks in the shared crate blocking any
  build: a misplaced #![no_std]/duplicate `pub mod types` in lib.rs,
  and an unsupported Option<Outcome> struct field (soroban-sdk's
  #[contracttype] derive has no ScVal conversion for Option<CustomEnum>;
  replaced with an explicit Outcome::Undetermined sentinel variant).
- C-02 (Netwalls#1020): MarketFactory::initialize — stores admin, market wasm
  hash, and treasury; reverts with ContractError::AlreadyInitialized on
  a second call.
- C-03 (Netwalls#1021): MarketFactory::create_market — validates end_time/lock_time,
  deploys a Market instance via env.deployer(), generates a collision-resistant
  market_id, and emits market_created with the full MarketInfo.
- C-04 (Netwalls#1022): MarketFactory::get_market — read-only lookup by market_id.

Also fixes market_factory/src/lib.rs, which referenced a non-existent
`boxmeout_shared` crate (the actual dependency is named `shared`) and
had a duplicated/syntactically broken get_market_address definition,
both of which meant the crate did not compile at all beforehand.

Tests deploy against a minimal, dependency-free dummy contract wasm
(market_factory/test_fixtures/dummy.wasm) purely to exercise the real
deploy_v2() path; it is not the production Market contract.

Note: `cargo test -p shared` still fails due to pre-existing, unrelated
breakage in shared/src/events.rs's own test module (deprecated
Events::publish API, outdated ContractEvents methods) — reproducible
on unmodified main and out of scope here. market_factory's tests do
not depend on shared's test target and pass cleanly:
cargo test -p market_factory -> 7 passed; 0 failed.
@Ehonrie
Ehonrie merged commit 8fb306f into Netwalls:main Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants