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

Improve 'renderTx' output for better debugging / analysis. #293

Merged
1 commit merged into from
Mar 28, 2022

Conversation

KtorZ
Copy link
Collaborator

@KtorZ KtorZ commented Mar 25, 2022

  • Show resolved inputs when UTxO is available
  • Show redeemers pointers and budgets
  • Prettify script data
  • Show scripts' name when known (i.e. all scripts but minting policy)
  • Show addresses and datum associated to outputs
  • Display multi-assets values on multiple lines
  • Show required signers

Before

Lookup utxo: {
   "dfc6ffbec6c8b76b6b9c533aa16ae6a39c49fc07a3834bc6d0addb81e59d2041#73": {
       "address": "addr_test1wpl7wgq39p2rlvpms28flpdmqsfgen0s6szar0xj7c7grnqw36w0v",
       "datumhash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec",
       "value": {
           "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c": {
               "f05d1ce9903a6dbb0f3c4c47a16f6eef1c2046885a967feb2d9a2689": 1
           },
           "lovelace": 2000000
       }
   },
   "ca9d0bd55bd6cfb4e87125c68eb10d55f3ef2ccc46f7f8c17a1695ba0024e672#51": {
       "address": "addr_test1wzt6dvz6f4uqjqzv7cyw83rejczgg69rdtunr9qd0uregnqh6wsen",
       "datumhash": "4c707ca2cec07227025af7717b3b1e93f078d2dd541ccf5aa4f9aca742b65be0",
       "value": {
           "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c": {
               "9f07b35249b938f3465c2d93decf3fd4540c9dca74f3b18875e234fe": 1
           },
           "lovelace": 2000020
       }
   },
   "d3706a07dc49f091b6ccadd9323f780b411386997c1dbe9c8bd809d102d0c359#82": {
       "address": "addr_test1wpl7wgq39p2rlvpms28flpdmqsfgen0s6szar0xj7c7grnqw36w0v",
       "datumhash": "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec",
       "value": {
           "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c": {
               "12ea298de0f22db9442f82a4e00e5f19453199cfcf7c64772a285989": 1
           },
           "lovelace": 2000000
       }
   },
   "913afe731ffea84a50b0bc82195a76f90363704c597dac21de262452f744b6ac#71": {
       "address": "addr_test1wphlne3vyhtmj0g99nqylld2kw74ujlthz9ywpqd8z6pdmsf2m4k0",
       "datumhash": "be23e432a0e233b54a651075320b177165c1f7ff0d5d3d85bcac2eb788624f28",
       "value": {
           "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c": {
               "4879647261486561645631": 1
           },
           "lovelace": 2000000
       }
   }
}
Tx: "ce4cc2ff8b81a44b2d9a5dc3abc0758f4fb257202498cf7bb2b12ab2310e1e67"
 Input set (4)
   - 913afe731ffea84a50b0bc82195a76f90363704c597dac21de262452f744b6ac#71
   - ca9d0bd55bd6cfb4e87125c68eb10d55f3ef2ccc46f7f8c17a1695ba0024e672#51
   - d3706a07dc49f091b6ccadd9323f780b411386997c1dbe9c8bd809d102d0c359#82
   - dfc6ffbec6c8b76b6b9c533aa16ae6a39c49fc07a3834bc6d0addb81e59d2041#73
 Outputs (1)
   total number of assets: 0
   - 20 lovelace
 Minted: TxMintValue MultiAssetInAlonzoEra (valueFromList [(AssetId "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c" "\DC2\234)\141\224\242-\185D/\130\164\224\SO_\EME1\153\207\207|dw*(Y\137",-1),(AssetId "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c" "HydraHeadV1",-1),(AssetId "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c" "\159\a\179RI\185\&8\243F\\-\147\222\207?\212T\f\157\202t\243\177\136u\226\&4\254",-1),(AssetId "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c" "\240]\FS\233\144:m\187\SI<LG\161on\239\FS F\136Z\150\DEL\235-\154&\137",-1)]) ViewTx
 Scripts (4)
   total size (bytes):  25321
   - ScriptHash "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c"
   - ScriptHash "6ff9e62c25d7b93d052cc04ffdaab3bd5e4bebb88a47040d38b416ee"
   - ScriptHash "7fe7201128543fb03b828e9f85bb04128ccdf0d405d1bcd2f63c81cc"
   - ScriptHash "97a6b05a4d7809004cf608e3c47996048468a36af931940d7f07944c"
 Datums (3)
   - SafeHash "4c707ca2cec07227025af7717b3b1e93f078d2dd541ccf5aa4f9aca742b65be0" -> DataConstr Constr 0 [I 18446744073709551587,B "o\249\230,%\215\185=\ENQ,\192O\253\170\179\189^K\235\184\138G\EOT\r8\180\SYN\238",Constr 0 [Constr 0 [B "\130X\GS`\221\ACK\172x\ENQ\165\SI\185W\194_\220\250\v\218\199f\240\GS\130]D\247\US=\194\153`\DC4"]]]
   - SafeHash "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec" -> DataConstr Constr 0 []
   - SafeHash "be23e432a0e233b54a651075320b177165c1f7ff0d5d3d85bcac2eb788624f28" -> DataConstr Constr 0 [Constr 0 [I 10000000000000],List [I 18446744073709551593,I 16,I 18446744073709551587]]
 Redeemers (5)
   - DataConstr Constr 2 []
   - DataConstr Constr 1 []
   - DataConstr Constr 0 []
   - DataConstr Constr 0 []
   - DataConstr Constr 1 []

