Skip to content

Claiming worker rewards does not work as expected #14

@villesundell

Description

@villesundell

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:

  1. Only claimant can claim their rewards
    Or:
  2. Error should be raised
    Or:
  3. RAM ownership should be re-thought

Additional context
Problematic line is this:

accounts.emplace(claimant, [&](auto& col) {

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions