Skip to content

Commit

Permalink
chore: remove scorerId
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schultz committed Nov 29, 2023
1 parent 2837a5e commit fa9573f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
5 changes: 2 additions & 3 deletions contracts/GitcoinResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ contract GitcoinResolver is
*/
function _setScore(Attestation calldata attestation) private {
// Decode the score attestion output
(uint256 score, uint32 scorerId, uint8 digits) = abi.decode(
(uint256 score, , uint8 digits) = abi.decode(
attestation.data,
(uint256, uint32, uint8)
);
Expand All @@ -170,8 +170,7 @@ contract GitcoinResolver is
scores[attestation.recipient] = CachedScore(
uint32(score),
attestation.time,
attestation.expirationTime,
scorerId
attestation.expirationTime
);
}

Expand Down
3 changes: 1 addition & 2 deletions contracts/IGitcoinResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ interface IGitcoinResolver {
uint32 score; // compacted uint value 4 decimal places
uint64 issuanceDate; // For checking the age of the stamp, without loading the attestation
uint64 expirationDate; // This makes sense because we want to make sure the stamp is not expired, and also do not want to load the attestation
uint32 scorerId; // would we need this ??? TODO: to be clarified
}

/**
Expand All @@ -29,7 +28,7 @@ interface IGitcoinResolver {
/**
*
* @param user The ETH address of the recipient
* @return The `CachedScore` for the given ETH address.
* @return The `CachedScore` for the given ETH address.
* A non-zero value in the `issuanceDate` indicates that a valid score has been retreived.
*/

Expand Down
5 changes: 2 additions & 3 deletions contracts/mocks/GitcoinResolverUpdate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ contract GitcoinResolverUpdate is
*/
function _setScore(Attestation calldata attestation) private {
// Decode the score attestion output
(uint256 score, uint32 scorerId, uint8 digits) = abi.decode(
(uint256 score, , uint8 digits) = abi.decode(
attestation.data,
(uint256, uint32, uint8)
);
Expand All @@ -150,8 +150,7 @@ contract GitcoinResolverUpdate is
scores[attestation.recipient] = CachedScore(
uint32(score),
attestation.time,
attestation.expirationTime,
scorerId
attestation.expirationTime
);
}

Expand Down
1 change: 0 additions & 1 deletion docs/00-onchain-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ struct CachedScore {
uint32 score;
uint64 issuanceDate;
uint64 expirationDate;
uint32 scorerId;
}
```

Expand Down
3 changes: 0 additions & 3 deletions test/GitcoinResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ describe("GitcoinResolver", function () {
expect(score[0]).to.equal("123456");
expect(score[1]).to.equal("200500");
expect(score[2]).to.equal("700500");
expect(score[3]).to.equal("1");
});

it("should cache a score and properly increase the number of decimals when there are less than 4", async function () {
Expand Down Expand Up @@ -229,7 +228,6 @@ describe("GitcoinResolver", function () {
expect(score[0]).to.equal("123400");
expect(score[1]).to.equal("200500");
expect(score[2]).to.equal("700500");
expect(score[3]).to.equal("2");
});

it("should cache a score and keep the score unchanged when there are 4 decimals", async function () {
Expand Down Expand Up @@ -259,7 +257,6 @@ describe("GitcoinResolver", function () {
expect(score[0]).to.equal("123456");
expect(score[1]).to.equal("200500");
expect(score[2]).to.equal("700500");
expect(score[3]).to.equal("3");
});
});

Expand Down

0 comments on commit fa9573f

Please sign in to comment.