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

test(starknet_consensus_orchestrator): return central object intead o… #4235

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

DvirYo-starkware
Copy link
Contributor

…f json values in utilities cende test

@reviewable-StarkWare
Copy link

This change is Reviewable

@DvirYo-starkware DvirYo-starkware force-pushed the dvir/central_obj_test_no_val branch 3 times, most recently from b46c1af to 78e2862 Compare February 18, 2025 16:04
Copy link
Contributor

@Yael-Starkware Yael-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @DvirYo-starkware)


crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 550 at r2 (raw file):

}

fn central_transaction_execution_info_with_reverted(

it is not always with reverted.

Code quote:

fn central_transaction_execution_info_with_reverted

Copy link
Contributor Author

@DvirYo-starkware DvirYo-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yael-Starkware)


crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 550 at r2 (raw file):

Previously, Yael-Starkware (YaelD) wrote…

it is not always with reverted.

Plese write what you think is appropriate name for the function you comment about

Copy link
Contributor

@Yael-Starkware Yael-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @DvirYo-starkware)


crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 493 at r2 (raw file):

// the entire object, we fill only one CallInfo with non-default values and the other CallInfos are
// None.
fn central_transaction_execution_info() -> TransactionExecutionInfo {

Suggestion:

fn transaction_execution_info() -> TransactionExecutionInfo {

crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 504 at r2 (raw file):

                balance_high: felt!(3_u8),
            },
        )),

Suggestion:

        revert_error: None,

crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 563 at r2 (raw file):

    transaction_execution_info.into()
}

Suggestion:

fn central_transaction_execution_info_reverted(
) -> CentralTransactionExecutionInfo {
    let mut transaction_execution_info = central_transaction_execution_info();
    // The python side enforces that if the transaction is reverted, the execute_call_info is None.
    // Since we are using the same json files for python tests, we apply these rules here as well.
    transaction_execution_info.execute_call_info = None;
    transaction_execution_info.revert_error = Some(RevertError::PostExecution(
            FeeCheckError::InsufficientFeeTokenBalance {
                fee: Fee(1),
                balance_low: felt!(2_u8),
                balance_high: felt!(3_u8),
            },
        ));

    transaction_execution_info.into()
}

fn central_transaction_execution_info(
) -> CentralTransactionExecutionInfo {
        transaction_execution_info.into()
}

@DvirYo-starkware DvirYo-starkware force-pushed the dvir/central_obj_test_no_val branch from 78e2862 to 8486fa5 Compare February 19, 2025 11:01
Copy link
Contributor Author

@DvirYo-starkware DvirYo-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Yael-Starkware)


crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 493 at r2 (raw file):

// the entire object, we fill only one CallInfo with non-default values and the other CallInfos are
// None.
fn central_transaction_execution_info() -> TransactionExecutionInfo {

Done.


crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 504 at r2 (raw file):

                balance_high: felt!(3_u8),
            },
        )),

Done.


crates/starknet_consensus_orchestrator/src/cende/central_objects_test.rs line 563 at r2 (raw file):

    transaction_execution_info.into()
}

Done.

Copy link
Contributor

@Yael-Starkware Yael-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @DvirYo-starkware)

@DvirYo-starkware DvirYo-starkware added this pull request to the merge queue Feb 19, 2025
Merged via the queue into main with commit d81f1c0 Feb 19, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants