paritytech/asset-transfer-api

E2E tests that are testing on our zombienet network

TarikGul opened this issue · 0 comments

Summary

The e2e-tests will focus on using the api to construct certain tx's ie. Foreign Assets, Assets, Local, and Liquid Pool Assets, and then send them across the network then verify if they reached the other account.

Design

This design portion is up for revision and is a first iteration.

Tests Config

There should be a test file that contains all configuration for each tx we are sending. I will demonstrate what the structure could look like below to give a better idea.

// tests/index.ts file

export const tests = {
    foreignAssets: [
        {
            // This will declare the call to use
            test: 'createTransferTransaction',
            // This will be all the args for the above call
            args: ['<contains_the_args_in_the_correct_order_for_the_above_call>'],
            // This will be a tuple that will allow us to verify if the xcm message
            // succesfully went through on the other end
            verification: ['<dest_addr>', '<dest_chain_id>']
        },
        ...
    ]
}

Executor

The executor will take in the tests config, and run each test. It should call the balance module to retrieve the current balance on the destination chain. Then after each xcm message is sent, and executed it should ensure with the verification module that the balance is now different than what the balance module gave us.

Verification

The verification module should do 1 thing. Connect to a chain given some config, check the balance of a given account against a known value return a boolean. Then disconnect.

Balance

The balance module should do 1 thing. Connect to a chain given some config, check the balance of a given account, and return the relevant information.

Logger

This should just format the results that are passed by the executor and log them in a nice way for tests.

File structure

-- e2e-tests
    -- tests
        -- local.ts
        -- liquidPools.ts
        -- assets.ts
        -- foreignAssets.ts
        -- index.ts
    -- executor.ts
    -- verification.ts
    -- balance.ts
    -- logger.ts