Skip to content

Commit

Permalink
Merge pull request #439 from alephium/fix-circular-reference
Browse files Browse the repository at this point in the history
Fix the circular dependency in the generated code
  • Loading branch information
Lbqds authored Oct 28, 2024
2 parents 5c311c9 + 4dba3d1 commit 6942bac
Show file tree
Hide file tree
Showing 29 changed files with 74 additions and 96 deletions.
3 changes: 2 additions & 1 deletion artifacts/ts/Add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as AddContractJson } from "../add/Add.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -256,6 +256,7 @@ export const Add = new Factory(
AllStructs
)
);
registerContract(Add);

// Use this class to interact with the blockchain
export class AddInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/Assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as AssertContractJson } from "../test/Assert.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -121,6 +121,7 @@ export const Assert = new Factory(
AllStructs
)
);
registerContract(Assert);

// Use this class to interact with the blockchain
export class AssertInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/Debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DebugContractJson } from "../test/Debug.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -121,6 +121,7 @@ export const Debug = new Factory(
AllStructs
)
);
registerContract(Debug);

// Use this class to interact with the blockchain
export class DebugInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/DeprecatedNFTTest1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DeprecatedNFTTest1ContractJson } from "../nft/DeprecatedNFTTest1.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -132,6 +132,7 @@ export const DeprecatedNFTTest1 = new Factory(
AllStructs
)
);
registerContract(DeprecatedNFTTest1);

// Use this class to interact with the blockchain
export class DeprecatedNFTTest1Instance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/DeprecatedNFTTest2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DeprecatedNFTTest2ContractJson } from "../nft/DeprecatedNFTTest2.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -148,6 +148,7 @@ export const DeprecatedNFTTest2 = new Factory(
AllStructs
)
);
registerContract(DeprecatedNFTTest2);

// Use this class to interact with the blockchain
export class DeprecatedNFTTest2Instance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/DeprecatedNFTTest3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DeprecatedNFTTest3ContractJson } from "../nft/DeprecatedNFTTest3.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -148,6 +148,7 @@ export const DeprecatedNFTTest3 = new Factory(
AllStructs
)
);
registerContract(DeprecatedNFTTest3);

// Use this class to interact with the blockchain
export class DeprecatedNFTTest3Instance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/DeprecatedNFTTest4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DeprecatedNFTTest4ContractJson } from "../nft/DeprecatedNFTTest4.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -148,6 +148,7 @@ export const DeprecatedNFTTest4 = new Factory(
AllStructs
)
);
registerContract(DeprecatedNFTTest4);

// Use this class to interact with the blockchain
export class DeprecatedNFTTest4Instance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/DeprecatedNFTTest5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DeprecatedNFTTest5ContractJson } from "../nft/DeprecatedNFTTest5.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -153,6 +153,7 @@ export const DeprecatedNFTTest5 = new Factory(
AllStructs
)
);
registerContract(DeprecatedNFTTest5);

// Use this class to interact with the blockchain
export class DeprecatedNFTTest5Instance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/DeprecatedNFTTest6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DeprecatedNFTTest6ContractJson } from "../nft/DeprecatedNFTTest6.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -148,6 +148,7 @@ export const DeprecatedNFTTest6 = new Factory(
AllStructs
)
);
registerContract(DeprecatedNFTTest6);

// Use this class to interact with the blockchain
export class DeprecatedNFTTest6Instance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/DeprecatedNFTTest7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as DeprecatedNFTTest7ContractJson } from "../nft/DeprecatedNFTTest7.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -153,6 +153,7 @@ export const DeprecatedNFTTest7 = new Factory(
AllStructs
)
);
registerContract(DeprecatedNFTTest7);

// Use this class to interact with the blockchain
export class DeprecatedNFTTest7Instance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/FakeTokenTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as FakeTokenTestContractJson } from "../token/FakeTokenTest.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -195,6 +195,7 @@ export const FakeTokenTest = new Factory(
AllStructs
)
);
registerContract(FakeTokenTest);

