Skip to content

Feature: auto-balance multi-assets #4453

@dorin100

Description

@dorin100

What - The user-facing feature being implemented

Why

  • in order to allow CLI users to have an auto-magic command that will auto-balance all the transaction types

Personas - Who will this affect?

  • SPO
  • Dapp Devs
  • Exchanges

Definition of Done

  • Acceptance Criteria + User Stories & DoD created and singed-off
  • Code & Test review
  • Builds successfully on CI
  • Includes documentation and/or examples for the functionality (+ usage and response examples)
  • Log/record changes on Vnext (or similar depending on what we adopt)
  • Ticket number included in PR description
  • The new functionality is covered by dev/unit/property tests
  • Acceptance Criteria met
  • Test engineer signs-off + system tests fully automated

Sign-off Acceptance Criteria

  • Product Owner
  • Dev Owner
  • Test Engineer Owner

Related PRs

  1. Auto-balance multiasset transactions #4450

Acceptance Criteria

User Story 1

  • As a CLI user (all Personas), when using the transaction build CLI command, I want to auto-balance multi-asset transactions
AC1.1
  • When creating a transaction using the transaction build CLI command, the minFee is paid, and the transaction is auto-balanced when it includes:

    • Only ada
    • ada and only 1 native token
    • ada and various native tokens
    • with max no of multi-asset (based on block size)
    • with multiple inputs and outputs of all possible types (ADA, simple scripts, multi-assets (mint, spend, burn), Plutus scripts, certificates)

User Story 2

  • As a CLI user, I don't expect any of the previously existing functionalities for the transaction build CLI command to be changed
AC2.1
  • all existing automated regression tests should pass

Example of Acceptance test:

  • we need to have tests for all the scenarios from the Acceptance Criteria; preferable all these tests should be covered at unit level

GIVEN a CLI user has 1 UTXO with only 100 ADA, 1 UTXO with 10 dor,
WHEN the user creates a transaction using like below (using both utxos as inputs),
AND sending 9 ADA and 5 dor to a different address
THAN the transaction can be signed without getting any error
AND the transaction can be submitted without getting any error

cardano-cli transaction build \
    --testnet-magic $MAGIC \
    --tx-in UTXO_1 \
    --tx-in UTXO_2 \
    --tx-out DST_ADDR+9000000+5 $policyid.$tokenname"  \
    --change-address CHANGE_ADDR \
    --out-file tx1.body 

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions