Claiming worker rewards does not work as expected
Describe the bug Currently anyone can help anyone by claiming their worker rewards. This is a good feature, and is a good smart contract design convention (do not place unneeded restrains).
However, if the account is a new one, claiming would not be successful, since it tries to use claimant's RAM, which is not available if the action caller is not claimant.
Expected behavior Either:
- Only claimant can claim their rewards Or:
- Error should be raised Or:
- RAM ownership should be re-thought
Additional context Problematic line is this: https://github.com/telosnetwork/telos-decide/blob/b17261e830d2549dfc54e0f9a0e5eb357e5c8a95/contracts/decide/src/worker.cpp#L152
Of these options, #2, Raising an error message for not enough RAM is probably the easiest and a sufficient fix. There are times when an account would want to claim for another.