Skip to content

Commit

Permalink
Manually tweak e2e fixtures to be valid in Conway (#4752)
Browse files Browse the repository at this point in the history
- [x] Make e2e game fixtures valid in Conway by dropping two fields with
empty values

### Comments

When reproducing in a unit test I got the following two failures:

- DecoderErrorDeserialiseFailure "Shelley Tx" (DeserialiseFailure 117
"TxBody: 'Required Signer Hashes' must be non-empty when supplied")
- DecoderErrorDeserialiseFailure "Shelley Tx" (DeserialiseFailure 42
"TxBody: 'Collateral Inputs' must be non-empty when supplied")

These correspond to the tags 13 and 14 in the Conway binary spec:

https://github.com/IntersectMBO/cardano-ledger/blob/8d7d261dfb6282ab86cad32ec3f1be71db9a3080/eras/conway/impl/cddl-files/conway.cddl#L431-L432

Using cbor.me we can confirm the presence of in the binaries from the
errors:

```
      0D                                # unsigned(13)
      80                                # array(0)
```

So we manaully delete
- `0d80`
- `0e80`
with this meaning (some matches of 0e80 were part of bytestrings, so we
don't delete them)

And then adjust the preceding TxBody length:

```
84                                      # array(4)
   A5                                   # map(5)
```

E.g. `s/A5/A3`.


### Issue Number

ADP-3413
  • Loading branch information
HeinrichApfelmus authored Sep 2, 2024
2 parents d0ac1ec + c24f835 commit 2cdeb9a
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/e2e/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ task :wait_until_node_synced do

network = CardanoWallet.new.misc.network
# allow 180 mins for connecting to the node in case it needs to replay ledger
timeout = 180*60
timeout = 180 * 60
current_time = Time.now
timeout_treshold = current_time + timeout
log "Timeout: #{timeout}s"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/currency.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"transaction": "84a50081825820{{transactionId}}{{transactionIdxHex}}018002000d8009a1581c{{policyId}}a245617066656c1903e84662616e616e6101a20381590cd0{{policy}}0480f5f6",
"transaction": "84a40081825820{{transactionId}}{{transactionIdxHex}}0180020009a1581c{{policyId}}a245617066656c1903e84662616e616e6101a10381590cd0{{policy}}f5f6",
"inputs": [
{
"id": "{{transactionId}}",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/game_1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"transaction": "84a500800d80018183581d70ca80730a8bb1eb9ed5c5c9deb55a3ee495f96fc3cee0646b76e1e7c31a00989680582014845e067bf83c19a97207c8a2057d9499624783f1fce1ef5abf600392240ad002000e80a10481d8799f581ca1c0a4e322cb639198421ec70e4d9d2c3586df70103a63c35494f51745677565737358202cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824fff5f6",
"transaction": "84a30080018183581d70ca80730a8bb1eb9ed5c5c9deb55a3ee495f96fc3cee0646b76e1e7c31a00989680582014845e067bf83c19a97207c8a2057d9499624783f1fce1ef5abf600392240ad00200a10481d8799f581ca1c0a4e322cb639198421ec70e4d9d2c3586df70103a63c35494f51745677565737358202cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824fff5f6",
"inputs": [],
"redeemers": []
}
2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/game_2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/game_3.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/mintBurn_1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"transaction": "84a600800d80018002000e81581c{{ vkHash }}09a1581c{{ policyId }}a1496d696e742d6275726e01a20381591611{{ policy }}0480f5f6",
"transaction": "84a50080018002000e81581c{{ vkHash }}09a1581c{{ policyId }}a1496d696e742d6275726e01a10381591611{{ policy }}f5f6",
"inputs": [],
"redeemers": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/mintBurn_2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"transaction": "84a600800d80018002000e81581c{{ vkHash }}09a1581c{{ policyId }}a1496d696e742d6275726e20a20381591611{{ policy }}0480f5f6",
"transaction": "84a50080018002000e81581c{{ vkHash }}09a1581c{{ policyId }}a1496d696e742d6275726e20a10381591611{{ policy }}f5f6",
"inputs": [],
"redeemers": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/ping-pong_1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"transaction": "84a500800d80018183581d704d72cf569a339a18a7d9302313983f56e0d96cd45bdcb1d6512dca6a1a001e84805820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec02000e80a10481d87980f5f6",
"transaction": "84a30080018183581d704d72cf569a339a18a7d9302313983f56e0d96cd45bdcb1d6512dca6a1a001e84805820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec0200a10481d87980f5f6",
"redeemers": [],
"inputs": []
}
2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/ping-pong_2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/e2e/fixtures/plutus/withdrawal.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"transaction": "84A600800D80018002000E8005A1581DF0{{scriptHash}}00A10381590853{{script}}F5F6",
"transaction": "84A400800180020005A1581DF0{{scriptHash}}00A10381590853{{script}}F5F6",
"inputs": [],
"redeemers": [
{
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/spec/e2e_shared_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@
end

it 'Multi-assets transaction - two cosigners, all' do
# TODO: [ADP-3419] https://cardanofoundation.atlassian.net/browse/ADP-3419
pending 'wallet has run out of HappyCoin and SadCoin'
amt = 1
amt_ada = 1_600_000
src_wid = @wid_sha_cos0_all
Expand Down

0 comments on commit 2cdeb9a

Please sign in to comment.