gno icon indicating copy to clipboard operation
gno copied to clipboard

chore(gnovm): remove redundant codes

Open Davphla opened this issue 2 months ago • 4 comments

fix #4788 Issue 1: This is false, this condition is defined in a loop, removing it break a test - gno/gnovm/stdlibs/io/io_test.gno:TestCopy Issue 2: This is false. It is implicitly defined in values.go:2569. I didn't find any explicit use of this field, but I think it is use in further use as it serialized in JSON. Issue 3: Fixed in PR Issue 4: Factually, it is used in alloc.go:128 for error purpose. The left value is equal to the number of remaining bytes in memory. left = maxBytes - bytes. I don't think it should be remove. Issue 5: Fixed in PR Issue 6: GetIsTransient is defined for later use (I assume for temporary object), as it always return false. It is used in realm.go. I don't have the future vision, so I don't know if it should be removed. Issue 7: Function does not exist, it has already been deleted.

Davphla avatar Sep 25 '25 07:09 Davphla

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • [ ] IGNORE the bot requirements for this PR (force green CI check)
  • [ ] The pull request description provides enough details
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: Davphla/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
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [jefft0 leohhhn n0izn0iz notJoon omarsy x1unix] (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
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)
    └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])

Can be checked by

  • team core-contributors

Gno2D2 avatar Sep 25 '25 07:09 Gno2D2

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

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

codecov[bot] avatar Sep 25 '25 08:09 codecov[bot]

The failure of issue 3 doesn't seem to be related to the fix. Could you apply the changes again and check using the go test -v ./gno.land/pkg/integration -run TestTestdata?

notJoon avatar Sep 29 '25 15:09 notJoon

The failure of issue 3 doesn't seem to be related to the fix. Could you apply the changes again and check using the go test -v ./gno.land/pkg/integration -run TestTestdata?

Fixed in https://github.com/gnolang/gno/pull/4807/commits/fc965385ee8abdcb3a69dff999ce7f90a5bdcc65

Davphla avatar Oct 01 '25 21:10 Davphla