iotexproject / iotex-core

Official implementation of IoTeX blockchain protocol in Go.
https://iotex.io
Apache License 2.0
1.55k stars 322 forks source link

[rewarding] move claim address check to LoadProto() and SanityCheck() #4304

Closed dustinxie closed 5 days ago

dustinxie commented 1 week ago

Description

4277 added a claimTo field to receive claim reward, so other EOA can help claim reward on another's behalf.

move the address check from inside protocol.Handle to the action's LoadProto() and SanityCheck(), which is consistent with other action's behavior

Fixes #(issue)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

Checklist:

sonarcloud[bot] commented 1 week ago

Quality Gate Failed Quality Gate failed

Failed conditions
5.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

CoderZhi commented 1 week ago

4277 added a new field address to action ClaimFromRewardingFund, and the purpose is to help other accounts to claim rewards (not claiming rewards to some other accounts).

claimTo is just a parameter name, which may be confusing. a better naming for this parameter is claimFrom.