fix(statedb-cmd): improve error handling in genesis_utxo.rs #2094
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The code for generating UTXO updates has been enhanced by introducing better and more robust error handling mechanisms. This update also improves the way it handles the generation of bitcoin and rooch addresses, simplifying the logic and reducing code redundancy. These changes are aimed at preventing unexpected crashes and providing clearer error messages if an issue occurs.
example:
UTXOData { txid: "41a3e9ee1910a2d40dd217bbc9fd3638c40d13c8fdda8a0aa9d49a2b4a199422", vout: 2, value: 5376, script: "036c6565662c206f6e7464656b2c2067656e6965742e2e2e202020202020202020", script_type: "p2pk", address: "" }