Skip to content

fix: remove redundant donor record fetch in donate (#81)#85

Merged
Alqku merged 1 commit into
OrbitChainLabs:mainfrom
YaronZaki:fix/issue-81-remove-redundant-donor-fetch-in-donate
Jun 28, 2026
Merged

fix: remove redundant donor record fetch in donate (#81)#85
Alqku merged 1 commit into
OrbitChainLabs:mainfrom
YaronZaki:fix/issue-81-remove-redundant-donor-fetch-in-donate

Conversation

@YaronZaki

Copy link
Copy Markdown
Contributor

Summary

donate was reading the donor record from persistent storage with an unused first fetch bound to _donor_record, which also needlessly constructed a DonorRecord::new_for(...) fallback, cloning Address and AssetInfo for nothing. The second and third reads that follow already do the correct thing.

Changes

  • Removed the unused _donor_record binding from donate in campaign/src/lib.rs

Testing

Existing campaign contract tests pass without modification — the change is pure dead code removal with no behavioural impact.

Closes #81

@Alqku Alqku left a comment

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.

LGTM

@Alqku Alqku merged commit 0faa6d2 into OrbitChainLabs:main Jun 28, 2026
4 checks passed
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.

[LOW] donate fetches donor record twice; first read is discarded

2 participants