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

refactor(ethexe): simplify program creation and message sending in tests #4455

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

playX18
Copy link
Member

@playX18 playX18 commented Jan 20, 2025

  • Updated test cases to remove unnecessary payload and value parameters in create_program calls.
  • Replaced direct assertions on initialization message properties with assertions on reply messages.

…st cases

- Updated test cases to remove unnecessary payload and value parameters in `create_program` calls.
- Replaced direct assertions on initialization message properties with assertions on reply messages.
@playX18 playX18 added the A0-pleasereview PR is ready to be reviewed by the team label Jan 20, 2025
@playX18 playX18 requested a review from breathx January 20, 2025 03:05
@@ -1202,18 +1267,10 @@ mod utils {
}

// TODO (breathx): split it into different functions WITHIN THE PR.
Copy link
Member

Choose a reason for hiding this comment

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

rm todo

payload: &[u8],
value: u128,
) -> Result<WaitForProgramCreation> {
pub async fn create_program(&self, code_id: CodeId) -> Result<WaitForProgramCreation> {
Copy link
Member

Choose a reason for hiding this comment

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

rm EXECUTABLE BALANCE constant in favor of func argument / another func that will create program and topup balance

Copy link
Member

Choose a reason for hiding this comment

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

so in case of absence of exec balance there's no need in approve

assert_eq!(
res.reply_code,
ReplyCode::Success(SuccessReplyReason::Manual)
);
assert_eq!(res.reply_payload, b"PONG");
Copy link
Member

Choose a reason for hiding this comment

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

overall refactor would be good as well

Suggested change
assert_eq!(res.reply_payload, b"PONG");
assert_eq!(reply.payload, b"PONG"); // etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants