Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiCoinSelection json instance #3147

Open
3 tasks done
v0d1ch opened this issue Feb 21, 2022 · 0 comments
Open
3 tasks done

ApiCoinSelection json instance #3147

v0d1ch opened this issue Feb 21, 2022 · 0 comments
Labels

Comments

@v0d1ch
Copy link

v0d1ch commented Feb 21, 2022

Just checking...

  • This is a cardano-wallet bug.
  • I am using the latest cardano-wallet release.
  • I am using the correct cardano-node version for that release of cardano-wallet.

Version

6508a5f

Platform

NixOs

Installation method

Built from source

Network configuration

testnet

Context

We have a http call to cardano-wallet api to construct a transaction (https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructTransaction) and eventually end up with the correct ApiConstructTransaction type.

I noticed the api broke at this commit 6508a5f8939bab5fa6ca8df0e1d056585607c5e6 and after the described api call I could not decode json to valid ApiConstructionType.

Description

There are couple of new fields in ApiCoinSelection (which is part of the mentioned type ApiConstructTransaction) namely depositsTaken and depositsReturned which somehow don't end up being inside of the returned json (only deposits key exists which is part of the old api).

This is the complete response I get for the reference:

parsing Cardano.Wallet.Api.Types.ApiCoinSelection(ApiCoinSelection) failed, key "deposits_taken" not found.
JSON: Object (fromList [("coin_selection",Object (fromList [("change",Array [Object (fromList [("address",String "addr_test1qrm2eveexcqal3fx8w79zzf0kklplmp0f7fl8rgty3emj8ydy6ep90qusqgn7zwfa7504rrytflqr9vx9nzgxqp49g2qeevjvd"),("amount",Object (fromList [("quantity",Number 8136181.0),("unit",String "lovelace")])),("assets",Array []),("derivation_path",Array [String "1852H",String "1815H",String "0H",String "1",String "0"])])]),("collateral",Array []),("deposits",Array []),("inputs",Array [Object (fromList [("address",String "addr_test1qqqm73qquru5ta4yllnta3kg8j30yw4x288aldaxmmuhr05dy6ep90qusqgn7zwfa7504rrytflqr9vx9nzgxqp49g2qwekflf"),("amount",Object (fromList [("quantity",Number 1.0e7),("unit",String "lovelace")])),("assets",Array []),("derivation_path",Array [String "1852H",String "1815H",String "0H",String "0",String "0"]),("id",String "a0e5025825b4f86efb174127b6f45a1c1e4508fb1901ae8c229f3932c1bbcb49"),("index",Number 0.0)])]),("outputs",Array [Object (fromList [("address",String "addr_test1qqtfz4ma9cu6ses73wn2tny9gc8zufv9eg3qqt3lqfzlhjvn5t9nzcdv4sxsrz7k6adtp0xjj35gq73lzv8yct6xjgysv9qxfj"),("amount",Object (fromList [("quantity",Number 1694798.0),("unit",String "lovelace")])),("assets",Array [])])]),("withdrawals",Array [])])),("fee",Object (fromList [("quantity",Number 169021.0),("unit",String "lovelace")])),("transaction",String "hKYAgYJYIKDlAlgltPhu+xdBJ7b0WhweRQj7GQGujCKfOTLBu8tJAA2AAYKCWDkAFpFXfS45qGYei6alzIVGDi4lhcoiAC4/AkX7yZOiyzFhrKwNAYvW11qwvNKUaIB6PxMOTC9GkgkaABncToJYOQD2rLM5NgHfxSY7vFEJL7W+H+wvT5PzjQskc7kcjSayErwcgBE/CcnvqPqMZFp+AZWGLMSDADUqFBoAfCX1AhoAApQ9AxoAARpYDoCg9fY=")])

I am happy to provide more input or work on fixing this. From taking a glance at the code I didn't see immediately what is exactly off here since json instances are derived using generics, might be something is not correct in the client.

@v0d1ch v0d1ch added the Bug label Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@v0d1ch and others