From fa9573f289815b9c4913325b42adff38ee757c68 Mon Sep 17 00:00:00 2001 From: schultztimothy Date: Tue, 28 Nov 2023 17:57:05 -0700 Subject: [PATCH] chore: remove scorerId --- contracts/GitcoinResolver.sol | 5 ++--- contracts/IGitcoinResolver.sol | 3 +-- contracts/mocks/GitcoinResolverUpdate.sol | 5 ++--- docs/00-onchain-data.md | 1 - test/GitcoinResolver.ts | 3 --- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/contracts/GitcoinResolver.sol b/contracts/GitcoinResolver.sol index 155fda3..b5e41c3 100644 --- a/contracts/GitcoinResolver.sol +++ b/contracts/GitcoinResolver.sol @@ -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) ); @@ -170,8 +170,7 @@ contract GitcoinResolver is scores[attestation.recipient] = CachedScore( uint32(score), attestation.time, - attestation.expirationTime, - scorerId + attestation.expirationTime ); } diff --git a/contracts/IGitcoinResolver.sol b/contracts/IGitcoinResolver.sol index 6cdb5d8..614051e 100644 --- a/contracts/IGitcoinResolver.sol +++ b/contracts/IGitcoinResolver.sol @@ -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 } /** @@ -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. */ diff --git a/contracts/mocks/GitcoinResolverUpdate.sol b/contracts/mocks/GitcoinResolverUpdate.sol index 1a3318a..5d77e53 100644 --- a/contracts/mocks/GitcoinResolverUpdate.sol +++ b/contracts/mocks/GitcoinResolverUpdate.sol @@ -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) ); @@ -150,8 +150,7 @@ contract GitcoinResolverUpdate is scores[attestation.recipient] = CachedScore( uint32(score), attestation.time, - attestation.expirationTime, - scorerId + attestation.expirationTime ); } diff --git a/docs/00-onchain-data.md b/docs/00-onchain-data.md index 378be9d..3a76014 100644 --- a/docs/00-onchain-data.md +++ b/docs/00-onchain-data.md @@ -212,7 +212,6 @@ struct CachedScore { uint32 score; uint64 issuanceDate; uint64 expirationDate; - uint32 scorerId; } ``` diff --git a/test/GitcoinResolver.ts b/test/GitcoinResolver.ts index cad641e..bf96bbc 100644 --- a/test/GitcoinResolver.ts +++ b/test/GitcoinResolver.ts @@ -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 () { @@ -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 () { @@ -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"); }); });