You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Building a mint Tx that ends with a wrong collateral balance, with added native tokens.
The code I’m using to build the mint Tx is the following:
defmint_badge(context, wallet_address: Address, validator, picked_utxo):
builder=TransactionBuilder(context)
builder.add_input_address(wallet_address)
# Get the first wallet UTxOs to guarantee mint unicitybuilder.add_input(picked_utxo)
# Mint the tokenpolicy_id=validator["hash"]
mint=MultiAsset.from_primitive({policy_id: {b"": 1}})
builder.mint=mint# Add the script to the witness setscript=PlutusV3Script(validator["compiled_code"])
builder.add_minting_script(script, Redeemer([]))
# Build the txtx_body=builder.build(change_address=wallet_address, auto_required_signers=False)
tx_witness_set=builder.build_witness_set(True)
returnTransaction(tx_body, tx_witness_set)
Most of the time this works, but today it generated the following Tx for me (cbor)
As you can see in this screenshot from Eternl detailed Tx view, the collateral output contains more native tokens than the input being consumed
As a result, ogmios gave me the following error message.
ogmios.errors.ResponseError: Ogmios responded with error: {'jsonrpc': '2.0', 'method': 'submitTransaction', 'error': {'code': 3133, 'message': "One of the input provided as collateral carries something else than Ada tokens. Only Ada can be used as collateral. Since the Babbage era, you also have the option to set a 'collateral return' or 'collateral change' output in order to send the surplus non-Ada tokens to it. Regardless, the field 'data.unsuitableCollateralValue' indicates the actual collateral value found by the ledger", 'data': {'unsuitableCollateralValue': {'ada': {'lovelace': 2896254}, '53c94b1a4a7a79eb71c45a17ddcb65207eea77fba087d43fccbd4035': {'': 1}, '9295b9e76efeb135a2d53b69f6bd907af9eef753f273596e0d319233': {'': 1}}}}, 'id': None}
I’m using pycardano 0.13.2 on Macos.
The text was updated successfully, but these errors were encountered:
It seems the builder selected the same utxo for the input and for the collateral in this case (which is possible). However, the collateral output appears to have double the amount of native tokens
Describe the bug
Building a mint Tx that ends with a wrong collateral balance, with added native tokens.
The code I’m using to build the mint Tx is the following:
Most of the time this works, but today it generated the following Tx for me (cbor)
As you can see in this screenshot from Eternl detailed Tx view, the collateral output contains more native tokens than the input being consumed
As a result, ogmios gave me the following error message.
I’m using pycardano 0.13.2 on Macos.
The text was updated successfully, but these errors were encountered: