4. Xcavate Marketplace Pallet

Setup:

  1. Prepare accounts with roles 1.1.1 Add Admin and 1.2.1 Assign Role:

    1. Alice - RegionalOperator2 (developer) & RealEstateInvestor3

    2. Bob - RealEstateInvestor1

    3. Charlie - RealEstateDeveloper1 & RegionalOperator1

    4. Dave - RealEstateInvestor2 & SpvConfirmation (SPV role)

    5. Eve - Lawyer (developer-side) & RealEstateInvestor4

    6. Ferdie - Lawyer (SPV-side) & RegionalOperator3

  2. Ensure these accounts have balances in native currency and in any accepted assets (USDC/USDT). Use whichever asset pallet the chain supports.

  3. Ensure the lawyers are registered with the regions pallet 2.7.1 Register Lawyer

  4. Useful polkadot.js UI locations:

    1. Developer → Chain state — query storage maps (choose marketplace pallet and storage item)

    2. Developer → Extrinsics — submit transactions

    3. Chain state → Constants — read pallet constants (ListingDeposit, etc.)

    4. Explorer → Events — review events for each block/transactions

    5. Accounts — view balances (Free / Reserved / Frozen)

    6. Extrinsics → Sign & Submit — choose account to sign transactions

  5. Example test data (replace with the chain constants):

    1. region_id = 1

    2. location = E1 7DB or 1 (or any valid location id)

    3. accepted_assets e.g. 1 => USDC, 2 => USDT (query AcceptedAssets storage/constant)

    4. token_price example: 1_000_000_000 u128 (depends on balance units)

    5. token_amount example: 100 u32

    6. deposit = value of ListingDeposit constant

    7. listing_id — will be read from NextListingId before and after list_property

  6. Storage keys to monitor (Developer → Chain state). (Use Developer → Chain state; choose marketplace pallet and the storage item)

    1. NextListingId — next listing index (u64).

    2. OngoingObjectListing(listing_id) — full listing struct (developer, token_price, token_amount, listed_token_amount, listing_expiry, tax, collected_funds, collected_fees, collected_tax, claim_expiry, relist_count, unclaimed_token_amount, asset_id, item_id, collection_id...).

    3. ListingDeposits(listing_id) — (depositor, deposit_amount).

    4. TokenOwner(listing_id, account) or TokenOwner(account, listing_id) — token owner entry for an investor.

    5. TokenListings(listing_id) — secondary-market listing details.

    6. PropertyLawyer(listing_id) — lawyer/legal process struct (lawyers, statuses, lawyer costs, expiry, second_attempt).

    7. ProposedLawyers(listing_id) — developer-side proposed lawyer.

    8. ListingSpvProposal(listing_id) & SpvLawyerProposal(proposal_id) — SPV-side proposals.

    9. OngoingLawyerVoting(proposal_id) — yes/no tallies.

    10. UserLawyerVote(proposal_id, account) — per-voter vote record.

    11. RefundClaimedToken(listing_id), RefundLegalExpired(listing_id), RefundToken(listing_id) — refund trackers.

  7. Global test approach for each extrinsic. For every test step, follow this micro-workflow:

    1. Pre-check: query relevant storage/constant values and note them (e.g., NextListingId, account balances, OngoingObjectListing(listing_id) if exists).

    2. Submit extrinsic: Developer → Extrinsics → choose pallet marketplace → select call → fill parameters → Sign & Submit as the required role account.

    3. Observe: wait for block, open Explorer → Events and Chain state to verify events and storage changes.

    4. Post-check: query exactly the storage items listed under “expected chain state” to confirm the expected mutation. Also check account balances/reserved.

    5. Negative tests: repeat with an obvious invalid input and verify the call fails and appropriate event/error is produced.

Last updated