Skip to content

Commit

Permalink
Parser: make the transaction's field parameter a complex field
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Jan 12, 2024
1 parent 3a834a5 commit 80762b9
Show file tree
Hide file tree
Showing 218 changed files with 45 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/src/parser/operation_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ TZ_OPERATION_FIELDS(transaction_fields,
TZ_OPERATION_OPTION_FIELD("_Parameters",
TZ_OPERATION_TUPLE_FIELD("_Parameters",
TZ_OPERATION_FIELD("Entrypoint", TZ_OPERATION_FIELD_SMART_ENTRYPOINT, .complex=true),
TZ_OPERATION_FIELD("Parameter", TZ_OPERATION_FIELD_EXPR)),
TZ_OPERATION_FIELD("Parameter", TZ_OPERATION_FIELD_EXPR, .complex=true)),
.display_none=false)
);

Expand Down
3 changes: 2 additions & 1 deletion tests/generate/gen_integration.ml
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ let operation_to_screens
then []
else
[
need_expert_mode_screen "Parameter";
need_expert_mode_screen "Entrypoint";
make_screen ~title:"Entrypoint" "%a" Entrypoint.pp entrypoint;
need_expert_mode_screen "Parameter";
make_screen ~title:"Parameter" "%a" pp_lazy_expr parameters;
]
in
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions tests/integration/stax/test_blindsign_valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
app.review.tap()
app.assert_screen("tst_review_003")
app.review.tap()
app.assert_screen("expert_mode_splash")
app.review.tap()
app.assert_screen("tst_review_004")
app.review.tap()
app.assert_screen("operation_sign")

expected_apdu = "f6d5fa0e79cac216e25104938ac873ca17ee9d7f06763719293b413cf2ed475cf63d045a1cc9f73eee5775c5d496fa9d3aa9ae57fb97217f746a8728639795b7b2220e84ce5759ed111399ea3263d810c230d6a4fffcb6e82797c5ca673a17089000"
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/stax/test_parsing_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
app.review.tap()
app.assert_screen("tpe_review_0_03_full")
app.review.tap()
app.assert_screen("expert_mode_splash")
app.review.tap()
app.assert_screen("tpe_review_0_04_full")
app.review.tap()

verify_err_reject_response(app, "invalid_tag")

Expand Down
12 changes: 12 additions & 0 deletions tests/integration/stax/test_sign_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
app.review.tap()
app.assert_screen("tst_review_003")

app.review.tap()
app.assert_screen("tst_expert_splash")

app.review.tap()
app.assert_screen("tst_review_004")

app.review.tap()
app.assert_screen("operation_sign")

Expand Down Expand Up @@ -75,6 +81,12 @@
app.review.tap()
app.assert_screen("tst_review_003")

app.review.tap()
app.assert_screen("tst_expert_splash")

app.review.tap()
app.assert_screen("tst_review_004")

app.review.tap()
app.assert_screen("operation_sign")

Expand Down
6 changes: 6 additions & 0 deletions tests/integration/stax/test_sign_transfer_without_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
app.review.tap()
app.assert_screen("review_2")

app.review.tap()
app.assert_screen("expert_mode_splash")

app.review.tap()
app.assert_screen("review_3")

app.review.tap()
app.assert_screen("operation_sign")

Expand Down
25 changes: 16 additions & 9 deletions tests/unit/ctest/tests_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ CTEST2(operation_parser, check_simple_transaction_complexity)
{"Storage limit", false, 3},
{"Amount", false, 4},
{"Destination", false, 5},
// {"Option", _, 6},
};
check_field_complexity(data, str, fields_check, sizeof(fields_check));
}
Expand All @@ -250,8 +251,10 @@ CTEST2(operation_parser, check_transaction_complexity)
{"Storage limit", false, 3},
{"Amount", false, 4},
{"Destination", false, 5},
{"Entrypoint", true, 6},
{"Parameter", true, 6},
// {"Option", _, 6},
// {"Tuple", _, 7},
{"Entrypoint", true, 8},
{"Parameter", true, 9},
};
check_field_complexity(data, str, fields_check, sizeof(fields_check));
}
Expand All @@ -270,14 +273,16 @@ CTEST2(operation_parser, check_double_transaction_complexity)
{"Storage limit", false, 3 },
{"Amount", false, 4 },
{"Destination", false, 5 },
// {"None" , false, 6 },
// {"Option", _, 6 },
{"Source", false, 7 },
{"Fee", false, 8 },
{"Storage limit", false, 9 },
{"Amount", false, 10},
{"Destination", false, 11},
{"Entrypoint", true, 12},
{"Parameter", true, 12},
// {"Option", _, 12},
// {"Tuple", _, 13},
{"Entrypoint", true, 14},
{"Parameter", true, 15},
};
check_field_complexity(data, str, fields_check, sizeof(fields_check));
}
Expand All @@ -293,7 +298,7 @@ CTEST2(operation_parser, check_origination_complexity)
{"Fee", false, 2},
{"Storage limit", false, 3},
{"Balance", false, 4},
{"Delegate", false, 5},
{"Delegate", false, 5}, // None
{"Code", true, 6},
{"Storage", true, 7},
};
Expand All @@ -310,7 +315,8 @@ CTEST2(operation_parser, check_delegation_complexity)
{"Source", false, 1},
{"Fee", false, 2},
{"Storage limit", false, 3},
{"Delegate", false, 4},
// {"Option", _, 4},
{"Delegate", false, 5},
};
check_field_complexity(data, str, fields_check, sizeof(fields_check));
}
Expand All @@ -330,7 +336,7 @@ CTEST2(operation_parser, check_register_global_constant_complexity)
check_field_complexity(data, str, fields_check, sizeof(fields_check));
}

CTEST2(operation_parser, check_set_deposit_limite_complexity)
CTEST2(operation_parser, check_set_deposit_limit_complexity)
{
char str[]
= "030000000000000000000000000000000000000000000000000000000000000000"
Expand All @@ -340,7 +346,8 @@ CTEST2(operation_parser, check_set_deposit_limite_complexity)
{"Source", false, 1},
{"Fee", false, 2},
{"Storage limit", false, 3},
{"Staking limit", false, 4},
// {"Option", _, 4},
{"Staking limit", false, 5},
};
check_field_complexity(data, str, fields_check, sizeof(fields_check));
}
Expand Down

0 comments on commit 80762b9

Please sign in to comment.