After

 Tx: "ce4cc2ff8b81a44b2d9a5dc3abc0758f4fb257202498cf7bb2b12ab2310e1e67"
 
 == INPUTS (4)
 - 913afe731ffea84a50b0bc82195a76f90363704c597dac21de262452f744b6ac#71
       ShelleyAddress Testnet (ScriptHashObj (ScriptHash "6ff9e62c25d7b93d052cc04ffdaab3bd5e4bebb88a47040d38b416ee")) StakeRefNull
       2000000 lovelace
       1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.4879647261486561645631
       TxOutDatumHash "be23e432a0e233b54a651075320b177165c1f7ff0d5d3d85bcac2eb788624f28"
 - ca9d0bd55bd6cfb4e87125c68eb10d55f3ef2ccc46f7f8c17a1695ba0024e672#51
       ShelleyAddress Testnet (ScriptHashObj (ScriptHash "97a6b05a4d7809004cf608e3c47996048468a36af931940d7f07944c")) StakeRefNull
       2000020 lovelace
       1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.9f07b35249b938f3465c2d93decf3fd4540c9dca74f3b18875e234fe
       TxOutDatumHash "4c707ca2cec07227025af7717b3b1e93f078d2dd541ccf5aa4f9aca742b65be0"
 - d3706a07dc49f091b6ccadd9323f780b411386997c1dbe9c8bd809d102d0c359#82
       ShelleyAddress Testnet (ScriptHashObj (ScriptHash "7fe7201128543fb03b828e9f85bb04128ccdf0d405d1bcd2f63c81cc")) StakeRefNull
       2000000 lovelace
       1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.12ea298de0f22db9442f82a4e00e5f19453199cfcf7c64772a285989
       TxOutDatumHash "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"
 - dfc6ffbec6c8b76b6b9c533aa16ae6a39c49fc07a3834bc6d0addb81e59d2041#73
       ShelleyAddress Testnet (ScriptHashObj (ScriptHash "7fe7201128543fb03b828e9f85bb04128ccdf0d405d1bcd2f63c81cc")) StakeRefNull
       2000000 lovelace
       1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.f05d1ce9903a6dbb0f3c4c47a16f6eef1c2046885a967feb2d9a2689
       TxOutDatumHash "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"
 
 == OUTPUTS (1)
 Total number of assets: 0
 - ShelleyAddress Testnet (KeyHashObj (KeyHash "dd06ac7805a50fb957c25fdcfa0bdac766f01d825d44f71f3dc29960")) StakeRefNull
       20 lovelace
       TxOutDatumNone
 
 == MINT/BURN
-1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.12ea298de0f22db9442f82a4e00e5f19453199cfcf7c64772a285989
-1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.4879647261486561645631
-1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.9f07b35249b938f3465c2d93decf3fd4540c9dca74f3b18875e234fe
-1 5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c.f05d1ce9903a6dbb0f3c4c47a16f6eef1c2046885a967feb2d9a2689
 
 == SCRIPTS (4)
 Total size (bytes):  25321
 - Unknown Script (ScriptHash "5ff22456751243b925c3848589f2cefaab0ebcd8d62586ed99610e0c")
 - Head Script (ScriptHash "6ff9e62c25d7b93d052cc04ffdaab3bd5e4bebb88a47040d38b416ee")
 - InitialScript Script (ScriptHash "7fe7201128543fb03b828e9f85bb04128ccdf0d405d1bcd2f63c81cc")
 - CommitScript Script (ScriptHash "97a6b05a4d7809004cf608e3c47996048468a36af931940d7f07944c")
 
 == DATUMS (3)
 - "4c707ca2cec07227025af7717b3b1e93f078d2dd541ccf5aa4f9aca742b65be0"
   [0,[18446744073709551587,"0x6ff9e62c25d7b93d052cc04ffdaab3bd5e4bebb88a47040d38b416ee",[0,[[0,["0x82581d60dd06ac7805a50fb957c25fdcfa0bdac766f01d825d44f71f3dc2996014"]]]]]]
 - "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"
   [0,[]]
 - "be23e432a0e233b54a651075320b177165c1f7ff0d5d3d85bcac2eb788624f28"
   [0,[[0,[10000000000000]],[18446744073709551593,16,18446744073709551587]]]
 
 == REDEEMERS (5)
 - Spend#0 ( cpu = 0, mem = 0 ) 
   [2,[]]
 - Spend#1 ( cpu = 0, mem = 0 ) 
   [1,[]]
 - Spend#2 ( cpu = 0, mem = 0 ) 
   [0,[]]
 - Spend#3 ( cpu = 0, mem = 0 ) 
   [0,[]]
 - Mint#0 ( cpu = 0, mem = 0 ) 
   [1,[]]
 
 == REQUIRED SIGNERS
 - "f05d1ce9903a6dbb0f3c4c47a16f6eef1c2046885a967feb2d9a2689"

@KtorZ KtorZ requested review from ch1bo and a user March 25, 2022 12:06
@KtorZ KtorZ self-assigned this Mar 25, 2022
Base automatically changed from ensemble/284 to master March 28, 2022 08:31
@ghost ghost force-pushed the KtorZ/render-tx-improvements branch from 47900f5 to b5b997e Compare March 28, 2022 09:06
@github-actions
Copy link

Unit Test Results

    5 files  ±0    71 suites  ±0   7m 27s ⏱️ +21s
191 tests ±0  189 ✔️ ±0  2 💤 ±0  0 ±0 

Results for commit b5b997e. ± Comparison against base commit e82a162.

@ghost ghost merged commit 212be95 into master Mar 28, 2022
@ghost ghost deleted the KtorZ/render-tx-improvements branch March 28, 2022 11:18
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant