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

Add misc tests #751

Merged
merged 6 commits into from
Jun 6, 2024
Merged

Add misc tests #751

merged 6 commits into from
Jun 6, 2024

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Jun 5, 2024

Improves test coverage by testing some code paths that were not previously take. Will not contain any externally visible changes, only adding more tests and cleaning up existing ones.

Before requesting review

  • I have reviewed the code myself

@Dentosal Dentosal self-assigned this Jun 5, 2024
@Dentosal Dentosal marked this pull request as ready for review June 5, 2024 08:14
@Dentosal Dentosal requested a review from a team June 5, 2024 08:14
@Dentosal Dentosal enabled auto-merge June 5, 2024 08:44
Comment on lines +83 to +87
op::addi(0x10, RegId::ZERO, 8),
op::addi(0x11, RegId::ZERO, 16),
op::addi(0x12, RegId::ZERO, 32),
op::addi(0x13, RegId::ZERO, 64),
op::addi(0x14, RegId::ZERO, 128),
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to use some constant names for registers. It will connect them here with the values in suite

Comment on lines +172 to +185
let consensus_params = ConsensusParameters::standard();

let tx = TransactionBuilder::script(script, vec![])
.script_gas_limit(gas_limit)
.add_random_fee_input()
.finalize()
.into_checked(height, &consensus_params)
.expect("failed to generate checked tx")
.into_ready(
gas_price,
consensus_params.gas_costs(),
consensus_params.fee_params(),
)
.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems we repeat this part several times, maybe makes sense to move it into a function

Copy link
Collaborator

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

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

Looks good to me, added small [nit]s

@Dentosal Dentosal added this pull request to the merge queue Jun 5, 2024
@xgreenx xgreenx removed this pull request from the merge queue due to a manual request Jun 5, 2024
@Dentosal
Copy link
Member Author

Dentosal commented Jun 6, 2024

Merging this as-is, those nits will be addressed later when we'll expand the test helper context

@Dentosal Dentosal added this pull request to the merge queue Jun 6, 2024
Merged via the queue into master with commit 34f6ea5 Jun 6, 2024
39 checks passed
@Dentosal Dentosal deleted the dento/misc-tests branch June 6, 2024 07:32
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.

2 participants