Closed nielstron closed 5 months ago
Indeed, the mint
value must fit into a word
which is a u64 or u32 depending on OS arch, but most likely u64 (so 18_446_744_073_709_551_615 max).
Note that: this is as good as it gets when it comes to deserialization errors here. I cannot get anything better without re-writing the CBOR parsers which I am slightly reluctant to at the moment 😅 ...
So it should be possible to just check that mint is smaller than sys.maxsize
.
From the ledger spec, it looks like mint field should be int64, and uint
should be used in all other cases, which doesn't have an upper bound (at least I couldn't find its definition in the spec). Maybe we should only limit mint field to int64
. What do you think?
If the spec sais i64 I agree we should restrict to that, not sys.maxsize
Describe the bug Trying to mint too many tokens produces and invalid transaction (basically minting 1231234145232534000000 here for example) This results in ogmios failing to evaluate/submit the transaction with a very obscure error message.
To Reproduce TBD
Logs
Expected behavior Ogmios could report that the integer is breaking/incorrectly serialized. PyCardano should abort the building or raise an error/warning this.
Environment and software version (please complete the following information):
Additional context Looping in @KtorZ for ogmios, but the error is really with PyCardano here.