Skip to content

Commit

Permalink
Resolve issue #1857
Browse files Browse the repository at this point in the history
  • Loading branch information
ark0f committed Feb 11, 2023
1 parent 01c29db commit fe7f153
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 35 deletions.
7 changes: 1 addition & 6 deletions gtest/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,9 @@ mod tests {
let log = run_result.log();
assert!(!log.is_empty());

// TODO: fix this in #1857
assert!(log[0]
.payload()
.starts_with(b"Reason is unknown. Possibly `unreachable` instruction is occurred"));
// assert!(log[0]
// .payload()
// .starts_with(b"'Invalid input, should be three IDs separated by
// comma'"));
.starts_with(b"'Invalid input, should be three IDs separated by comma'"));

let run_result = prog.send(user_id, String::from("should_be_skipped"));

Expand Down
41 changes: 12 additions & 29 deletions pallets/gear/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5649,20 +5649,15 @@ fn test_create_program_with_value_lt_ed() {
// to send init message with value in invalid range.
assert_total_dequeued(1);

// TODO: fix this in #1857
assert_failed(
msg_id,
ActorExecutionErrorReason::Ext(TrapExplanation::Unknown),
ActorExecutionErrorReason::Ext(TrapExplanation::Core(ExtError::Message(
MessageError::InsufficientValue {
message_value: 499,
existential_deposit: 500,
},
))),
);
// assert_failed(
// msg_id,
// ActorExecutionErrorReason::Ext(TrapExplanation::Core(ExtError::Message(
// MessageError::InsufficientValue {
// message_value: 499,
// existential_deposit: 500,
// },
// ))),
// );
})
}

Expand Down Expand Up @@ -5735,20 +5730,15 @@ fn test_create_program_with_exceeding_value() {
// to send init message with value more than program has.
assert_total_dequeued(1);

// TODO: fix this in #1857
assert_failed(
origin_msg_id,
ActorExecutionErrorReason::Ext(TrapExplanation::Unknown),
ActorExecutionErrorReason::Ext(TrapExplanation::Core(ExtError::Message(
MessageError::NotEnoughValue {
message_value: 1001,
value_left: 1000,
},
))),
);
// assert_failed(
// origin_msg_id,
// ActorExecutionErrorReason::Ext(TrapExplanation::Core(ExtError::Message(
// MessageError::NotEnoughValue {
// message_value: 1001,
// value_left: 1000,
// },
// ))),
// );
})
}

Expand Down Expand Up @@ -9157,17 +9147,10 @@ fn check_reply_push_payload_exceed() {
run_to_block(2, None);
assert_last_dequeued(1);

// TODO: fix this in #1857
assert_failed(
message_id,
ActorExecutionErrorReason::Ext(TrapExplanation::Unknown),
);
// assert_failed(
// message_id,
// ActorExecutionErrorReason::Ext(TrapExplanation::Core(ExtError::Message(
// MessageError::MaxMessageSizeExceed,
// ))),
// );
});
}

Expand Down

0 comments on commit fe7f153

Please sign in to comment.