Skip to content

Commit

Permalink
Merge pull request #187 from ArtBlocks/additional-testnet-bug-fixes
Browse files Browse the repository at this point in the history
Additional testnet bug fixes
  • Loading branch information
ryley-o authored Feb 1, 2023
2 parents 079e5df + fc34d92 commit b9db904
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 19 deletions.
7 changes: 7 additions & 0 deletions config/goerli-staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
"startBlock": 7723578
}
],
"genArt721CoreContracts": [
{
"address": "0xDa62f67BE7194775A75BE91CBF9FEeDcC5776D4b",
"name": "Artist Staging Goerli Flagship Core V1 Contract",
"startBlock": 7011002
}
],
"pbabContracts": [
{
"address": "0x5503a3B96D845f33F135429AB18C03C79477B14f",
Expand Down
33 changes: 18 additions & 15 deletions src/mapping-v3-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,21 +696,24 @@ function _handleMinterUpdated<T>(contract: T, event: MinterUpdated): void {
// this should never happen
return;
}
if (contract instanceof GenArt721CoreV3_Engine) {
// For Engine contracts, only index minter filters that are in the config
// and actively being indexed
let minterFilter = MinterFilter.load(
event.params._currentMinter.toHexString()
);
if (!minterFilter) {
// minter filter is not in config, set minterFilter to null
contractEntity.minterFilter = null;
contractEntity.save();
// refresh contract to update mintWhitelisted
refreshContract(contract, event.block.timestamp);
return;
}
}
// @dev this logic is temporarily disabled until we can determine the best way
// to handle determining if we should index an Engine contract's minter
// suite. For now, we will index all minter filters on Engine contracts.
// if (contract instanceof GenArt721CoreV3_Engine) {
// // For Engine contracts, only index minter filters that are in the config
// // and actively being indexed
// let minterFilter = MinterFilter.load(
// event.params._currentMinter.toHexString()
// );
// if (!minterFilter) {
// // minter filter is not in config, set minterFilter to null
// contractEntity.minterFilter = null;
// contractEntity.save();
// // refresh contract to update mintWhitelisted
// refreshContract(contract, event.block.timestamp);
// return;
// }
// }

// Clear the minter config for all projects on core contract when a new
// minter filter is set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,18 @@ test(`${coreType}/MinterUpdated: should list invalid MinterFilter with different
"updatedAt",
updateCallBlockTimestamp.toString()
);
// minter filter should NOT be added to store for engine contracts
assert.notInStore(
// patch: minter filter should be added for all engine contracts, temporarily
assert.fieldEquals(
MINTER_FILTER_ENTITY_TYPE,
TEST_MINTER_FILTER_ADDRESS.toHexString(),
"id",
TEST_MINTER_FILTER_ADDRESS.toHexString()
);
// // minter filter should NOT be added to store for engine contracts
// assert.notInStore(
// MINTER_FILTER_ENTITY_TYPE,
// TEST_MINTER_FILTER_ADDRESS.toHexString()
// );
});

test(`${coreType}/MinterUpdated: should create Contract but NOT MinterFilter entities when not yet created, and NOT assign minterFilter`, () => {
Expand Down Expand Up @@ -171,12 +178,19 @@ test(`${coreType}/MinterUpdated: should create Contract but NOT MinterFilter ent
// handle event
handleMinterUpdated(event);
// assertions
// patch: minter filter should be added for all engine contracts, temporarily
assert.fieldEquals(
CONTRACT_ENTITY_TYPE,
TEST_CONTRACT_ADDRESS.toHexString(),
"minterFilter",
"null"
TEST_MINTER_FILTER_ADDRESS.toHexString()
);
// assert.fieldEquals(
// CONTRACT_ENTITY_TYPE,
// TEST_CONTRACT_ADDRESS.toHexString(),
// "minterFilter",
// "null"
// );
assert.fieldEquals(
CONTRACT_ENTITY_TYPE,
TEST_CONTRACT_ADDRESS.toHexString(),
Expand All @@ -189,10 +203,17 @@ test(`${coreType}/MinterUpdated: should create Contract but NOT MinterFilter ent
"updatedAt",
updateCallBlockTimestamp.toString()
);
assert.notInStore(
// patch: minter filter should be added for all engine contracts, temporarily
assert.fieldEquals(
MINTER_FILTER_ENTITY_TYPE,
TEST_MINTER_FILTER_ADDRESS.toHexString(),
"id",
TEST_MINTER_FILTER_ADDRESS.toHexString()
);
// assert.notInStore(
// MINTER_FILTER_ENTITY_TYPE,
// TEST_MINTER_FILTER_ADDRESS.toHexString()
// );
});

test(`${coreType}/MinterUpdated: should populate project minter configurations for all projects preconfigured on existing minter filter`, () => {
Expand Down

0 comments on commit b9db904

Please sign in to comment.