Skip to content

fix(cucumber): fix claim burn ownership proof validation in cucumber tests#1981

Open
Stackwyre wants to merge 1 commit intotari-project:developmentfrom
Stackwyre:fix/120-fix-claim-burn-ownership-proof
Open

fix(cucumber): fix claim burn ownership proof validation in cucumber tests#1981
Stackwyre wants to merge 1 commit intotari-project:developmentfrom
Stackwyre:fix/120-fix-claim-burn-ownership-proof

Conversation

@Stackwyre
Copy link
Copy Markdown

Resolves #1974

Changes

  • integration_tests/tests/steps/wallet_daemon.rs

Fixes #1974


Generated by JARVIS AI — reviewed and tested

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch (git push --force-with-lease).

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.

Learn how to use 1Password to sign your commits.

Watch the demo

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the wallet daemon integration tests, replacing legacy step definitions with updated implementations that utilize the JSON-RPC client and improved error handling. Feedback focuses on replacing several instances of .unwrap() with proper error propagation using the ? operator to prevent potential panics during test execution, specifically when accessing validator nodes or performing type conversions for amounts.

.validator_nodes
.values()
.next()
.unwrap()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using .unwrap() here can cause a panic if validator_nodes is empty. Since this function returns a Result, it's better to propagate the error using ? to provide a more informative failure message.

Suggested change
.unwrap()
.ok_or_else(|| anyhow!("No validator nodes found in the world state"))?

from_account: from_account.account.address,
to_account: to_account.account.address,
max_fee: None,
amount: Amount::new(amount.try_into().unwrap()),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The use of .unwrap() here can cause the test to panic if the u64 amount cannot be converted to an i64. It's safer to propagate the error using the ? operator, as this function already returns a Result.

Suggested change
amount: Amount::new(amount.try_into().unwrap()),
amount: Amount::new(amount.try_into()?),

_ => panic!("Expected gt, gte, lt, lte or eq, got {}", operator),
let req = AccountsCreateFreeTestCoinsRequest {
account: None,
amount: Amount::new(amount.try_into().unwrap()),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The use of .unwrap() here can cause the test to panic if the u64 amount cannot be converted to an i64. It's safer to propagate the error using the ? operator, as this function already returns a Result.

Suggested change
amount: Amount::new(amount.try_into().unwrap()),
amount: Amount::new(amount.try_into()?),

.cloned()
.unwrap_or_default();

if balance.balance < Amount::new(amount.try_into().unwrap()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The use of .unwrap() here can cause the test to panic if the u64 amount cannot be converted to an i64. It's safer to propagate the error using the ? operator, as this function already returns a Result.

Suggested change
if balance.balance < Amount::new(amount.try_into().unwrap()) {
if balance.balance < Amount::new(amount.try_into()?) {

.cloned()
.unwrap_or_default();

if balance.balance != Amount::new(amount.try_into().unwrap()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The use of .unwrap() here can cause the test to panic if the u64 amount cannot be converted to an i64. It's safer to propagate the error using the ? operator, as this function already returns a Result.

Suggested change
if balance.balance != Amount::new(amount.try_into().unwrap()) {
if balance.balance != Amount::new(amount.try_into()?) {

@sdbondi sdbondi changed the title Fix #1974: Fix claim burn ownership proof validation in cucumber tests fix(cucumber): fix claim burn ownership proof validation in cucumber tests Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Test Results (CI)

0 tests   - 645   0 ✅  - 637   0s ⏱️ - 2h 21m 4s
0 suites  - 189   0 💤 ±  0 
0 files    -   4   0 ❌  -   8 

Results for commit ae7639f. ± Comparison against base commit 52a97f2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix claim burn ownership proof validation in cucumber tests

2 participants