-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontract.tests.js
More file actions
37 lines (33 loc) · 901 Bytes
/
contract.tests.js
File metadata and controls
37 lines (33 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { readFileSync } from "fs";
import {
TestFunction,
createWrite,
FunctionType,
} from "@execution-machine/sdk";
const createPodcast = {
function: "createPodcast",
jwk_n: "YOUR_ARWEAVE_PUBLIC_KEY",
name: "PODCAST NAME",
desc: "PODCAST DESCRIPTION",
author: "YOU?",
lang: "en",
isExplicit: "yes",
categories: "Technology",
email: "",
contentType: "a",
cover: "ARWEAVE_TXID",
master_network: "EVM",
network: "ethereum",
token: "eth",
txid: "ETH_PAYMENT_TXID",
sig: "YOUR_SIGNED_MESSAGE",
};
const testAttempt = await TestFunction({
functionSource: readFileSync("../permacast-contract/factory.js"),
functionType: FunctionType.JAVASCRIPT,
functionInitState: JSON.parse(
readFileSync("../permacast-contract/factory.json", "utf-8")
),
writes: [createWrite(createPodcast)],
});
console.log(testAttempt.state);