geniusyield / atlas

Application backend for Plutus smart contracts on Cardano
https://atlas-app.io
Apache License 2.0
67 stars 18 forks source link

GYBalancingErrorInsufficientFunds when submitting transaction #352

Closed Fiftyw3bs closed 2 months ago

Fiftyw3bs commented 2 months ago

I keep getting the following error message:

Writing Swagger file ...
parsing Config ...
Loading Providers ...
Starting server at 
 http://localhost:8222
[2024-09-10 23:45:00][GeniusYield.api-server][Debug][MacBook-Pro][PID 6531][ThreadId 49][tls-crdn-0.6.0-dbbfd75e:GeniusYield.TxBuilder.IO.Query src/GeniusYield/TxBuilder/IO/Query.hs:106:9] Querying UtxoRefs At Address: addr_test1qqrepdpn235puqu428y9w5f96gmx9pw354nc276dmcxmv9a7y7h27wv94d5fecd4y5lrun50hv7edp5tjks63wqeqatsx6e3km
[2024-09-10 23:45:00][GeniusYield.api-server.buildTxBody][Debug][MacBook-Pro][PID 6531][ThreadId 49][tls-crdn-0.6.0-dbbfd75e:GeniusYield.TxBuilder.IO.Builder src/GeniusYield/TxBuilder/IO/Builder.hs:43:14] GYTxSkeleton {gytxIns = [GYTxIn {gyTxInTxOutRef = GYTxOutRef (TxIn "098e84c1b07ea9481e3b3f9f80926c5a2e791c7ba5d126b7bfd21b2cce685cad" (TxIx 0)), gyTxInWitness = GYTxInWitnessKey}], gytxOuts = [GYTxOut {gyTxOutAddress = unsafeAddressFromText "addr_test1qqrepdpn235puqu428y9w5f96gmx9pw354nc276dmcxmv9a7y7h27wv94d5fecd4y5lrun50hv7edp5tjks63wqeqatsx6e3km", gyTxOutValue = valueFromList [(GYToken "c13979eea972fbe9fff3eaed6d68ad582cda2101011adb9edf6d74cc" "\216{\128",1)], gyTxOutDatum = Just (GYDatum Constr 0 [Constr 0 [Constr 1 [B "\174\225\167\227\t\245\246\251\206\221\ETB\233wI^\DC4\244\SUB\217x\180\180d\175c\159\186\245"],Constr 1 []],Constr 0 [Constr 1 [B "St\ESC$Q\135\187\220\252Z\153\SYN\236\&4\"G\139\160\SYN\234\138\179\169/\204\170hD"],Constr 1 []],Constr 0 [Constr 1 [B "\178\172_\205\160\232\&6\135\189\195\240\144\DLEE~\249\&1_\180\182\191\&9\145\136\135\197L\213"],Constr 1 []],Constr 2 []],GYTxOutUseInlineDatum), gyTxOutRefS = Nothing},GYTxOut {gyTxOutAddress = unsafeAddressFromText "addr_test1vrg2ky6zfxr95eqqhsha63te5geuh8vwtj6e54f6cnhxp6q8khwn5", gyTxOutValue = valueFromList [(GYToken "d78637618f74a4a37940a92a883e497be126f957cadb4b27999be774" "7453485348",10)], gyTxOutDatum = Just (GYDatum Constr 0 [List [B "\a\144\180\&3Th\RS\ETX\149Q\200WQ%\210\&6b\133\209\165g\133{M\222\r\182\ETB"],I 1,List [Constr 1 []],Constr 0 [Constr 0 [B "\t\142\132\193\176~\169H\RS;?\159\128\146lZ.y\FS{\165\209&\183\191\210\ESC,\206h\\\173"],I 0]],GYTxOutUseInlineDatum), gyTxOutRefS = Nothing}], gytxRefIns = GYTxSkeletonNoRefIns, gytxMint = fromList [(GYMintScript (GYMintingPolicy (GYScript "c13979eea972fbe9fff3eaed6d68ad582cda2101011adb9edf6d74cc")),(fromList [("\216{\128",1)],redeemerFromPlutus' (BuiltinData (Constr 0 []))))], gytxWdrls = [], gytxSigs = fromList [GYPubKeyHash "0790b43354681e039551c8575125d2366285d1a567857b4dde0db617"], gytxCerts = [], gytxInvalidBefore = Nothing, gytxInvalidAfter = Nothing, gytxMetadata = Nothing}
[2024-09-10 23:45:00][GeniusYield.api-server][Debug][MacBook-Pro][PID 6531][ThreadId 49][tls-crdn-0.6.0-dbbfd75e:GeniusYield.TxBuilder.IO.Query src/GeniusYield/TxBuilder/IO/Query.hs:81:9] Querying utxos At Addresses: 
 [unsafeAddressFromText "addr_test1qqrepdpn235puqu428y9w5f96gmx9pw354nc276dmcxmv9a7y7h27wv94d5fecd4y5lrun50hv7edp5tjks63wqeqatsx6e3km"]
[2024-09-10 23:45:00][GeniusYield.api-server][Debug][MacBook-Pro][PID 6531][ThreadId 49][tls-crdn-0.6.0-dbbfd75e:GeniusYield.TxBuilder.IO.Query src/GeniusYield/TxBuilder/IO/Query.hs:116:9] Querying Utxos At TxOutRefs: [GYTxOutRef (TxIn "098e84c1b07ea9481e3b3f9f80926c5a2e791c7ba5d126b7bfd21b2cce685cad" (TxIx 0))]
GYBuildTxException (GYBuildTxBalancingError (GYBalancingErrorInsufficientFunds (valueFromList [(GYToken "d78637618f74a4a37940a92a883e497be126f957cadb4b27999be774" "7453485348",10)])))

Despite the fact that the wallet contains 1000 of the required token:

                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
098e84c1b07ea9481e3b3f9f80926c5a2e791c7ba5d126b7bfd21b2cce685cad     0        10000000 lovelace + 1000 d78637618f74a4a37940a92a883e497be126f957cadb4b27999be774.7453485348 + TxOutDatumNone
098e84c1b07ea9481e3b3f9f80926c5a2e791c7ba5d126b7bfd21b2cce685cad     1        9447028373 lovelace + 1999999500 29e18c9c2b4a0350aed8069481939e8d646aa7af4eec360a0ac1808a.7453485348 + 2000000000 c8fc35bde37cbf2a7a25bcb0be52ce7de8a60b3341b5af2fd0f7a324.7453485348 + TxOutDatumNone
28e3d1596df54ac8f253385b4c050e0a88e3f0cf2bd83705f999f716d7e19654     0        5000000 lovelace + TxOutDatumNone
43143b6e6b06b1c61fbb20674e82c026db48c6ddcea2c07cd8ddec8edbce1273     0        5000000 lovelace + TxOutDatumNone
Fiftyw3bs commented 2 months ago

Fixed! I was using the encoded token name instead of the unencoded one.