Skip to content

Commit 85477a9

Browse files
test(eth2): align finalize-invalid test name with ERROR behavior
The eth2 plugin's FINALIZE path returns ETH_PLUGIN_RESULT_ERROR when context->valid is 0 (eth2_plugin.c), not a fallback result. Rename test_finalize_invalid_falls_back to test_finalize_invalid_returns_error and fix the header docstring ("valid=0 -> FALLBACK" -> "-> ERROR") so the test description matches the actual contract.
1 parent 975f0e2 commit 85477a9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/unit/src/test_eth2_plugin.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* - parameter 8 happy path leaves valid=1, mismatch flips it,
2525
* - eth2WithdrawalIndex > INDEX_MAX (2^16) is rejected as a
2626
* derivation-path-attack guard,
27-
* - FINALIZE: valid=1 -> OK + 2 screens, valid=0 -> FALLBACK,
27+
* - FINALIZE: valid=1 -> OK + 2 screens, valid=0 -> ERROR,
2828
* - QUERY_CONTRACT_ID writes "ETH2"/"Deposit",
2929
* - QUERY_CONTRACT_UI screen 0 is the amount (using
3030
* g_chain_config->ticker), screen 1 is "0x" + 96 hex chars
@@ -279,15 +279,15 @@ static void test_finalize_valid_returns_two_screens(void **state) {
279279
assert_int_equal(msg.uiType, ETH_UI_TYPE_GENERIC);
280280
}
281281

282-
static void test_finalize_invalid_falls_back(void **state) {
282+
static void test_finalize_invalid_returns_error(void **state) {
283283
(void) state;
284284
eth2_deposit_parameters_t ctx = {.valid = 0};
285285
txContent_t tx = {0};
286286
ethPluginFinalize_t msg = {0};
287287
msg.pluginContext = (uint8_t *) &ctx;
288288
msg.txContent = &tx;
289289
eth2_plugin_call(ETH_PLUGIN_FINALIZE, &msg);
290-
assert_int_equal(msg.result, ETH_PLUGIN_RESULT_FALLBACK);
290+
assert_int_equal(msg.result, ETH_PLUGIN_RESULT_ERROR);
291291
}
292292

293293
static void test_query_contract_id_eth2_deposit(void **state) {
@@ -479,7 +479,7 @@ int main(void) {
479479
cmocka_unit_test_setup(test_withdrawal_credentials_mismatch_flips_valid, reset),
480480
cmocka_unit_test_setup(test_withdrawal_index_above_max_rejected, reset),
481481
cmocka_unit_test_setup(test_finalize_valid_returns_two_screens, reset),
482-
cmocka_unit_test_setup(test_finalize_invalid_falls_back, reset),
482+
cmocka_unit_test_setup(test_finalize_invalid_returns_error, reset),
483483
cmocka_unit_test_setup(test_query_contract_id_eth2_deposit, reset),
484484
cmocka_unit_test_setup(test_ui_amount_screen_uses_chain_ticker, reset),
485485
cmocka_unit_test_setup(test_ui_validator_screen_renders_pubkey_hex, reset),

0 commit comments

Comments
 (0)