Skip to content

Commit

Permalink
Merge pull request #280 from trilitech/palmer@functori@no-expert-stak…
Browse files Browse the repository at this point in the history
…ing-ops

Remove expert mode for `stake`/`unstake`/`finalize_unstake`
  • Loading branch information
ajinkyaraj-23 authored Sep 12, 2024
2 parents a907073 + 38e554e commit 5d9f0d9
Show file tree
Hide file tree
Showing 303 changed files with 282 additions and 126 deletions.
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

0 comments on commit 5d9f0d9

Please sign in to comment.