Skipping /derive validation

Hello,

Due to on-chain address generation of the network I am trying to integrate, is there a way to skip /construction/derive tests in the rosetta-cli?

Thanks.

:wave: @lurky

There is no way to skip /construction/derive in check:construction right now :cry:. We are working on an improvement to automated testing to allow testing of and compatibility with blockchains that require on-chain address origination. You can read more about it here:

Hey,
I lost track of the development progress over the construction API, so I will ask again my initial question.

Thanks.

:wave: @lurky

With the new Rosetta Constructor DSL, it is super easy to skip /construction/derive. All you need to do is:

  • provide “prefunded_accounts” (example) that are used for construction testing (instead of derived ones)
  • don’t define a create_account workflow (also, no need to define a request_funds workflow if the addresses you provide already have funds)

In Ethereum, your construction file would look like:

transfer(10){
  transfer{
    transfer.network = {"network":"Ropsten", "blockchain":"Ethereum"};
    currency = {"symbol":"ETH", "decimals":18};
    sender = find_balance({
      "minimum_balance":{
        "value": "10000000000000000",
        "currency": {{currency}}
      }
    });

    // Set the recipient_amount as some value <= sender.balance-max_fee
    max_fee = "84000000000000";
    available_amount = {{sender.balance.value}} - {{max_fee}};
    recipient_amount = random_number({"minimum": "1", "maximum": {{available_amount}}});
    print_message({"recipient_amount":{{recipient_amount}}});

    // Find recipient and construct operations
    sender_amount = 0 - {{recipient_amount}};
    recipient = find_balance({
      "not_account_identifier":[{{sender.account_identifier}}],
      "minimum_balance":{
        "value": "0",
        "currency": {{currency}}
      },
      "create_limit": 100,
      "create_probability": 50
    });
    transfer.confirmation_depth = "1";
    transfer.operations = [
      {
        "operation_identifier":{"index":0},
        "type":"CALL",
        "account":{{sender.account_identifier}},
        "amount":{
          "value":{{sender_amount}},
          "currency":{{currency}}
        }
      },
      {
        "operation_identifier":{"index":1},
        "type":"CALL",
        "account":{{recipient.account_identifier}},
        "amount":{
          "value":{{recipient_amount}},
          "currency":{{currency}}
        }
      }
    ];
  }
}

You can reference your created DSL file like this: