MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / deploy

Function deploy

lib.commonjs/_tests/test-contract.js:8–19  ·  view source on GitHub ↗
(abi, bytecode)

Source from the content-addressed store, hash-verified

6const index_js_1 = require("../index.js");
7(0, create_provider_js_1.setupProviders)();
8async function deploy(abi, bytecode) {
9 const provider = (0, create_provider_js_1.getDevProvider)();
10 const signer = await provider.getSigner(0);
11 const factory = new index_js_1.ContractFactory(abi, bytecode, signer);
12 const contract = await factory.deploy();
13 const addr = await contract.getAddress();
14 await contract.waitForDeployment();
15 return {
16 contract: new index_js_1.Contract(addr, abi, provider),
17 contractSigner: new index_js_1.Contract(addr, abi, signer),
18 };
19}
20describe("Test Contract", function () {
21 const abi = [
22 "error CustomError1(uint256 code, string message)",

Callers 1

test-contract.jsFile · 0.70

Calls 4

deployMethod · 0.95
getAddressMethod · 0.65
getSignerMethod · 0.45
waitForDeploymentMethod · 0.45

Tested by

no test coverage detected