IntersectMBO / cardano-transactions

Library utilities for constructing and signing Cardano transactions.
Apache License 2.0
25 stars 7 forks source link

Command-line for constructing transaction #3

Closed KtorZ closed 4 years ago

KtorZ commented 4 years ago

Comments

I will add unit tests that constructs the same transactions as in the golden tests and verify the output. But already, from manual testing:

cardano-tx empty 764824073 \
  | cardano-tx add-input 0 3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7 \
  | cardano-tx add-output 42 Ae2tdPwUPEZETXfbQxKMkMJQY1MoHCBS7bkw6TmhLjRvi9LZh1uDnXy319f \
  | cardano-tx lock \
  | cardano-tx sign-with e0860dab46f13e74ab834142e8877b80bf22044cae8ebab7a21ed1b8dc00c155f6b78eee2a5bbd453ce7e7711b2964abb6a36837e475271f18ff36ae5fc8af73e25db39fb78e74d4b53fb51776d0f5eb360e62d09b853f3a87ac25bf834ee1fb \
  | cardano-tx serialize

# goOfggDYGFgkglggO0AmURHYuzw8YI2Vs6C/g0YazjLXkzZXmhk5s6rRwLcA/5+CgtgYWCGDWByw5pPLyXJyvUKqzztEPsrGi5a0+iAVkYako4iDoAAaSXwVxhgq/6CBggDYGFiFglhAjmICNbKkJyWcwaHGOvnvF5yztuOW2hguAdZd0+176UviXbOft4501LU/tRd20PXrNg5i0JuFPzqHrCW/g07h+1hANoRQGiE0a6PBmm3DR5GA6AoU5e3A/7SxRpq+AzLn4crykdUMuNLEfuN/a0S3+/zFobAbwmIDjpOWm5pyiis1AA==

:tada:

coverage from hpc:

 90% expressions used (270/299)   
 42% boolean coverage (3/7)       
      42% guards (3/7), 3 always True, 1 always False
     100% 'if' conditions (0/0)   
     100% qualifiers (0/0)        
 67% alternatives used (19/28)    
100% local declarations used (7/7)
 88% top-level declarations used (22/25)
KtorZ commented 4 years ago

@paweljakubas

  1. Yes! As mentioned in the comments, that's something I'll add this morning using the process library.

  2. Indeed, cf 1.

  3. Well... if you can find any :) ...

  4. Yes :thinking: ... It's the same error that I am also sometimes getting locally. I'll clear the cache and try again.

If so don't we need additional flag to differentiate between Byron tx, Shelley tx, Shelley Jormungandr tx???

Nope, this is only for Byron at the moment. We'll have support for Shelley a bit later and at this time we'll see what's best :thinking: (I believe that we can encode this information in the state itself and keep the command-line the same). Jörmungandr is out of the picture, there's jcli for this.

paweljakubas commented 4 years ago

I was thinking that maybe something of interest from golden test perspective from cardano-ledger for us :

  1. https://github.com/input-output-hk/cardano-ledger/tree/master/cardano-ledger/test/golden/cbor/utxo
  2. https://github.com/input-output-hk/cardano-ledger/blob/master/cardano-ledger/test/Test/Cardano/Chain/UTxO/CBOR.hs
KtorZ commented 4 years ago

The golden tests in cardano-ledger are testing the ledger binary serialisers and since we actually use the ledger library, duplicated these tests here will be redundant.