Skip to content

Fix duplicate vote/withdraw checks, profit claim period tracking, and resource token validation#3642

Merged
jason-aelf merged 4 commits intomasterfrom
hotfix/fix-vote-profit-token-validation
Apr 17, 2026
Merged

Fix duplicate vote/withdraw checks, profit claim period tracking, and resource token validation#3642
jason-aelf merged 4 commits intomasterfrom
hotfix/fix-vote-profit-token-validation

Conversation

@jason-aelf
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@eanzhao eanzhao left a comment

Choose a reason for hiding this comment

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

Overall 修复思路正确,Profit 的 Math.Max 修复 + 对应测试很扎实。几点问题请看内联评论:主要是 Vote 合约四个不同 assert 用同一错误信息不便排查、TakeResourceTokenBack 的校验与 AdvanceResourceToken 不对称,以及 quadratic 分支下的顺序问题。

Comment thread contract/AElf.Contracts.Vote/VoteContract.cs Outdated
Comment thread contract/AElf.Contracts.Vote/VoteContract.cs
Comment thread contract/AElf.Contracts.Vote/VoteContract.cs
Comment thread contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs
Comment thread contract/AElf.Contracts.Profit/ProfitContract.cs
Comment thread test/AElf.Contracts.Profit.Tests/ProfitTests.cs
Comment thread test/AElf.Contracts.Vote.Tests/BVT/BasicTests.cs
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.63%. Comparing base (9f729e2) to head (228c6bd).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3642   +/-   ##
=======================================
  Coverage   90.62%   90.63%           
=======================================
  Files         680      680           
  Lines       26298    26310   +12     
  Branches     2369     2370    +1     
=======================================
+ Hits        23833    23845   +12     
  Misses       2350     2350           
  Partials      115      115           
Files with missing lines Coverage Δ
...AElf.Contracts.MultiToken/TokenContract_Actions.cs 93.23% <100.00%> (+0.02%) ⬆️
contract/AElf.Contracts.Profit/ProfitContract.cs 93.80% <100.00%> (ø)
contract/AElf.Contracts.Vote/VoteContract.cs 97.47% <100.00%> (+0.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@eanzhao eanzhao left a comment

Choose a reason for hiding this comment

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

LGTM

@jason-aelf jason-aelf merged commit d0980a8 into master Apr 17, 2026
12 of 16 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.

2 participants