// Use this class to interact with the blockchain
export class FakeTokenTestInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/Greeter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as GreeterContractJson } from "../greeter/Greeter.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -136,6 +136,7 @@ export const Greeter = new Factory(
AllStructs
)
);
registerContract(Greeter);

// Use this class to interact with the blockchain
export class GreeterInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/MapTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as MapTestContractJson } from "../test/MapTest.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -183,6 +183,7 @@ export const MapTest = new Factory(
AllStructs
)
);
registerContract(MapTest);

// Use this class to interact with the blockchain
export class MapTestInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/MapTestWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as MapTestWrapperContractJson } from "../test/MapTestWrapper.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -166,6 +166,7 @@ export const MapTestWrapper = new Factory(
AllStructs
)
);
registerContract(MapTestWrapper);

// Use this class to interact with the blockchain
export class MapTestWrapperInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/MetaData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as MetaDataContractJson } from "../test/MetaData.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -163,6 +163,7 @@ export const MetaData = new Factory(
AllStructs
)
);
registerContract(MetaData);

// Use this class to interact with the blockchain
export class MetaDataInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/NFTCollectionTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as NFTCollectionTestContractJson } from "../nft/NFTCollectionTest.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -205,6 +205,7 @@ export const NFTCollectionTest = new Factory(
AllStructs
)
);
registerContract(NFTCollectionTest);

// Use this class to interact with the blockchain
export class NFTCollectionTestInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/NFTCollectionWithRoyaltyTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as NFTCollectionWithRoyaltyTestContractJson } from "../nft/NFTCollectionWithRoyaltyTest.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -270,6 +270,7 @@ export const NFTCollectionWithRoyaltyTest = new Factory(
AllStructs
)
);
registerContract(NFTCollectionWithRoyaltyTest);

// Use this class to interact with the blockchain
export class NFTCollectionWithRoyaltyTestInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/NFTTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as NFTTestContractJson } from "../nft/NFTTest.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -151,6 +151,7 @@ export const NFTTest = new Factory(
AllStructs
)
);
registerContract(NFTTest);

// Use this class to interact with the blockchain
export class NFTTestInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/NFTTestStd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as NFTTestStdContractJson } from "../nft/NFTTestStd.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -170,6 +170,7 @@ export const NFTTestStd = new Factory(
AllStructs
)
);
registerContract(NFTTestStd);

// Use this class to interact with the blockchain
export class NFTTestStdInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/OwnerOnly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as OwnerOnlyContractJson } from "../test/OwnerOnly.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -131,6 +131,7 @@ export const OwnerOnly = new Factory(
AllStructs
)
);
registerContract(OwnerOnly);

// Use this class to interact with the blockchain
export class OwnerOnlyInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/Sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as SubContractJson } from "../sub/Sub.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -128,6 +128,7 @@ export const Sub = new Factory(
AllStructs
)
);
registerContract(Sub);

// Use this class to interact with the blockchain
export class SubInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/TokenTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as TokenTestContractJson } from "../token/TokenTest.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -182,6 +182,7 @@ export const TokenTest = new Factory(
AllStructs
)
);
registerContract(TokenTest);

// Use this class to interact with the blockchain
export class TokenTestInstance extends ContractInstance {
Expand Down
3 changes: 2 additions & 1 deletion artifacts/ts/TokenTestStd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
Narrow,
} from "@alephium/web3";
import { default as TokenTestStdContractJson } from "../token/TokenTestStd.ral.json";
import { getContractByCodeHash } from "./contracts";
import { getContractByCodeHash, registerContract } from "./contracts";
import {
AddStruct1,
AddStruct2,
Expand Down Expand Up @@ -198,6 +198,7 @@ export const TokenTestStd = new Factory(
AllStructs
)
);
registerContract(TokenTestStd);

// Use this class to interact with the blockchain
export class TokenTestStdInstance extends ContractInstance {
Expand Down
Loading

0 comments on commit 6942bac

Please sign in to comment.