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

Remove expert mode for stake/unstake/finalize_unstake #280

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions app/src/parser/micheline_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ tz_micheline_parser_init(tz_parser_state *state)

m->frame = m->stack;
m->stack[0].step = TZ_MICHELINE_STEP_TAG;
m->is_unit = false;
}

/**
Expand Down Expand Up @@ -373,6 +374,12 @@ tz_micheline_parser_step(tz_parser_state *state)
}
m->frame->step = TZ_MICHELINE_STEP_PRIM_NAME;
m->frame->step_prim.op = op;
// clang-format off
m->is_unit = ((m->frame == m->stack)
&& (op == TZ_MICHELSON_OP_Unit)
&& (m->frame->step_prim.nargs == 0)
&& (!m->frame->step_prim.annot));
// clang-format on
break;
case TZ_MICHELINE_STEP_PRIM_NAME:
if (m->frame->step_prim.wrap && m->frame->step_prim.first) {
Expand Down
1 change: 1 addition & 0 deletions app/src/parser/micheline_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ typedef struct {
stack[TZ_MICHELINE_STACK_DEPTH]; /// stack of frames
tz_micheline_parser_frame *frame; /// current frame
/// init == stack, NULL when done
bool is_unit; /// indicates whether the micheline read is a unit
} tz_micheline_state;
3 changes: 3 additions & 0 deletions app/src/parser/operation_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ tz_step_read_micheline(tz_parser_state *state)
}
tz_micheline_parser_step(state);
if (state->errno == TZ_BLO_DONE) {
if (state->micheline.is_unit) {
state->field_info.is_field_complex = false;
}
if ((op->frame->stop != 0) && (state->ofs != op->frame->stop)) {
tz_raise(TOO_LARGE);
}
Expand Down
33 changes: 0 additions & 33 deletions tests/integration/nano/test_reject_transaction.py

This file was deleted.

45 changes: 0 additions & 45 deletions tests/integration/nano/test_sign_simple_transaction.py

This file was deleted.

Loading
Loading