Skip to content

Commit 3eaa02d

Browse files
committed
Fix the circular dependency in the generated code
1 parent 5c311c9 commit 3eaa02d

29 files changed

+398
-348
lines changed

artifacts/ts/Add.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as AddContractJson } from "../add/Add.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import { AddContractArtifact, getContractByCodeHash } from "./contracts";
3837
import {
3938
AddStruct1,
4039
AddStruct2,
@@ -248,14 +247,7 @@ class Factory extends ContractFactory<AddInstance, AddTypes.Fields> {
248247
}
249248

250249
// Use this object to test and deploy the contract
251-
export const Add = new Factory(
252-
Contract.fromJson(
253-
AddContractJson,
254-
"=12-2+5c=2-2+81=3-1+e=2-2+bc=83-1+97e010a61646450726976617465=266",
255-
"c46db1ae7bae8b332c115869126eb1402bc71574925608a2adcea3cf7b9f8e7e",
256-
AllStructs
257-
)
258-
);
250+
export const Add = new Factory(AddContractArtifact);
259251

260252
// Use this class to interact with the blockchain
261253
export class AddInstance extends ContractInstance {

artifacts/ts/Assert.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as AssertContractJson } from "../test/Assert.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import { AssertContractArtifact, getContractByCodeHash } from "./contracts";
3837
import {
3938
AddStruct1,
4039
AddStruct2,
@@ -113,14 +112,7 @@ class Factory extends ContractFactory<AssertInstance, {}> {
113112
}
114113

115114
// Use this object to test and deploy the contract
116-
export const Assert = new Factory(
117-
Contract.fromJson(
118-
AssertContractJson,
119-
"",
120-
"46dc5e3835be6551dacbf81565912ec67575aa77522312ceed88472817735d6b",
121-
AllStructs
122-
)
123-
);
115+
export const Assert = new Factory(AssertContractArtifact);
124116

125117
// Use this class to interact with the blockchain
126118
export class AssertInstance extends ContractInstance {

artifacts/ts/Debug.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DebugContractJson } from "../test/Debug.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import { DebugContractArtifact, getContractByCodeHash } from "./contracts";
3837
import {
3938
AddStruct1,
4039
AddStruct2,
@@ -113,14 +112,7 @@ class Factory extends ContractFactory<DebugInstance, {}> {
113112
}
114113

115114
// Use this object to test and deploy the contract
116-
export const Debug = new Factory(
117-
Contract.fromJson(
118-
DebugContractJson,
119-
"=4-2+18=11-1+3=10+ca7e020748656c6c6f2c200121",
120-
"eb4209d8f543d9f623d72578f7ed9b271d62cf396dcce42d10f5e68dba3cecd3",
121-
AllStructs
122-
)
123-
);
115+
export const Debug = new Factory(DebugContractArtifact);
124116

125117
// Use this class to interact with the blockchain
126118
export class DebugInstance extends ContractInstance {

artifacts/ts/DeprecatedNFTTest1.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DeprecatedNFTTest1ContractJson } from "../nft/DeprecatedNFTTest1.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import {
37+
DeprecatedNFTTest1ContractArtifact,
38+
getContractByCodeHash,
39+
} from "./contracts";
3840
import {
3941
AddStruct1,
4042
AddStruct2,
@@ -125,12 +127,7 @@ class Factory extends ContractFactory<
125127

126128
// Use this object to test and deploy the contract
127129
export const DeprecatedNFTTest1 = new Factory(
128-
Contract.fromJson(
129-
DeprecatedNFTTest1ContractJson,
130-
"",
131-
"cc6928c9c6777077abcb5b9c4f7c5d620d6cae07ec6f00f5e8b0efe6a7b913c4",
132-
AllStructs
133-
)
130+
DeprecatedNFTTest1ContractArtifact
134131
);
135132

136133
// Use this class to interact with the blockchain

artifacts/ts/DeprecatedNFTTest2.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DeprecatedNFTTest2ContractJson } from "../nft/DeprecatedNFTTest2.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import {
37+
DeprecatedNFTTest2ContractArtifact,
38+
getContractByCodeHash,
39+
} from "./contracts";
3840
import {
3941
AddStruct1,
4042
AddStruct2,
@@ -141,12 +143,7 @@ class Factory extends ContractFactory<
141143

142144
// Use this object to test and deploy the contract
143145
export const DeprecatedNFTTest2 = new Factory(
144-
Contract.fromJson(
145-
DeprecatedNFTTest2ContractJson,
146-
"",
147-
"ade9aee476ee752050a1e9e1b19039f05261cb3f53941152617174faf9eae572",
148-
AllStructs
149-
)
146+
DeprecatedNFTTest2ContractArtifact
150147
);
151148

152149
// Use this class to interact with the blockchain

artifacts/ts/DeprecatedNFTTest3.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DeprecatedNFTTest3ContractJson } from "../nft/DeprecatedNFTTest3.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import {
37+
DeprecatedNFTTest3ContractArtifact,
38+
getContractByCodeHash,
39+
} from "./contracts";
3840
import {
3941
AddStruct1,
4042
AddStruct2,
@@ -141,12 +143,7 @@ class Factory extends ContractFactory<
141143

142144
// Use this object to test and deploy the contract
143145
export const DeprecatedNFTTest3 = new Factory(
144-
Contract.fromJson(
145-
DeprecatedNFTTest3ContractJson,
146-
"",
147-
"465bc3739cd1649e58e0470971bd2fabf21363ab9fc2c15052fb2440dd06ada5",
148-
AllStructs
149-
)
146+
DeprecatedNFTTest3ContractArtifact
150147
);
151148

152149
// Use this class to interact with the blockchain

artifacts/ts/DeprecatedNFTTest4.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DeprecatedNFTTest4ContractJson } from "../nft/DeprecatedNFTTest4.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import {
37+
DeprecatedNFTTest4ContractArtifact,
38+
getContractByCodeHash,
39+
} from "./contracts";
3840
import {
3941
AddStruct1,
4042
AddStruct2,
@@ -141,12 +143,7 @@ class Factory extends ContractFactory<
141143

142144
// Use this object to test and deploy the contract
143145
export const DeprecatedNFTTest4 = new Factory(
144-
Contract.fromJson(
145-
DeprecatedNFTTest4ContractJson,
146-
"",
147-
"a5de0fa0b3580303ac63423f09ce5ed95fccbf789679b32130a53c26fef182e9",
148-
AllStructs
149-
)
146+
DeprecatedNFTTest4ContractArtifact
150147
);
151148

152149
// Use this class to interact with the blockchain

artifacts/ts/DeprecatedNFTTest5.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DeprecatedNFTTest5ContractJson } from "../nft/DeprecatedNFTTest5.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import {
37+
DeprecatedNFTTest5ContractArtifact,
38+
getContractByCodeHash,
39+
} from "./contracts";
3840
import {
3941
AddStruct1,
4042
AddStruct2,
@@ -146,12 +148,7 @@ class Factory extends ContractFactory<
146148

147149
// Use this object to test and deploy the contract
148150
export const DeprecatedNFTTest5 = new Factory(
149-
Contract.fromJson(
150-
DeprecatedNFTTest5ContractJson,
151-
"",
152-
"8b1374f39db98c485af3dd05d0b0ce861e9528f290ca9dc0d7108e8b48b50161",
153-
AllStructs
154-
)
151+
DeprecatedNFTTest5ContractArtifact
155152
);
156153

157154
// Use this class to interact with the blockchain

artifacts/ts/DeprecatedNFTTest6.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DeprecatedNFTTest6ContractJson } from "../nft/DeprecatedNFTTest6.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import {
37+
DeprecatedNFTTest6ContractArtifact,
38+
getContractByCodeHash,
39+
} from "./contracts";
3840
import {
3941
AddStruct1,
4042
AddStruct2,
@@ -141,12 +143,7 @@ class Factory extends ContractFactory<
141143

142144
// Use this object to test and deploy the contract
143145
export const DeprecatedNFTTest6 = new Factory(
144-
Contract.fromJson(
145-
DeprecatedNFTTest6ContractJson,
146-
"",
147-
"8bc0d39f0607d4a771ec70ae1057b71dbcde404177cb3b25fd7d93d553a2b8cd",
148-
AllStructs
149-
)
146+
DeprecatedNFTTest6ContractArtifact
150147
);
151148

152149
// Use this class to interact with the blockchain

artifacts/ts/DeprecatedNFTTest7.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ import {
3333
encodeContractFields,
3434
Narrow,
3535
} from "@alephium/web3";
36-
import { default as DeprecatedNFTTest7ContractJson } from "../nft/DeprecatedNFTTest7.ral.json";
37-
import { getContractByCodeHash } from "./contracts";
36+
import {
37+
DeprecatedNFTTest7ContractArtifact,
38+
getContractByCodeHash,
39+
} from "./contracts";
3840
import {
3941
AddStruct1,
4042
AddStruct2,
@@ -146,12 +148,7 @@ class Factory extends ContractFactory<
146148

147149
// Use this object to test and deploy the contract
148150
export const DeprecatedNFTTest7 = new Factory(
149-
Contract.fromJson(
150-
DeprecatedNFTTest7ContractJson,
151-
"",
152-
"b95c9acf088b090f5d9d34f28ab079cf22b9e53af8ae6864113c71172231ef4c",
153-
AllStructs
154-
)
151+
DeprecatedNFTTest7ContractArtifact
155152
);
156153

157154
// Use this class to interact with the blockchain

0 commit comments

Comments
 (0)