From 8e459a03be77afa582566035d0a5006deb740b8a Mon Sep 17 00:00:00 2001 From: John Kane Date: Wed, 13 Sep 2023 22:15:34 +0100 Subject: [PATCH] feat: change id separators Modify our id separators, swapping: - `:` => `#` - `#` => `.` This allows us to write the identifiers as filenames on windows. Resolves #441. --- .../src/internal/utils/future-id-builders.ts | 6 +- packages/core/test/batcher.ts | 32 +++---- packages/core/test/call.ts | 30 +++---- packages/core/test/contract.ts | 30 +++---- packages/core/test/contractAt.ts | 12 +-- packages/core/test/contractAtFromArtifact.ts | 12 +-- packages/core/test/contractFromArtifact.ts | 22 ++--- packages/core/test/library.ts | 22 ++--- packages/core/test/libraryFromArtifact.ts | 18 ++-- packages/core/test/readEventArgument.ts | 8 +- .../futures/reconcileArtifactContractAt.ts | 16 ++-- .../reconcileArtifactContractDeployment.ts | 26 +++--- .../reconcileArtifactLibraryDeployment.ts | 18 ++-- .../futures/reconcileNamedContractAt.ts | 16 ++-- .../futures/reconcileNamedContractCall.ts | 36 ++++---- .../reconcileNamedContractDeployment.ts | 26 +++--- .../reconcileNamedLibraryDeployment.ts | 18 ++-- .../futures/reconcileNamedStaticCall.ts | 46 +++++----- .../futures/reconcileReadEventArgument.ts | 48 +++++------ .../futures/reconcileSendData.ts | 20 ++--- .../core/test/reconciliation/reconciler.ts | 86 +++++++++---------- packages/core/test/send.ts | 30 +++---- packages/core/test/staticCall.ts | 30 +++---- packages/core/test/useModule.ts | 2 +- .../core/test/utils/future-id-builders.ts | 14 +-- packages/hardhat-plugin/test/static-calls.ts | 4 +- packages/ui/test/to-mermaid.ts | 60 ++++++------- 27 files changed, 344 insertions(+), 344 deletions(-) diff --git a/packages/core/src/internal/utils/future-id-builders.ts b/packages/core/src/internal/utils/future-id-builders.ts index 408f74f98..fe64422ea 100644 --- a/packages/core/src/internal/utils/future-id-builders.ts +++ b/packages/core/src/internal/utils/future-id-builders.ts @@ -2,12 +2,12 @@ * The seperator in ids that indicated before as the module id and after * as the parts making up the particular future. */ -const MODULE_SEPERATOR = ":"; +const MODULE_SEPERATOR = "#"; /** * The seperator in ids that indicated different subparts of the future key. */ -const SUBKEY_SEPERATOR = "#"; +const SUBKEY_SEPERATOR = "."; /** * Construct the future id for a contract or library deployment, namespaced by the @@ -76,7 +76,7 @@ export function toReadEventArgumentFutureId( ) { const futureKey = userProvidedId ?? - `${contractName}#${eventName}${SUBKEY_SEPERATOR}${argumentName}${SUBKEY_SEPERATOR}${eventIndex}`; + `${contractName}${SUBKEY_SEPERATOR}${eventName}${SUBKEY_SEPERATOR}${argumentName}${SUBKEY_SEPERATOR}${eventIndex}`; return `${moduleId}${MODULE_SEPERATOR}${futureKey}`; } diff --git a/packages/core/test/batcher.ts b/packages/core/test/batcher.ts index 84f663415..ac449976b 100644 --- a/packages/core/test/batcher.ts +++ b/packages/core/test/batcher.ts @@ -35,7 +35,7 @@ describe("batcher", () => { return { contract1 }; }); - assertBatching({ ignitionModule }, [["Module1:Contract1"]]); + assertBatching({ ignitionModule }, [["Module1#Contract1"]]); }); it("should batch through dependencies", () => { @@ -57,9 +57,9 @@ describe("batcher", () => { }); assertBatching({ ignitionModule }, [ - ["Module1:Contract1", "Module1:Contract2"], - ["Module1:Contract3"], - ["Module1:Contract4", "Module1:Contract5"], + ["Module1#Contract1", "Module1#Contract2"], + ["Module1#Contract3"], + ["Module1#Contract4", "Module1#Contract5"], ]); }); @@ -98,15 +98,15 @@ describe("batcher", () => { }); assertBatching({ ignitionModule }, [ - ["SubmoduleLeft:Contract1", "SubmoduleRight:Contract2"], + ["SubmoduleLeft#Contract1", "SubmoduleRight#Contract2"], [ - "SubmoduleLeft:Contract1#configure", - "SubmoduleRight:Contract2#configure", + "SubmoduleLeft#Contract1.configure", + "SubmoduleRight#Contract2.configure", ], - ["SubmoduleMiddle:Contract3"], - ["SubmoduleMiddle:Contract3#configure"], - ["Module:Contract4"], - ["Module:Contract4#configure"], + ["SubmoduleMiddle#Contract3"], + ["SubmoduleMiddle#Contract3.configure"], + ["Module#Contract4"], + ["Module#Contract4.configure"], ]); }); @@ -141,8 +141,8 @@ describe("batcher", () => { }); assertBatching({ ignitionModule }, [ - ["Left:Contract1", "Middle:Contract3", "Right:Contract2"], - ["Module:Contract4"], + ["Left#Contract1", "Middle#Contract3", "Right#Contract2"], + ["Module#Contract4"], ]); }); @@ -162,15 +162,15 @@ describe("batcher", () => { deploymentState: { chainId: 123, executionStates: { - "Module1:Contract2": { + "Module1#Contract2": { ...exampleDeploymentState, - id: "Module1:Contract2", + id: "Module1#Contract2", status: ExecutionStatus.SUCCESS, }, }, }, }, - [["Module1:Contract1"], ["Module1:Contract3"]] + [["Module1#Contract1"], ["Module1#Contract3"]] ); }); }); diff --git a/packages/core/test/call.ts b/packages/core/test/call.ts index 88b35144a..aa5e6f522 100644 --- a/packages/core/test/call.ts +++ b/packages/core/test/call.ts @@ -29,7 +29,7 @@ describe("call", () => { assert.equal(moduleWithASingleContract.id, "Module1"); assert.equal( moduleWithASingleContract.results.contract1.id, - "Module1:Contract1" + "Module1#Contract1" ); // 1 contract future & 1 call future @@ -60,15 +60,15 @@ describe("call", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedContractCallFutureImplementation)) { @@ -93,15 +93,15 @@ describe("call", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedContractCallFutureImplementation)) { @@ -125,7 +125,7 @@ describe("call", () => { assert.isDefined(moduleWithDependentContracts); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedContractCallFutureImplementation)) { @@ -147,7 +147,7 @@ describe("call", () => { assert.isDefined(moduleWithDependentContracts); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedContractCallFutureImplementation)) { @@ -172,7 +172,7 @@ describe("call", () => { assert.isDefined(moduleWithDependentContracts); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedContractCallFutureImplementation)) { @@ -194,7 +194,7 @@ describe("call", () => { assert.isDefined(moduleWithDependentContracts); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedContractCallFutureImplementation)) { @@ -383,11 +383,11 @@ describe("call", () => { assert.equal(moduleWithSameCallTwice.id, "Module1"); const callFuture = [...moduleWithSameCallTwice.futures].find( - ({ id }) => id === "Module1:first" + ({ id }) => id === "Module1#first" ); const callFuture2 = [...moduleWithSameCallTwice.futures].find( - ({ id }) => id === "Module1:second" + ({ id }) => id === "Module1#second" ); assert.isDefined(callFuture); @@ -404,7 +404,7 @@ describe("call", () => { return { sameContract1 }; }), - /Duplicated id Module1:SameContract#test found in module Module1/ + /Duplicated id Module1#SameContract.test found in module Module1/ ); }); @@ -417,7 +417,7 @@ describe("call", () => { m.call(sameContract1, "test", [], { id: "first" }); return { sameContract1 }; }), - /Duplicated id Module1:first found in module Module1/ + /Duplicated id Module1#first found in module Module1/ ); }); }); diff --git a/packages/core/test/contract.ts b/packages/core/test/contract.ts index 8792fabfb..89a2f75c4 100644 --- a/packages/core/test/contract.ts +++ b/packages/core/test/contract.ts @@ -27,7 +27,7 @@ describe("contract", () => { assert.equal(moduleWithASingleContract.id, "Module1"); assert.equal( moduleWithASingleContract.results.contract1.id, - "Module1:Contract1" + "Module1#Contract1" ); // 1 contract future @@ -52,11 +52,11 @@ describe("contract", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -80,11 +80,11 @@ describe("contract", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -110,11 +110,11 @@ describe("contract", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -138,7 +138,7 @@ describe("contract", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -162,7 +162,7 @@ describe("contract", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -187,7 +187,7 @@ describe("contract", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -209,7 +209,7 @@ describe("contract", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -368,11 +368,11 @@ describe("contract", () => { assert.equal(moduleWithSameContractTwice.id, "Module1"); assert.equal( moduleWithSameContractTwice.results.sameContract1.id, - "Module1:first" + "Module1#first" ); assert.equal( moduleWithSameContractTwice.results.sameContract2.id, - "Module1:second" + "Module1#second" ); }); @@ -385,7 +385,7 @@ describe("contract", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:SameContract found in module Module1/ + /Duplicated id Module1#SameContract found in module Module1/ ); }); @@ -402,7 +402,7 @@ describe("contract", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:same found in module Module1/ + /Duplicated id Module1#same found in module Module1/ ); }); }); diff --git a/packages/core/test/contractAt.ts b/packages/core/test/contractAt.ts index 8ee77c7f0..8e33d0b63 100644 --- a/packages/core/test/contractAt.ts +++ b/packages/core/test/contractAt.ts @@ -29,7 +29,7 @@ describe("contractAt", () => { assert.equal(moduleWithContractFromArtifact.id, "Module1"); assert.equal( moduleWithContractFromArtifact.results.contract1.id, - "Module1:Contract1" + "Module1#Contract1" ); // Stores the address @@ -79,7 +79,7 @@ describe("contractAt", () => { const anotherFuture = moduleWithDependentContracts.results.another; const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#getAddress" + ({ id }) => id === "Module1#Example.getAddress" ); assert.equal(anotherFuture.dependencies.size, 1); @@ -139,11 +139,11 @@ describe("contractAt", () => { assert.equal(moduleWithSameContractTwice.id, "Module1"); assert.equal( moduleWithSameContractTwice.results.sameContract1.id, - "Module1:first" + "Module1#first" ); assert.equal( moduleWithSameContractTwice.results.sameContract2.id, - "Module1:second" + "Module1#second" ); }); @@ -156,7 +156,7 @@ describe("contractAt", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:SameContract found in module Module1/ + /Duplicated id Module1#SameContract found in module Module1/ ); }); @@ -183,7 +183,7 @@ describe("contractAt", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:same found in module Module1/ + /Duplicated id Module1#same found in module Module1/ ); }); }); diff --git a/packages/core/test/contractAtFromArtifact.ts b/packages/core/test/contractAtFromArtifact.ts index 71dad868a..156b68c53 100644 --- a/packages/core/test/contractAtFromArtifact.ts +++ b/packages/core/test/contractAtFromArtifact.ts @@ -33,7 +33,7 @@ describe("contractAtFromArtifact", () => { assert.equal(moduleWithContractFromArtifact.id, "Module1"); assert.equal( moduleWithContractFromArtifact.results.contract1.id, - "Module1:Contract1" + "Module1#Contract1" ); // Stores the address @@ -88,7 +88,7 @@ describe("contractAtFromArtifact", () => { const anotherFuture = moduleWithDependentContracts.results.another; const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#getAddress" + ({ id }) => id === "Module1#Example.getAddress" ); assert.equal(anotherFuture.dependencies.size, 1); @@ -156,11 +156,11 @@ describe("contractAtFromArtifact", () => { assert.equal(moduleWithSameContractTwice.id, "Module1"); assert.equal( moduleWithSameContractTwice.results.sameContract1.id, - "Module1:first" + "Module1#first" ); assert.equal( moduleWithSameContractTwice.results.sameContract2.id, - "Module1:second" + "Module1#second" ); }); @@ -181,7 +181,7 @@ describe("contractAtFromArtifact", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:SameContract found in module Module1/ + /Duplicated id Module1#SameContract found in module Module1/ ); }); @@ -208,7 +208,7 @@ describe("contractAtFromArtifact", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:same found in module Module1/ + /Duplicated id Module1#same found in module Module1/ ); }); }); diff --git a/packages/core/test/contractFromArtifact.ts b/packages/core/test/contractFromArtifact.ts index b392177e0..c7c7a2889 100644 --- a/packages/core/test/contractFromArtifact.ts +++ b/packages/core/test/contractFromArtifact.ts @@ -37,7 +37,7 @@ describe("contractFromArtifact", () => { assert.equal(moduleWithContractFromArtifact.id, "Module1"); assert.equal( moduleWithContractFromArtifact.results.contract1.id, - "Module1:Contract1" + "Module1#Contract1" ); // Stores the arguments @@ -104,11 +104,11 @@ describe("contractFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -134,7 +134,7 @@ describe("contractFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -158,7 +158,7 @@ describe("contractFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -185,7 +185,7 @@ describe("contractFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -209,7 +209,7 @@ describe("contractFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -400,11 +400,11 @@ describe("contractFromArtifact", () => { assert.equal(moduleWithSameContractTwice.id, "Module1"); assert.equal( moduleWithSameContractTwice.results.sameContract1.id, - "Module1:first" + "Module1#first" ); assert.equal( moduleWithSameContractTwice.results.sameContract2.id, - "Module1:second" + "Module1#second" ); }); @@ -423,7 +423,7 @@ describe("contractFromArtifact", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:SameContract found in module Module1/ + /Duplicated id Module1#SameContract found in module Module1/ ); }); @@ -450,7 +450,7 @@ describe("contractFromArtifact", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:same found in module Module1/ + /Duplicated id Module1#same found in module Module1/ ); }); }); diff --git a/packages/core/test/library.ts b/packages/core/test/library.ts index 6d103dce4..a19de6309 100644 --- a/packages/core/test/library.ts +++ b/packages/core/test/library.ts @@ -25,7 +25,7 @@ describe("library", () => { assert.equal(moduleWithASingleContract.id, "Module1"); assert.equal( moduleWithASingleContract.results.library1.id, - "Module1:Library1" + "Module1#Library1" ); // 1 contract future @@ -50,11 +50,11 @@ describe("library", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -80,11 +80,11 @@ describe("library", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -110,7 +110,7 @@ describe("library", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -134,7 +134,7 @@ describe("library", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -161,11 +161,11 @@ describe("library", () => { assert.equal(moduleWithSameContractTwice.id, "Module1"); assert.equal( moduleWithSameContractTwice.results.sameContract1.id, - "Module1:first" + "Module1#first" ); assert.equal( moduleWithSameContractTwice.results.sameContract2.id, - "Module1:second" + "Module1#second" ); }); @@ -178,7 +178,7 @@ describe("library", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:SameContract found in module Module1/ + /Duplicated id Module1#SameContract found in module Module1/ ); }); @@ -195,7 +195,7 @@ describe("library", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:same found in module Module1/ + /Duplicated id Module1#same found in module Module1/ ); }); }); diff --git a/packages/core/test/libraryFromArtifact.ts b/packages/core/test/libraryFromArtifact.ts index 594718869..5a1d2a377 100644 --- a/packages/core/test/libraryFromArtifact.ts +++ b/packages/core/test/libraryFromArtifact.ts @@ -32,7 +32,7 @@ describe("libraryFromArtifact", () => { assert.equal(moduleWithContractFromArtifact.id, "Module1"); assert.equal( moduleWithContractFromArtifact.results.library1.id, - "Module1:Library1" + "Module1#Library1" ); // 1 contract future @@ -74,11 +74,11 @@ describe("libraryFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -104,7 +104,7 @@ describe("libraryFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -128,7 +128,7 @@ describe("libraryFromArtifact", () => { assert.isDefined(moduleWithDependentContracts); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); if ( @@ -164,11 +164,11 @@ describe("libraryFromArtifact", () => { assert.equal(moduleWithSameContractTwice.id, "Module1"); assert.equal( moduleWithSameContractTwice.results.sameContract1.id, - "Module1:first" + "Module1#first" ); assert.equal( moduleWithSameContractTwice.results.sameContract2.id, - "Module1:second" + "Module1#second" ); }); @@ -187,7 +187,7 @@ describe("libraryFromArtifact", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:SameContract found in module Module1/ + /Duplicated id Module1#SameContract found in module Module1/ ); }); @@ -212,7 +212,7 @@ describe("libraryFromArtifact", () => { return { sameContract1, sameContract2 }; }), - /Duplicated id Module1:same found in module Module1/ + /Duplicated id Module1#same found in module Module1/ ); }); }); diff --git a/packages/core/test/readEventArgument.ts b/packages/core/test/readEventArgument.ts index 721722513..648308100 100644 --- a/packages/core/test/readEventArgument.ts +++ b/packages/core/test/readEventArgument.ts @@ -161,8 +161,8 @@ describe("Read event argument", () => { assert.equal(mod.id, "Module1"); const futuresIds = Array.from(mod.futures).map((f) => f.id); - assert.include(futuresIds, "Module1:Main#EventName#arg1#0"); - assert.include(futuresIds, "Module1:Emitter#EventName2#arg2#1"); + assert.include(futuresIds, "Module1#Main.EventName.arg1.0"); + assert.include(futuresIds, "Module1#Emitter.EventName2.arg2.1"); }); it("should be able to read the same argument twice by passing a explicit id", () => { @@ -185,8 +185,8 @@ describe("Read event argument", () => { moduleWithSameReadEventArgumentTwice.futures ).map((f) => f.id); - assert.include(futuresIds, "Module1:Example#EventName#arg1#0"); - assert.include(futuresIds, "Module1:second"); + assert.include(futuresIds, "Module1#Example.EventName.arg1.0"); + assert.include(futuresIds, "Module1#second"); }); }); diff --git a/packages/core/test/reconciliation/futures/reconcileArtifactContractAt.ts b/packages/core/test/reconciliation/futures/reconcileArtifactContractAt.ts index 2583a4e45..f69450540 100644 --- a/packages/core/test/reconciliation/futures/reconcileArtifactContractAt.ts +++ b/packages/core/test/reconciliation/futures/reconcileArtifactContractAt.ts @@ -85,7 +85,7 @@ describe("Reconciliation - artifact contract at", () => { const deploymentState = createDeploymentState({ ...exampleContractAtState, - id: `Submodule:Contract1`, + id: `Submodule#Contract1`, futureType: FutureType.ARTIFACT_CONTRACT_AT, status: ExecutionStatus.STARTED, contractAddress: exampleAddress, @@ -108,7 +108,7 @@ describe("Reconciliation - artifact contract at", () => { const deploymentState = createDeploymentState( { ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Example", @@ -119,7 +119,7 @@ describe("Reconciliation - artifact contract at", () => { }, { ...exampleStaticCallState, - id: "Module:Example#getAddress", + id: "Module#Example.getAddress", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.SUCCESS, functionName: "getAddress", @@ -130,7 +130,7 @@ describe("Reconciliation - artifact contract at", () => { }, { ...exampleContractAtState, - id: "Module:Another", + id: "Module#Another", futureType: FutureType.ARTIFACT_CONTRACT_AT, status: ExecutionStatus.STARTED, contractName: "Another", @@ -160,7 +160,7 @@ describe("Reconciliation - artifact contract at", () => { moduleDefinition, createDeploymentState({ ...exampleContractAtState, - id: "Module:Factory", + id: "Module#Factory", futureType: FutureType.ARTIFACT_CONTRACT_AT, status: ExecutionStatus.STARTED, contractName: "ContractUnchanged", @@ -171,7 +171,7 @@ describe("Reconciliation - artifact contract at", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Factory", + futureId: "Module#Factory", failure: "Contract name has been changed from ContractUnchanged to ContractChanged", }, @@ -196,7 +196,7 @@ describe("Reconciliation - artifact contract at", () => { moduleDefinition, createDeploymentState({ ...exampleContractAtState, - id: "Module:Factory", + id: "Module#Factory", futureType: FutureType.ARTIFACT_CONTRACT_AT, status: ExecutionStatus.STARTED, contractAddress: differentAddress, @@ -205,7 +205,7 @@ describe("Reconciliation - artifact contract at", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Factory", + futureId: "Module#Factory", failure: "Address has been changed from 0xBA12222222228d8Ba445958a75a0704d566BF2C8 to 0x1F98431c8aD98523631AE4a59f267346ea31F984", }, diff --git a/packages/core/test/reconciliation/futures/reconcileArtifactContractDeployment.ts b/packages/core/test/reconciliation/futures/reconcileArtifactContractDeployment.ts index 92694bab6..fe868d863 100644 --- a/packages/core/test/reconciliation/futures/reconcileArtifactContractDeployment.ts +++ b/packages/core/test/reconciliation/futures/reconcileArtifactContractDeployment.ts @@ -67,7 +67,7 @@ describe("Reconciliation - artifact contract", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Submodule:SafeMath", + id: "Submodule#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -78,7 +78,7 @@ describe("Reconciliation - artifact contract", () => { }, { ...exampleDeploymentState, - id: "Submodule:Contract1", + id: "Submodule#Contract1", futureType: FutureType.ARTIFACT_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, constructorArgs: [{ supply: BigInt(1000) }], @@ -106,7 +106,7 @@ describe("Reconciliation - artifact contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", futureType: FutureType.ARTIFACT_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "ContractUnchanged", @@ -115,7 +115,7 @@ describe("Reconciliation - artifact contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: "Contract name has been changed from ContractUnchanged to ContractChanged", }, @@ -141,7 +141,7 @@ describe("Reconciliation - artifact contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", futureType: FutureType.ARTIFACT_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, constructorArgs: [ @@ -154,7 +154,7 @@ describe("Reconciliation - artifact contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract1", + futureId: "Module#Contract1", failure: "Argument at index 2 has been changed", }, ]); @@ -178,7 +178,7 @@ describe("Reconciliation - artifact contract", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:SafeMath", + id: "Module#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -189,7 +189,7 @@ describe("Reconciliation - artifact contract", () => { }, { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", futureType: FutureType.ARTIFACT_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, libraries: {}, @@ -199,7 +199,7 @@ describe("Reconciliation - artifact contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract1", + futureId: "Module#Contract1", failure: "Library SafeMath has been added", }, ]); @@ -219,7 +219,7 @@ describe("Reconciliation - artifact contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", futureType: FutureType.ARTIFACT_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, value: BigInt(3), @@ -228,7 +228,7 @@ describe("Reconciliation - artifact contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: "Value has been changed from 3 to 4", }, ]); @@ -248,7 +248,7 @@ describe("Reconciliation - artifact contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", futureType: FutureType.ARTIFACT_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, from: oneAddress, @@ -257,7 +257,7 @@ describe("Reconciliation - artifact contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: `From account has been changed from ${oneAddress} to ${twoAddress}`, }, ]); diff --git a/packages/core/test/reconciliation/futures/reconcileArtifactLibraryDeployment.ts b/packages/core/test/reconciliation/futures/reconcileArtifactLibraryDeployment.ts index 80ca19c1a..4c22d6a3c 100644 --- a/packages/core/test/reconciliation/futures/reconcileArtifactLibraryDeployment.ts +++ b/packages/core/test/reconciliation/futures/reconcileArtifactLibraryDeployment.ts @@ -59,7 +59,7 @@ describe("Reconciliation - artifact library", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Submodule:SafeMath", + id: "Submodule#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -70,7 +70,7 @@ describe("Reconciliation - artifact library", () => { }, { ...exampleDeploymentState, - id: "Submodule:MainLibrary", + id: "Submodule#MainLibrary", futureType: FutureType.ARTIFACT_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "MainLibrary", @@ -95,7 +95,7 @@ describe("Reconciliation - artifact library", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", futureType: FutureType.ARTIFACT_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "LibraryUnchanged", @@ -104,7 +104,7 @@ describe("Reconciliation - artifact library", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: "Contract name has been changed from LibraryUnchanged to LibraryChanged", }, @@ -127,7 +127,7 @@ describe("Reconciliation - artifact library", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:SafeMath", + id: "Module#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -138,7 +138,7 @@ describe("Reconciliation - artifact library", () => { }, { ...exampleDeploymentState, - id: "Module:MainLibrary", + id: "Module#MainLibrary", futureType: FutureType.ARTIFACT_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "MainLibrary", @@ -151,7 +151,7 @@ describe("Reconciliation - artifact library", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:MainLibrary", + futureId: "Module#MainLibrary", failure: "Library Unchanged has been removed", }, ]); @@ -171,7 +171,7 @@ describe("Reconciliation - artifact library", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", futureType: FutureType.ARTIFACT_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "Library1", @@ -181,7 +181,7 @@ describe("Reconciliation - artifact library", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: `From account has been changed from ${oneAddress} to ${twoAddress}`, }, ]); diff --git a/packages/core/test/reconciliation/futures/reconcileNamedContractAt.ts b/packages/core/test/reconciliation/futures/reconcileNamedContractAt.ts index 21e01397e..71f61c77f 100644 --- a/packages/core/test/reconciliation/futures/reconcileNamedContractAt.ts +++ b/packages/core/test/reconciliation/futures/reconcileNamedContractAt.ts @@ -80,7 +80,7 @@ describe("Reconciliation - named contract at", () => { const deploymentState = createDeploymentState({ ...exampleContractAtState, - id: `Submodule:Contract1`, + id: `Submodule#Contract1`, futureType: FutureType.NAMED_CONTRACT_AT, status: ExecutionStatus.STARTED, contractAddress: exampleAddress, @@ -102,7 +102,7 @@ describe("Reconciliation - named contract at", () => { const previousExecutionState = createDeploymentState( { ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Example", @@ -113,7 +113,7 @@ describe("Reconciliation - named contract at", () => { }, { ...exampleStaticCallState, - id: "Module:Example#getAddress", + id: "Module#Example.getAddress", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.SUCCESS, functionName: "getAddress", @@ -124,7 +124,7 @@ describe("Reconciliation - named contract at", () => { }, { ...exampleContractAtState, - id: "Module:Another", + id: "Module#Another", futureType: FutureType.NAMED_CONTRACT_AT, status: ExecutionStatus.STARTED, contractAddress: differentAddress, @@ -148,7 +148,7 @@ describe("Reconciliation - named contract at", () => { moduleDefinition, createDeploymentState({ ...exampleContractAtState, - id: "Module:Factory", + id: "Module#Factory", futureType: FutureType.NAMED_CONTRACT_AT, status: ExecutionStatus.STARTED, contractName: "ContractUnchanged", @@ -158,7 +158,7 @@ describe("Reconciliation - named contract at", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Factory", + futureId: "Module#Factory", failure: "Contract name has been changed from ContractUnchanged to ContractChanged", }, @@ -178,7 +178,7 @@ describe("Reconciliation - named contract at", () => { moduleDefinition, createDeploymentState({ ...exampleContractAtState, - id: "Module:Factory", + id: "Module#Factory", futureType: FutureType.NAMED_CONTRACT_AT, status: ExecutionStatus.STARTED, contractAddress: differentAddress, @@ -187,7 +187,7 @@ describe("Reconciliation - named contract at", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Factory", + futureId: "Module#Factory", failure: "Address has been changed from 0xBA12222222228d8Ba445958a75a0704d566BF2C8 to 0x1F98431c8aD98523631AE4a59f267346ea31F984", }, diff --git a/packages/core/test/reconciliation/futures/reconcileNamedContractCall.ts b/packages/core/test/reconciliation/futures/reconcileNamedContractCall.ts index 76c55583c..a94313ecb 100644 --- a/packages/core/test/reconciliation/futures/reconcileNamedContractCall.ts +++ b/packages/core/test/reconciliation/futures/reconcileNamedContractCall.ts @@ -75,7 +75,7 @@ describe("Reconciliation - named contract call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Submodule:Contract1", + id: "Submodule#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -84,7 +84,7 @@ describe("Reconciliation - named contract call", () => { }, { ...exampleContractCallState, - id: "Submodule:Contract1#function1", + id: "Submodule#Contract1.function1", futureType: FutureType.NAMED_CONTRACT_CALL, status: ExecutionStatus.SUCCESS, functionName: "function1", @@ -108,7 +108,7 @@ describe("Reconciliation - named contract call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -117,7 +117,7 @@ describe("Reconciliation - named contract call", () => { }, { ...exampleContractCallState, - id: "Module:config", + id: "Module#config", futureType: FutureType.NAMED_CONTRACT_CALL, status: ExecutionStatus.STARTED, functionName: "function1", @@ -128,9 +128,9 @@ describe("Reconciliation - named contract call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:config", + futureId: "Module#config", failure: - "Contract address has been changed from 0x1F98431c8aD98523631AE4a59f267346ea31F984 to 0xBA12222222228d8Ba445958a75a0704d566BF2C8 (future Module:Contract1)", + "Contract address has been changed from 0x1F98431c8aD98523631AE4a59f267346ea31F984 to 0xBA12222222228d8Ba445958a75a0704d566BF2C8 (future Module#Contract1)", }, ]); }); @@ -149,7 +149,7 @@ describe("Reconciliation - named contract call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -158,7 +158,7 @@ describe("Reconciliation - named contract call", () => { }, { ...exampleContractCallState, - id: "Module:config", + id: "Module#config", futureType: FutureType.NAMED_CONTRACT_CALL, status: ExecutionStatus.STARTED, functionName: "functionUnchanged", @@ -168,7 +168,7 @@ describe("Reconciliation - named contract call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:config", + futureId: "Module#config", failure: "Function name has been changed from functionUnchanged to functionChanged", }, @@ -191,7 +191,7 @@ describe("Reconciliation - named contract call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -200,7 +200,7 @@ describe("Reconciliation - named contract call", () => { }, { ...exampleContractCallState, - id: "Module:Contract1#function1", + id: "Module#Contract1.function1", futureType: FutureType.NAMED_CONTRACT_CALL, status: ExecutionStatus.STARTED, functionName: "function1", @@ -211,7 +211,7 @@ describe("Reconciliation - named contract call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract1#function1", + futureId: "Module#Contract1.function1", failure: "Argument at index 0 has been changed", }, ]); @@ -231,7 +231,7 @@ describe("Reconciliation - named contract call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -240,7 +240,7 @@ describe("Reconciliation - named contract call", () => { }, { ...exampleContractCallState, - id: "Module:config", + id: "Module#config", futureType: FutureType.NAMED_CONTRACT_CALL, status: ExecutionStatus.STARTED, functionName: "function1", @@ -251,7 +251,7 @@ describe("Reconciliation - named contract call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:config", + futureId: "Module#config", failure: "Value has been changed from 2 to 3", }, ]); @@ -271,7 +271,7 @@ describe("Reconciliation - named contract call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -280,7 +280,7 @@ describe("Reconciliation - named contract call", () => { }, { ...exampleContractCallState, - id: "Module:config", + id: "Module#config", futureType: FutureType.NAMED_CONTRACT_CALL, status: ExecutionStatus.STARTED, functionName: "function1", @@ -291,7 +291,7 @@ describe("Reconciliation - named contract call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:config", + futureId: "Module#config", failure: `From account has been changed from ${oneAddress} to ${twoAddress}`, }, ]); diff --git a/packages/core/test/reconciliation/futures/reconcileNamedContractDeployment.ts b/packages/core/test/reconciliation/futures/reconcileNamedContractDeployment.ts index cee1491f4..1ee48ed8a 100644 --- a/packages/core/test/reconciliation/futures/reconcileNamedContractDeployment.ts +++ b/packages/core/test/reconciliation/futures/reconcileNamedContractDeployment.ts @@ -69,7 +69,7 @@ describe("Reconciliation - named contract", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Submodule:SafeMath", + id: "Submodule#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -80,7 +80,7 @@ describe("Reconciliation - named contract", () => { }, { ...exampleDeploymentState, - id: "Submodule:Contract1", + id: "Submodule#Contract1", status: ExecutionStatus.STARTED, constructorArgs: [ "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", @@ -109,7 +109,7 @@ describe("Reconciliation - named contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", status: ExecutionStatus.STARTED, contractName: "ContractUnchanged", }) @@ -117,7 +117,7 @@ describe("Reconciliation - named contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: "Contract name has been changed from ContractUnchanged to ContractChanged", }, @@ -145,7 +145,7 @@ describe("Reconciliation - named contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", status: ExecutionStatus.STARTED, contractName: "ContractUnchanged", constructorArgs: [1, 2, 3], @@ -154,7 +154,7 @@ describe("Reconciliation - named contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: "Contract name has been changed from ContractUnchanged to ContractChanged", }, @@ -179,7 +179,7 @@ describe("Reconciliation - named contract", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:SafeMath", + id: "Module#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -190,7 +190,7 @@ describe("Reconciliation - named contract", () => { }, { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.STARTED, libraries: {}, } @@ -199,7 +199,7 @@ describe("Reconciliation - named contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract1", + futureId: "Module#Contract1", failure: "Library SafeMath has been added", }, ]); @@ -219,7 +219,7 @@ describe("Reconciliation - named contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", status: ExecutionStatus.STARTED, contractName: "Contract", value: BigInt(2), @@ -228,7 +228,7 @@ describe("Reconciliation - named contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: "Value has been changed from 2 to 3", }, ]); @@ -248,7 +248,7 @@ describe("Reconciliation - named contract", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Example", + id: "Module#Example", status: ExecutionStatus.STARTED, contractName: "Contract", from: oneAddress, @@ -257,7 +257,7 @@ describe("Reconciliation - named contract", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Example", + futureId: "Module#Example", failure: `From account has been changed from ${oneAddress} to ${twoAddress}`, }, ]); diff --git a/packages/core/test/reconciliation/futures/reconcileNamedLibraryDeployment.ts b/packages/core/test/reconciliation/futures/reconcileNamedLibraryDeployment.ts index adaf13098..ae308d80f 100644 --- a/packages/core/test/reconciliation/futures/reconcileNamedLibraryDeployment.ts +++ b/packages/core/test/reconciliation/futures/reconcileNamedLibraryDeployment.ts @@ -59,7 +59,7 @@ describe("Reconciliation - named library", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Submodule:SafeMath", + id: "Submodule#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -70,7 +70,7 @@ describe("Reconciliation - named library", () => { }, { ...exampleDeploymentState, - id: "Submodule:MainLibrary", + id: "Submodule#MainLibrary", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "MainLibrary", @@ -93,7 +93,7 @@ describe("Reconciliation - named library", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Library", + id: "Module#Library", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "LibraryUnchanged", @@ -102,7 +102,7 @@ describe("Reconciliation - named library", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Library", + futureId: "Module#Library", failure: "Contract name has been changed from LibraryUnchanged to LibraryChanged", }, @@ -125,7 +125,7 @@ describe("Reconciliation - named library", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:SafeMath", + id: "Module#SafeMath", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "SafeMath", @@ -136,7 +136,7 @@ describe("Reconciliation - named library", () => { }, { ...exampleDeploymentState, - id: "Module:MainLibrary", + id: "Module#MainLibrary", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "MainLibrary", @@ -149,7 +149,7 @@ describe("Reconciliation - named library", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:MainLibrary", + futureId: "Module#MainLibrary", failure: "Library Unchanged has been removed", }, ]); @@ -166,7 +166,7 @@ describe("Reconciliation - named library", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Library", + id: "Module#Library", futureType: FutureType.NAMED_LIBRARY_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "Library", @@ -176,7 +176,7 @@ describe("Reconciliation - named library", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Library", + futureId: "Module#Library", failure: `From account has been changed from ${oneAddress} to ${twoAddress}`, }, ]); diff --git a/packages/core/test/reconciliation/futures/reconcileNamedStaticCall.ts b/packages/core/test/reconciliation/futures/reconcileNamedStaticCall.ts index 26002fdfc..ac194ca24 100644 --- a/packages/core/test/reconciliation/futures/reconcileNamedStaticCall.ts +++ b/packages/core/test/reconciliation/futures/reconcileNamedStaticCall.ts @@ -74,7 +74,7 @@ describe("Reconciliation - named static call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Submodule:Contract1", + id: "Submodule#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -83,7 +83,7 @@ describe("Reconciliation - named static call", () => { }, { ...exampleStaticCallState, - id: "Submodule:Contract1#function1", + id: "Submodule#Contract1.function1", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.SUCCESS, contractAddress: exampleAddress, @@ -108,7 +108,7 @@ describe("Reconciliation - named static call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -117,7 +117,7 @@ describe("Reconciliation - named static call", () => { }, { ...exampleStaticCallState, - id: "Module:config", + id: "Module#config", status: ExecutionStatus.STARTED, functionName: "function1", contractAddress: exampleAddress, @@ -127,9 +127,9 @@ describe("Reconciliation - named static call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:config", + futureId: "Module#config", failure: - "Contract address has been changed from 0x1F98431c8aD98523631AE4a59f267346ea31F984 to 0xBA12222222228d8Ba445958a75a0704d566BF2C8 (future Module:Contract1)", + "Contract address has been changed from 0x1F98431c8aD98523631AE4a59f267346ea31F984 to 0xBA12222222228d8Ba445958a75a0704d566BF2C8 (future Module#Contract1)", }, ]); }); @@ -148,7 +148,7 @@ describe("Reconciliation - named static call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -157,7 +157,7 @@ describe("Reconciliation - named static call", () => { }, { ...exampleStaticCallState, - id: "Module:config", + id: "Module#config", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.STARTED, contractAddress: exampleAddress, @@ -168,7 +168,7 @@ describe("Reconciliation - named static call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:config", + futureId: "Module#config", failure: "Function name has been changed from functionUnchanged to functionChanged", }, @@ -191,7 +191,7 @@ describe("Reconciliation - named static call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -200,7 +200,7 @@ describe("Reconciliation - named static call", () => { }, { ...exampleStaticCallState, - id: "Module:Contract1#function1", + id: "Module#Contract1.function1", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.STARTED, contractAddress: exampleAddress, @@ -212,7 +212,7 @@ describe("Reconciliation - named static call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract1#function1", + futureId: "Module#Contract1.function1", failure: "Argument at index 0 has been changed", }, ]); @@ -235,7 +235,7 @@ describe("Reconciliation - named static call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -244,7 +244,7 @@ describe("Reconciliation - named static call", () => { }, { ...exampleStaticCallState, - id: "Module:config", + id: "Module#config", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.STARTED, contractAddress: exampleAddress, @@ -256,7 +256,7 @@ describe("Reconciliation - named static call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:config", + futureId: "Module#config", failure: `From account has been changed from ${oneAddress} to ${twoAddress}`, }, ]); @@ -289,7 +289,7 @@ describe("Reconciliation - named static call", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -298,10 +298,10 @@ describe("Reconciliation - named static call", () => { }, { ...exampleStaticCallState, - id: "Module:first_call", + id: "Module#first_call", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.SUCCESS, - dependencies: new Set(["Module:Contract1"]), + dependencies: new Set(["Module#Contract1"]), contractAddress: exampleAddress, functionName: "function1", args: ["first"], @@ -312,10 +312,10 @@ describe("Reconciliation - named static call", () => { }, { ...exampleStaticCallState, - id: "Module:second_call", + id: "Module#second_call", futureType: FutureType.NAMED_STATIC_CALL, status: ExecutionStatus.SUCCESS, - dependencies: new Set(["Module:Contract1", "Module:first_call"]), + dependencies: new Set(["Module#Contract1", "Module#first_call"]), contractAddress: exampleAddress, functionName: "function1", args: ["second"], @@ -326,9 +326,9 @@ describe("Reconciliation - named static call", () => { }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", status: ExecutionStatus.STARTED, - dependencies: new Set(["Module:first_call", "Module:second_call"]), + dependencies: new Set(["Module#first_call", "Module#second_call"]), contractName: "Contract2", constructorArgs: ["first"], result: { @@ -341,7 +341,7 @@ describe("Reconciliation - named static call", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract2", + futureId: "Module#Contract2", failure: "Argument at index 0 has been changed", }, ]); diff --git a/packages/core/test/reconciliation/futures/reconcileReadEventArgument.ts b/packages/core/test/reconciliation/futures/reconcileReadEventArgument.ts index 472ff412b..e69f26ca1 100644 --- a/packages/core/test/reconciliation/futures/reconcileReadEventArgument.ts +++ b/packages/core/test/reconciliation/futures/reconcileReadEventArgument.ts @@ -74,7 +74,7 @@ describe("Reconciliation - read event argument", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Submodule:Contract", + id: "Submodule#Contract", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract", @@ -85,7 +85,7 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleReadArgState, - id: "Submodule:Contract#EventName1#arg1#0", + id: "Submodule#Contract.EventName1.arg1.0", status: ExecutionStatus.STARTED, eventName: "EventName1", argumentName: "arg1", @@ -110,7 +110,7 @@ describe("Reconciliation - read event argument", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract", + id: "Module#Contract", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract", @@ -121,7 +121,7 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleReadArgState, - id: "Module:ReadEvent", + id: "Module#ReadEvent", status: ExecutionStatus.STARTED, eventName: "eventUnchanged", } @@ -130,7 +130,7 @@ describe("Reconciliation - read event argument", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:ReadEvent", + futureId: "Module#ReadEvent", failure: "Event name has been changed from eventUnchanged to EventChanged", }, @@ -153,7 +153,7 @@ describe("Reconciliation - read event argument", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract", + id: "Module#Contract", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, result: { @@ -164,7 +164,7 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleReadArgState, - id: "Module:ReadEvent", + id: "Module#ReadEvent", status: ExecutionStatus.STARTED, argumentName: "argUnchanged", } @@ -173,7 +173,7 @@ describe("Reconciliation - read event argument", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:ReadEvent", + futureId: "Module#ReadEvent", failure: "Argument name has been changed from argUnchanged to argChanged", }, @@ -197,7 +197,7 @@ describe("Reconciliation - read event argument", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract", + id: "Module#Contract", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, result: { @@ -208,7 +208,7 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleReadArgState, - id: "Module:ReadEvent", + id: "Module#ReadEvent", status: ExecutionStatus.STARTED, eventIndex: 1, } @@ -217,7 +217,7 @@ describe("Reconciliation - read event argument", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:ReadEvent", + futureId: "Module#ReadEvent", failure: "Event index has been changed from 1 to 3", }, ]); @@ -241,7 +241,7 @@ describe("Reconciliation - read event argument", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract1", @@ -252,7 +252,7 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract2", @@ -263,7 +263,7 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleReadArgState, - id: "Module:ReadEvent", + id: "Module#ReadEvent", status: ExecutionStatus.STARTED, emitterAddress: exampleAddress, } @@ -272,9 +272,9 @@ describe("Reconciliation - read event argument", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:ReadEvent", + futureId: "Module#ReadEvent", failure: - "Emitter has been changed from 0x1F98431c8aD98523631AE4a59f267346ea31F984 to 0xBA12222222228d8Ba445958a75a0704d566BF2C8 (future Module:Contract2)", + "Emitter has been changed from 0x1F98431c8aD98523631AE4a59f267346ea31F984 to 0xBA12222222228d8Ba445958a75a0704d566BF2C8 (future Module#Contract2)", }, ]); }); @@ -306,7 +306,7 @@ describe("Reconciliation - read event argument", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", status: ExecutionStatus.SUCCESS, result: { type: ExecutionResultType.SUCCESS, @@ -315,9 +315,9 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleReadArgState, - id: "Module:ReadEvent1", + id: "Module#ReadEvent1", status: ExecutionStatus.SUCCESS, - dependencies: new Set(["Module:Contract1"]), + dependencies: new Set(["Module#Contract1"]), eventName: "event1", argumentName: "argument1", emitterAddress: exampleAddress, @@ -325,9 +325,9 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleReadArgState, - id: "Module:ReadEvent2", + id: "Module#ReadEvent2", status: ExecutionStatus.SUCCESS, - dependencies: new Set(["Module:Contract1"]), + dependencies: new Set(["Module#Contract1"]), eventName: "event2", argumentName: "argument2", emitterAddress: exampleAddress, @@ -335,9 +335,9 @@ describe("Reconciliation - read event argument", () => { }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", status: ExecutionStatus.STARTED, - dependencies: new Set(["Module:ReadEvent1", "Module:ReadEvent2"]), + dependencies: new Set(["Module#ReadEvent1", "Module#ReadEvent2"]), contractName: "Contract2", result: { type: ExecutionResultType.SUCCESS, @@ -350,7 +350,7 @@ describe("Reconciliation - read event argument", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract2", + futureId: "Module#Contract2", failure: "Argument at index 0 has been changed", }, ]); diff --git a/packages/core/test/reconciliation/futures/reconcileSendData.ts b/packages/core/test/reconciliation/futures/reconcileSendData.ts index 9f3d619a7..06dca8e5c 100644 --- a/packages/core/test/reconciliation/futures/reconcileSendData.ts +++ b/packages/core/test/reconciliation/futures/reconcileSendData.ts @@ -50,7 +50,7 @@ describe("Reconciliation - send data", () => { moduleDefinition, createDeploymentState({ ...exampleSendState, - id: "Submodule:test_send", + id: "Submodule#test_send", status: ExecutionStatus.STARTED, }) ); @@ -67,7 +67,7 @@ describe("Reconciliation - send data", () => { moduleDefinition, createDeploymentState({ ...exampleSendState, - id: "Module:test_send", + id: "Module#test_send", status: ExecutionStatus.STARTED, data: "0x", }) @@ -85,7 +85,7 @@ describe("Reconciliation - send data", () => { moduleDefinition, createDeploymentState({ ...exampleSendState, - id: "Module:test_send", + id: "Module#test_send", status: ExecutionStatus.STARTED, to: exampleAddress, }) @@ -93,7 +93,7 @@ describe("Reconciliation - send data", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:test_send", + futureId: "Module#test_send", failure: 'Address "to" has been changed from 0x1F98431c8aD98523631AE4a59f267346ea31F984 to 0xBA12222222228d8Ba445958a75a0704d566BF2C8', }, @@ -111,7 +111,7 @@ describe("Reconciliation - send data", () => { moduleDefinition, createDeploymentState({ ...exampleSendState, - id: "Module:test_send", + id: "Module#test_send", status: ExecutionStatus.STARTED, data: "unchanged_data", }) @@ -119,7 +119,7 @@ describe("Reconciliation - send data", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:test_send", + futureId: "Module#test_send", failure: "Data has been changed from unchanged_data to changed_data", }, ]); @@ -136,7 +136,7 @@ describe("Reconciliation - send data", () => { moduleDefinition, createDeploymentState({ ...exampleSendState, - id: "Module:test_send", + id: "Module#test_send", status: ExecutionStatus.STARTED, value: 2n, }) @@ -144,7 +144,7 @@ describe("Reconciliation - send data", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:test_send", + futureId: "Module#test_send", failure: "Value has been changed from 2 to 3", }, ]); @@ -163,7 +163,7 @@ describe("Reconciliation - send data", () => { moduleDefinition, createDeploymentState({ ...exampleSendState, - id: "Module:test_send", + id: "Module#test_send", status: ExecutionStatus.STARTED, from: exampleAddress, }) @@ -171,7 +171,7 @@ describe("Reconciliation - send data", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:test_send", + futureId: "Module#test_send", failure: `From account has been changed from ${exampleAddress} to ${differentAddress}`, }, ]); diff --git a/packages/core/test/reconciliation/reconciler.ts b/packages/core/test/reconciliation/reconciler.ts index 999db31e1..f1ac68c63 100644 --- a/packages/core/test/reconciliation/reconciler.ts +++ b/packages/core/test/reconciliation/reconciler.ts @@ -22,7 +22,7 @@ import { describe("Reconciliation", () => { const exampleDeploymentState: DeploymentExecutionState = { - id: "Module1:Contract1", + id: "Module1#Contract1", type: ExecutionSateType.DEPLOYMENT_EXECUTION_STATE, futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, strategy: "basic", @@ -90,14 +90,14 @@ describe("Reconciliation", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module1:ContractMissed", // This future is not in the module + id: "Module1#ContractMissed", // This future is not in the module status: ExecutionStatus.STARTED, }) ); assert.deepStrictEqual( reconiliationResult.missingExecutedFutures, - ["Module1:ContractMissed"], + ["Module1#ContractMissed"], "Expected one missing previous executed future" ); }); @@ -112,7 +112,7 @@ describe("Reconciliation", () => { const reconiliationResult = await reconcile(moduleDefinition, { chainId: 123, executionStates: { - "Module1:Example": { + "Module1#Example": { ...exampleDeploymentState, futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, @@ -122,9 +122,9 @@ describe("Reconciliation", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module1:Example", + futureId: "Module1#Example", failure: - "Future with id Module1:Example has changed from NAMED_CONTRACT_DEPLOYMENT to NAMED_LIBRARY_DEPLOYMENT", + "Future with id Module1#Example has changed from NAMED_CONTRACT_DEPLOYMENT to NAMED_LIBRARY_DEPLOYMENT", }, ]); }); @@ -139,7 +139,7 @@ describe("Reconciliation", () => { const reconiliationResult = await reconcile(moduleDefinition, { chainId: 123, executionStates: { - "Module1:Example": { + "Module1#Example": { ...exampleDeploymentState, status: ExecutionStatus.TIMEOUT, }, @@ -148,9 +148,9 @@ describe("Reconciliation", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module1:Contract1", + futureId: "Module1#Contract1", failure: - "The previous run of the future Module1:Contract1 timed out, and will need wiped before running again", + "The previous run of the future Module1#Contract1 timed out, and will need wiped before running again", }, ]); }); @@ -165,7 +165,7 @@ describe("Reconciliation", () => { const reconiliationResult = await reconcile(moduleDefinition, { chainId: 123, executionStates: { - "Module1:Example": { + "Module1#Example": { ...exampleDeploymentState, status: ExecutionStatus.FAILED, }, @@ -174,9 +174,9 @@ describe("Reconciliation", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module1:Contract1", + futureId: "Module1#Contract1", failure: - "The previous run of the future Module1:Contract1 failed, and will need wiped before running again", + "The previous run of the future Module1#Contract1 failed, and will need wiped before running again", }, ]); }); @@ -192,7 +192,7 @@ describe("Reconciliation", () => { const reconiliationResult = await reconcile(moduleDefinition, { chainId: 123, executionStates: { - "Module1:Contract1": { + "Module1#Contract1": { ...exampleDeploymentState, futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, @@ -225,7 +225,7 @@ describe("Reconciliation", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module1:Contract1", + futureId: "Module1#Contract1", failure: `From account has been changed from ${exampleAccounts[3]} to ${exampleAccounts[2]}`, }, ]); @@ -251,24 +251,24 @@ describe("Reconciliation", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract1", }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract2", }, { ...exampleDeploymentState, - id: "Module:Contract3", + id: "Module#Contract3", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, - dependencies: new Set(["Module:Contract2", "Module:Contract2"]), + dependencies: new Set(["Module#Contract2", "Module#Contract2"]), contractName: "Contract3", } ) @@ -291,24 +291,24 @@ describe("Reconciliation", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract1", }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract2", }, { ...exampleDeploymentState, - id: "Module:Contract3", + id: "Module#Contract3", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, - dependencies: new Set(["Module:Contract1", "Module:Contract2"]), + dependencies: new Set(["Module#Contract1", "Module#Contract2"]), contractName: "Contract3", } ) @@ -330,14 +330,14 @@ describe("Reconciliation", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, contractName: "Contract1", }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, contractName: "Contract2", @@ -362,14 +362,14 @@ describe("Reconciliation", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:Contract1", + id: "Module#Contract1", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, // Could still be in flight contractName: "Contract1", }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, dependencies: new Set(), // no deps on last run @@ -380,9 +380,9 @@ describe("Reconciliation", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract2", + futureId: "Module#Contract2", failure: - "A dependency from Module:Contract2 to Module:Contract1 has been added, and both futures had already started executing, so this change is incompatible", + "A dependency from Module#Contract2 to Module#Contract1 has been added, and both futures had already started executing, so this change is incompatible", }, ]); }); @@ -404,7 +404,7 @@ describe("Reconciliation", () => { createDeploymentState( { ...exampleDeploymentState, - id: "Module:ContractOriginal", + id: "Module#ContractOriginal", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.SUCCESS, dependencies: new Set(), // no deps on last run @@ -412,10 +412,10 @@ describe("Reconciliation", () => { }, { ...exampleDeploymentState, - id: "Module:Contract2", + id: "Module#Contract2", futureType: FutureType.NAMED_CONTRACT_DEPLOYMENT, status: ExecutionStatus.STARTED, - dependencies: new Set("Module:ContractOriginal"), // no deps on last run + dependencies: new Set("Module#ContractOriginal"), // no deps on last run contractName: "Contract2", constructorArgs: [exampleAddress], } @@ -424,9 +424,9 @@ describe("Reconciliation", () => { assert.deepStrictEqual(reconiliationResult.reconciliationFailures, [ { - futureId: "Module:Contract2", + futureId: "Module#Contract2", failure: - "A dependency from Module:Contract2 to Module:ContractNew has been added. The former has started executing before the latter started executing, so this change is incompatible.", + "A dependency from Module#Contract2 to Module#ContractNew has been added. The former has started executing before the latter started executing, so this change is incompatible.", }, ]); }); @@ -450,15 +450,15 @@ describe("Reconciliation", () => { }; const storedArtifactMap = { - "Module:Contract1": moduleArtifactMap.Contract1, + "Module#Contract1": moduleArtifactMap.Contract1, }; const reconciliationResult = await reconcile( moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Contract1", - artifactId: "Module:Contract1", + id: "Module#Contract1", + artifactId: "Module#Contract1", }), new ArtifactMapDeploymentLoader(storedArtifactMap), new ArtifactMapResolver(moduleArtifactMap) @@ -484,7 +484,7 @@ describe("Reconciliation", () => { }; const storedArtifactMap = { - "Module:Contract1": { + "Module#Contract1": { abi: [], bytecode: "0xbbbbbb", contractName: "Contract1", @@ -496,8 +496,8 @@ describe("Reconciliation", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Contract1", - artifactId: "Module:Contract1", + id: "Module#Contract1", + artifactId: "Module#Contract1", }), new ArtifactMapDeploymentLoader(storedArtifactMap), new ArtifactMapResolver(moduleArtifactMap) @@ -505,7 +505,7 @@ describe("Reconciliation", () => { assert.deepStrictEqual(reconciliationResult.reconciliationFailures, [ { - futureId: "Module:Contract1", + futureId: "Module#Contract1", failure: "Artifact bytecodes have been changed", }, ]); @@ -532,7 +532,7 @@ describe("Reconciliation", () => { }); const storedArtifactMap = { - "Module:Contract1": { + "Module#Contract1": { abi: [], bytecode: mainnetWethBytecode, contractName: "Contract1", @@ -553,8 +553,8 @@ describe("Reconciliation", () => { moduleDefinition, createDeploymentState({ ...exampleDeploymentState, - id: "Module:Contract1", - artifactId: "Module:Contract1", + id: "Module#Contract1", + artifactId: "Module#Contract1", }), new ArtifactMapDeploymentLoader(storedArtifactMap), new ArtifactMapResolver(moduleArtifactMap) diff --git a/packages/core/test/send.ts b/packages/core/test/send.ts index 59e9d6408..483b767ba 100644 --- a/packages/core/test/send.ts +++ b/packages/core/test/send.ts @@ -33,7 +33,7 @@ describe("send", () => { assert.equal(moduleWithASingleContract.submodules.size, 0); const sendFuture = [...moduleWithASingleContract.futures].find( - ({ id }) => id === "Module1:test_send" + ({ id }) => id === "Module1#test_send" ); if (!(sendFuture instanceof SendDataFutureImplementation)) { @@ -54,11 +54,11 @@ describe("send", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const sendFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:test_send" + ({ id }) => id === "Module1#test_send" ); if (!(sendFuture instanceof SendDataFutureImplementation)) { @@ -80,11 +80,11 @@ describe("send", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const sendFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:test_send" + ({ id }) => id === "Module1#test_send" ); if (!(sendFuture instanceof SendDataFutureImplementation)) { @@ -105,7 +105,7 @@ describe("send", () => { assert.isDefined(moduleWithDependentContracts); const sendFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:test_send" + ({ id }) => id === "Module1#test_send" ); if (!(sendFuture instanceof SendDataFutureImplementation)) { @@ -125,7 +125,7 @@ describe("send", () => { assert.isDefined(moduleWithDependentContracts); const sendFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:test_send" + ({ id }) => id === "Module1#test_send" ); if (!(sendFuture instanceof SendDataFutureImplementation)) { @@ -148,7 +148,7 @@ describe("send", () => { assert.isDefined(moduleWithDependentContracts); const sendFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:test_send" + ({ id }) => id === "Module1#test_send" ); if (!(sendFuture instanceof SendDataFutureImplementation)) { @@ -168,7 +168,7 @@ describe("send", () => { assert.isDefined(moduleWithDependentContracts); const sendFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:test_send" + ({ id }) => id === "Module1#test_send" ); if (!(sendFuture instanceof SendDataFutureImplementation)) { @@ -190,11 +190,11 @@ describe("send", () => { return {}; }); - const futureC = Array.from(module.futures).find((f) => f.id === "Module:C"); + const futureC = Array.from(module.futures).find((f) => f.id === "Module#C"); assertInstanceOf(futureC, SendDataFutureImplementation); const futureC2 = Array.from(module.futures).find( - (f) => f.id === "Module:C2" + (f) => f.id === "Module#C2" ); assertInstanceOf(futureC2, SendDataFutureImplementation); @@ -219,11 +219,11 @@ describe("send", () => { assert.equal(moduleWithSameCallTwice.id, "Module1"); const sendFuture = [...moduleWithSameCallTwice.futures].find( - ({ id }) => id === "Module1:first" + ({ id }) => id === "Module1#first" ); const sendFuture2 = [...moduleWithSameCallTwice.futures].find( - ({ id }) => id === "Module1:second" + ({ id }) => id === "Module1#second" ); assert.isDefined(sendFuture); @@ -239,7 +239,7 @@ describe("send", () => { return {}; }), - /Duplicated id Module1:test_send found in module Module1/ + /Duplicated id Module1#test_send found in module Module1/ ); }); @@ -251,7 +251,7 @@ describe("send", () => { m.send("first", "0xtest", 0n, "test"); return {}; }), - /Duplicated id Module1:first found in module Module1/ + /Duplicated id Module1#first found in module Module1/ ); }); }); diff --git a/packages/core/test/staticCall.ts b/packages/core/test/staticCall.ts index bd291969d..6fa3dcc19 100644 --- a/packages/core/test/staticCall.ts +++ b/packages/core/test/staticCall.ts @@ -30,7 +30,7 @@ describe("static call", () => { assert.equal(moduleWithASingleContract.id, "Module1"); assert.equal( moduleWithASingleContract.results.contract1.id, - "Module1:Contract1" + "Module1#Contract1" ); // 1 contract future & 1 call future @@ -61,15 +61,15 @@ describe("static call", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedStaticCallFutureImplementation)) { @@ -94,15 +94,15 @@ describe("static call", () => { assert.isDefined(moduleWithDependentContracts); const exampleFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example" + ({ id }) => id === "Module1#Example" ); const anotherFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Another" + ({ id }) => id === "Module1#Another" ); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedStaticCallFutureImplementation)) { @@ -128,11 +128,11 @@ describe("static call", () => { assert.isDefined(moduleWithASingleContract); const staticCallFuture = [...moduleWithASingleContract.futures].find( - ({ id }) => id === "Module1:Contract1#test" + ({ id }) => id === "Module1#Contract1.test" ); const callFuture = [...moduleWithASingleContract.futures].find( - ({ id }) => id === "Module1:Contract1#test2" + ({ id }) => id === "Module1#Contract1.test2" ); if (!(callFuture instanceof NamedContractCallFutureImplementation)) { @@ -155,7 +155,7 @@ describe("static call", () => { assert.isDefined(moduleWithDependentContracts); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedStaticCallFutureImplementation)) { @@ -177,7 +177,7 @@ describe("static call", () => { assert.isDefined(moduleWithDependentContracts); const callFuture = [...moduleWithDependentContracts.futures].find( - ({ id }) => id === "Module1:Example#test" + ({ id }) => id === "Module1#Example.test" ); if (!(callFuture instanceof NamedStaticCallFutureImplementation)) { @@ -366,11 +366,11 @@ describe("static call", () => { assert.equal(moduleWithSameCallTwice.id, "Module1"); const callFuture = [...moduleWithSameCallTwice.futures].find( - ({ id }) => id === "Module1:first" + ({ id }) => id === "Module1#first" ); const callFuture2 = [...moduleWithSameCallTwice.futures].find( - ({ id }) => id === "Module1:second" + ({ id }) => id === "Module1#second" ); assert.isDefined(callFuture); @@ -387,7 +387,7 @@ describe("static call", () => { return { sameContract1 }; }), - /Duplicated id Module1:SameContract#test found in module Module1/ + /Duplicated id Module1#SameContract.test found in module Module1/ ); }); @@ -400,7 +400,7 @@ describe("static call", () => { m.staticCall(sameContract1, "test", [], { id: "first" }); return { sameContract1 }; }), - /Duplicated id Module1:first found in module Module1/ + /Duplicated id Module1#first found in module Module1/ ); }); }); diff --git a/packages/core/test/useModule.ts b/packages/core/test/useModule.ts index 960404710..5b57757f0 100644 --- a/packages/core/test/useModule.ts +++ b/packages/core/test/useModule.ts @@ -211,7 +211,7 @@ describe("useModule", () => { assert.deepStrictEqual(result, { type: DeploymentResultType.VALIDATION_ERROR, errors: { - "Submodule1:Contract1": [ + "Submodule1#Contract1": [ "Module parameter 'param1' requires a value but was given none", ], }, diff --git a/packages/core/test/utils/future-id-builders.ts b/packages/core/test/utils/future-id-builders.ts index c0ee09dbe..bcabdac92 100644 --- a/packages/core/test/utils/future-id-builders.ts +++ b/packages/core/test/utils/future-id-builders.ts @@ -12,14 +12,14 @@ describe("future id rules", () => { it("the fallback id should be built based on the contract or library name", () => { assert.equal( toDeploymentFutureId("MyModule", undefined, "MyContract"), - "MyModule:MyContract" + "MyModule#MyContract" ); }); it("namespaces to the module a user provided id", () => { assert.equal( toDeploymentFutureId("MyModule", "MyId", "MyContract"), - "MyModule:MyId" + "MyModule#MyId" ); }); }); @@ -28,14 +28,14 @@ describe("future id rules", () => { it("the fallback id should be built based on the contractName and function name", () => { assert.equal( toCallFutureId("MyModule", undefined, "MyContract", "MyFunction"), - "MyModule:MyContract#MyFunction" + "MyModule#MyContract.MyFunction" ); }); it("namespaces the user provided id to the module", () => { assert.equal( toCallFutureId("MyModule", "MyId", "MyContract", "MyFunction"), - "MyModule:MyId" + "MyModule#MyId" ); }); }); @@ -51,7 +51,7 @@ describe("future id rules", () => { "MyArg", 2 ), - "MyModule:MyContract#MyFunction#MyArg#2" + "MyModule#MyContract.MyFunction.MyArg.2" ); }); @@ -65,14 +65,14 @@ describe("future id rules", () => { "MyArg", 2 ), - "MyModule:MyId" + "MyModule#MyId" ); }); }); describe("send data ids", () => { it("namespaces the user provided id to the module", () => { - assert.equal(toSendDataFutureId("MyModule", "MyId"), "MyModule:MyId"); + assert.equal(toSendDataFutureId("MyModule", "MyId"), "MyModule#MyId"); }); }); }); diff --git a/packages/hardhat-plugin/test/static-calls.ts b/packages/hardhat-plugin/test/static-calls.ts index 92c40b335..f092b5141 100644 --- a/packages/hardhat-plugin/test/static-calls.ts +++ b/packages/hardhat-plugin/test/static-calls.ts @@ -120,7 +120,7 @@ describe("static calls", () => { await assert.isRejected( this.deploy(moduleDefinition), - /Future 'FooModule:FooFactory#nonAddressResult' must be a valid address/ + /Future 'FooModule#FooFactory.nonAddressResult' must be a valid address/ ); }); @@ -145,7 +145,7 @@ describe("static calls", () => { await assert.isRejected( this.deploy(moduleDefinition), - /Future 'FooModule:FooFactory#nonAddressResult' must be a valid address/ + /Future 'FooModule#FooFactory.nonAddressResult' must be a valid address/ ); }); }); diff --git a/packages/ui/test/to-mermaid.ts b/packages/ui/test/to-mermaid.ts index 33adbbb6f..4b56787b9 100644 --- a/packages/ui/test/to-mermaid.ts +++ b/packages/ui/test/to-mermaid.ts @@ -19,7 +19,7 @@ describe("to-mermaid", () => { subgraph Module direction BT - Module:Contract1["Deploy Contract1"] + Module#Contract1["Deploy Contract1"] end classDef startModule stroke-width:4px`; @@ -43,7 +43,7 @@ describe("to-mermaid", () => { subgraph Test_registrar direction BT - Test_registrar:Contract1["Deploy Contract1"] + Test_registrar#Contract1["Deploy Contract1"] end classDef startModule stroke-width:4px`; @@ -83,21 +83,21 @@ describe("to-mermaid", () => { subgraph Module direction BT - Module:Contract3["Deploy Contract3"] + Module#Contract3["Deploy Contract3"] end subgraph Submodule1 direction BT - Submodule1:Contract1["Deploy Contract1"] + Submodule1#Contract1["Deploy Contract1"] end subgraph Submodule2 direction BT - Submodule2:Contract2["Deploy Contract2"] + Submodule2#Contract2["Deploy Contract2"] end - Module:Contract3 --> Submodule1:Contract1 - Module:Contract3 --> Submodule2:Contract2 + Module#Contract3 --> Submodule1#Contract1 + Module#Contract3 --> Submodule2#Contract2 Module -.-> Submodule1 Module -.-> Submodule2 @@ -171,26 +171,26 @@ describe("to-mermaid", () => { subgraph Module direction BT - Module:BasicContract["Deploy BasicContract"] - Module:BasicLibrary["Deploy library BasicLibrary"] - Module:BasicLibrary2["Deploy library from artifact BasicLibrary"] - Module:ContractWithLibrary["Deploy from artifact ContractWithLibrary"] - Module:BasicContract#basicFunction["Call BasicContract/basicFunction"] - Module:BasicContract#BasicEvent#eventArg#0["Read event from future Module:BasicContract#basicFunction (event BasicEvent argument eventArg)"] - Module:ContractWithLibrary#readonlyFunction["Static call ContractWithLibrary/readonlyFunction"] - Module:BasicContract2["Existing contract BasicContract (Module:BasicContract)"] - Module:ContractWithLibrary2["Existing contract from artifact ContractWithLibrary (Module:ContractWithLibrary)"] - Module:test_send["Send data to Module:BasicContract2"] + Module#BasicContract["Deploy BasicContract"] + Module#BasicLibrary["Deploy library BasicLibrary"] + Module#BasicLibrary2["Deploy library from artifact BasicLibrary"] + Module#ContractWithLibrary["Deploy from artifact ContractWithLibrary"] + Module#BasicContract.basicFunction["Call BasicContract/basicFunction"] + Module#BasicContract.BasicEvent.eventArg.0["Read event from future Module#BasicContract.basicFunction (event BasicEvent argument eventArg)"] + Module#ContractWithLibrary.readonlyFunction["Static call ContractWithLibrary/readonlyFunction"] + Module#BasicContract2["Existing contract BasicContract (Module#BasicContract)"] + Module#ContractWithLibrary2["Existing contract from artifact ContractWithLibrary (Module#ContractWithLibrary)"] + Module#test_send["Send data to Module#BasicContract2"] end - Module:ContractWithLibrary --> Module:BasicLibrary - Module:BasicContract#basicFunction --> Module:BasicContract - Module:BasicContract#BasicEvent#eventArg#0 --> Module:BasicContract#basicFunction - Module:ContractWithLibrary#readonlyFunction --> Module:ContractWithLibrary - Module:ContractWithLibrary#readonlyFunction --> Module:BasicContract#BasicEvent#eventArg#0 - Module:BasicContract2 --> Module:BasicContract - Module:ContractWithLibrary2 --> Module:ContractWithLibrary - Module:test_send --> Module:BasicContract2 + Module#ContractWithLibrary --> Module#BasicLibrary + Module#BasicContract.basicFunction --> Module#BasicContract + Module#BasicContract.BasicEvent.eventArg.0 --> Module#BasicContract.basicFunction + Module#ContractWithLibrary.readonlyFunction --> Module#ContractWithLibrary + Module#ContractWithLibrary.readonlyFunction --> Module#BasicContract.BasicEvent.eventArg.0 + Module#BasicContract2 --> Module#BasicContract + Module#ContractWithLibrary2 --> Module#ContractWithLibrary + Module#test_send --> Module#BasicContract2 classDef startModule stroke-width:4px`; @@ -215,13 +215,13 @@ describe("to-mermaid", () => { subgraph Module direction BT - Module:ens["Deploy ens"] - Module:ens#setAddr_bytes32_address_["Call ens/setAddr(bytes32,address)"] - Module:ens#getAddr_bytes32_address_["Static call ens/getAddr(bytes32,address)"] + Module#ens["Deploy ens"] + Module#ens.setAddr_bytes32_address_["Call ens/setAddr(bytes32,address)"] + Module#ens.getAddr_bytes32_address_["Static call ens/getAddr(bytes32,address)"] end - Module:ens#setAddr_bytes32_address_ --> Module:ens - Module:ens#getAddr_bytes32_address_ --> Module:ens + Module#ens.setAddr_bytes32_address_ --> Module#ens + Module#ens.getAddr_bytes32_address_ --> Module#ens classDef startModule stroke-width:4px`;