ergoplatform / oracle-core

Core off-chain component of Oracle Pools
Apache License 2.0
62 stars 37 forks source link

Encode the tx inputs/outputs order in *TxLayout type for each tx type #270

Open greenhat opened 1 year ago

greenhat commented 1 year ago

Motivation

In some contracts, often, there are required box positions for particular boxes (refresh, pool, buyback boxes, etc.). Usually, the order is defined by adding boxes to the vector, which is error-prone (think swapping two lines of code).

Implementation details

*TxLayout is constructed with specific *BoxWrapper types and produces the box array for a tx builder.