I believe the improved Construction API could help automatically check most of the transaction types. But I suggest the Construction API only focus on some specific test fields, including multi-asset exchange, custody and so on. Because it seems very hard to cover all transaction types, at least for a generalized UTXO chain like Nervos CKB.
-
A UTXO transaction actually consists of both spent and unspent outputs, it also require an off-chain execution environment to generate the outputs. Without the environment, you cannot figure out the right output data. Take Bitcoin Omin layer as an example, you need to calculate the data in the output OP_RETURN filed off-chain. It’s basically not a problem, because there is some SDK for you to do that, and the balance calculation is simple. But for some Turing complete UTXO chain, like Nervos CKB, You need a complete VM environment off-chain to meet the general requirement of various kinds of transactions. You need to write generation script (including input gathering and selection script) for every kind of transaction, like DEX deposit, withdraw, gamble bid, … But these scripts rely on blockchain VM to execute, which should be absent in the Rosetta test framework.
-
Another characteristic of Nervos CKB is we allow user-defined crypto primitives to serve as the low level signature algorithm. Which means you cannot simply mark “secp256k1” as the signature algorithm, or leave a possible selection group to the transactions. A transaction on CKB may use P-256, ed255619, SM2, RSA, or even hash revealing algorithm to guard the UTXOs, it seems impossible to prepare them ahead.
So my suggestion is to focus on the token balance, transfer, deposit/withdraw (POs), multi asset operations. It will cover 90% or more user scenarios, and leave the other tests to a case by case integration or test design.