ergoplatform / sigma-rust

Rust implementation of ErgoTree interpreter and wallet-related features
Creative Commons Zero v1.0 Universal
69 stars 48 forks source link

Allow box min value & size to be calculated without value validation #734

Closed ross-weir closed 11 months ago

ross-weir commented 11 months ago

We have a problem using builder.calc_min_box_value() in box builders, since its trying to first build the box and then calculate the min value. We get this error: ErgoBoxCandidateBuilderError: Box value BoxValue(1100000) is too low, minimum value for box size of 3392 bytes is: BoxValue(1221120) nanoERGs . Can u update the implemetation somehow, not to build the box for this calculations? We have another option to use a large value as the box value and update that amount after this calculation, but we rather not to use such approach.

We could have a method that builds the box but doesn't validate the size/value, this will allow the min box value to be calculated and set accordingly afterwards