The second case is working fine but the execution can't reach it because it exits when reaching the first case.
We cannot remove the first case because otherwise we could have different contracts stored for each storage services, we need a centralized check in storeMatch before continuing calling every enabled storage service.
So in storeMatch, instead of evaluating the combined match status, we can verify if either the runtime or creation match is better, and ensure that neither the runtime nor creation is worse than the previous match.
TODO
[ ] Add tests for updating contracts to better matches
Saving a new match with creationMatch better than the existing one doesn't work.
There are two places in which we check for already existing partial match:
In
storeMatch
insideStorageService.ts
https://github.com/ethereum/sourcify/blob/498821296528660df41eb7a4c7bbe83b15245491/services/server/src/server/services/StorageService.ts#L246-L258In
updateExistingVerifiedContract
insideAbstractDatabaseService.ts
https://github.com/ethereum/sourcify/blob/d7c3ac708ce8badc09c369edd3e74a0260379753/services/server/src/server/services/storageServices/AbstractDatabaseService.ts#L452-L481The second case is working fine but the execution can't reach it because it exits when reaching the first case.
We cannot remove the first case because otherwise we could have different contracts stored for each storage services, we need a centralized check in
storeMatch
before continuing calling every enabled storage service.So in
storeMatch
, instead of evaluating the combined match status, we can verify if either the runtime or creation match is better, and ensure that neither the runtime nor creation is worse than the previous match.TODO