IntersectMBO / plutus-apps

The Plutus application platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TokenName is not hex-encoded: base16: input: invalid length

volodyad opened this issue · comments

Summary

This is duplicate of IntersectMBO/plutus#4236

I have added steps to reproduce
volodyad@589a263

On first transaction token mint and send to the script,
On second - token spent to and send back to the script, this transaction fails

Are there any ideas how to resolve or workaround this issue?

Steps to reproduce the behavior

Copy files from the commit or run form the commit itself

cabal build plutus-pab-local-cluster
cabal exec plutus-pab-local-cluster

run the contract
curl -H "Content-Type: application/json" -v -X POST -d '{"caID":{"tag":"MintTest"},"caWallet":{"getWalletId":"2d4cc31a4b3116ab86bfe529d30d9c362acd0b44"}}' localhost:9080/api/contract/activate

Actual Result

[pab:Info:2305] [2021-12-14 07:50:20.94 UTC] c38930e2-909b-4640-8091-03cd727a8d70: "********Start minting token complete."
[pab:Info:2305] [2021-12-14 07:50:21.64 UTC] c38930e2-909b-4640-8091-03cd727a8d70: "********Minting token complete."
[pab:Info:2305] [2021-12-14 07:50:21.71 UTC] c38930e2-909b-4640-8091-03cd727a8d70: "getDatum"
[pab:Info:2305] [2021-12-14 07:50:21.71 UTC] c38930e2-909b-4640-8091-03cd727a8d70: "*******Start spend."
[pab:Warning:2305] [2021-12-14 07:50:21.74 UTC] WalletClientError "FailureResponse (Request {requestPath = (BaseUrl {baseUrlScheme = Http, baseUrlHost = "127.0.0.1", baseUrlPort = 46493, baseUrlPath = ""},"/v2/wallets/2d4cc31a4b3116ab86bfe529d30d9c362acd0b44/transactions-balance"), requestQueryString = fromList [], requestBody = Just ((),application/json;charset=utf-8), requestAccept = fromList [application/json;charset=utf-8,application/json], requestHeaders = fromList []), requestHttpVersion = HTTP/1.1, requestMethod = "POST"} (Response {responseStatusCode = Status {statusCode = 400, statusMessage = "Bad Request"}, responseHeaders = fromList [("Transfer-Encoding","chunked"),("Date","Tue, 14 Dec 2021 07:50:20 GMT"),("Server","Warp/3.3.17"),("Content-Type","application/json;charset=utf-8")], responseHttpVersion = HTTP/1.1, responseBody = "{\"message\":\"Error in $.inputs[0].assets[0]['asset_name']: TextDecodingError {getTextDecodingError = 'TokenName is not hex-encoded: base16: input: invalid length'}\",\"code\":\"bad_request\"}"})"

Expected Result

Spent and resent token to script transaction executes successfully

Describe the approach you would take to fix this

No response

System info

mac os big sur
11.5.2
Use files from volodyad@589a263

commented

Thanks a lot for the provided reproduction repo! I have managed to find the problem and the fix is waiting for review.