Skip to content

go-based e2e testing for callbacks and cw721 backward compatibility #101

@taitruong

Description

@taitruong

cw-ics721 supports NFT transfer for cw721 v16 contracts and higher - up to latest version v18. Rn, e2e tests covers only v18: https://github.com/CosmWasm/cw-nfts/releases/tag/v0.18.0

e2e should cover tests for handling different

  1. cw721 contract versions: v16, v17 and latest v18 version
  2. cw721 code ids: when transferring an NFT, on target chain cw-ics721 creates a new collection (and NFT). For this CW721_CODE_ID store is used. Ideally all cw-ics721 contracts are using same version across all chains. But in reality this might not be the case. Like for Stargaze there is a custom sg721-base.

Search in go files where cw721_base_v0.18.0.wasm is used and uploaded.

Check in TestSendBetweenThreeIdenticalChains:

// Builds three identical chains A, B, and C then sends along the path
// A -> B -> C -> A -> C -> B -> A. If this works, likely most other
// things do too. :)
func TestSendBetweenThreeIdenticalChains(t *testing.T) {
...
}

Here it uses always cw721 v18 for transfering to chains A -> B -> C -> A -> C -> B -> A.

In instantiateCw721() and in instantiateBridge() it always uses cw721 v18.

A test case could be changing this:

  • 3 tests cases for TestSendBetweenThreeIdenticalChains for transferring NFT v16, v17 and v18
  • different CW721_CODE_IDs for `cw-ics721 on chain A, B, and C:
    • chain A and B: cw721-base v18
    • chain C: sg721-base using v3.14.0

wasm files are store in ./external-wasm, containing:

  • cw721_base_v0.18.0.wasm
  • cw721_incoming_proxy.wasm
  • cw721_outgoing_proxy_rate_limit.wasm

please note that for SG we also need sg_ics721.wasm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions