gno icon indicating copy to clipboard operation
gno copied to clipboard

feat(gnokey): add missing -send flag to maketx run

Open tbruyelle opened this issue 2 months ago • 2 comments

Closes #4866 Required for #4655

Added a txtar test to ensure that -send flag doesnt affect the user balance when used in maketx run.

Added similar txtar for maketx call, this time the user balance is affected.

tbruyelle avatar Oct 22 '25 17:10 tbruyelle

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • [ ] IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info) 🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: tbruyelle/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🟢 User notJoon already reviewed PR 4868 with state APPROVED
    │       ├── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🔴 This pull request is a draft
    └── 🟢 Then
        └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

Gno2D2 avatar Oct 22 '25 17:10 Gno2D2

Codecov Report

:x: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gno.land/pkg/keyscli/run.go 80.00% 1 Missing and 1 partial :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Oct 22 '25 17:10 codecov[bot]

The way I see it:

An ephemeral package is not a realm - it's code executing on behalf of the user. So OriginSend in this context doesn't behave like it does for other realms.

With a typical realm call, a user sends tokens to a contract. Here, -send specifies a spending cap, and the ephemeral code decides how to use it.

In other words, -send could theoretically be optional if we allowed the source code to directly use the caller's banker module, but that would be very unsafe. It's better to require an explicit -send flag which isn't actually "sending to another realm" but rather "providing a max spending allowance." for this script.

I think of it like the banker module having a virtual amount=0 when -send is omitted, and up to the -send value when provided.

moul avatar Dec 16 '25 21:12 moul