Chore/migrate to file data source and fix request requester #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
builds upon #27
closes #28
With this change the
request.requester
will be set torequestInfo.party.requester
, similar forrequest.challenger
.Rationale
RequestInfo
stores the parties [none, requester, challenger] from themsg.sender
in the txn.https://github.com/kleros/tcr/blob/72e547ea135d839dc5db34e79e9f94f05c6a92bb/contracts/LightGeneralizedTCR.sol#L366C2-L368C1
Whereas if we use
event.transaction.from
in the subgraph, we gettx.origin
(which is not always msg.sender) .gtcr-subgraph/src/LightGeneralizedTCRMapping.ts
Line 452 in 6494aa9
In case of sponsored txn's (by safe)
tx.origin
can be a random account and not point to the user's safe address,whereas
msg.sender
is the user's safe address.So using msg.sender as the requestee or challenger makes more sense, as that it the account that interacts at contract level.
msg.sender
in this case would be the contract. So it is the user's responsibility to make sure they can withdraw the rewards from that contract, as the rewards will be sent to that contract (requestee at contract level)