chore: deploytest script update
This commit is contained in:
@@ -4,6 +4,7 @@ import { defaultCacheOptions, LoggerFactory, WarpFactory } from '../src';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { JWKInterface } from 'arweave/node/lib/wallet';
|
import { JWKInterface } from 'arweave/node/lib/wallet';
|
||||||
|
import {ArweaveSigner, DeployPlugin} from "warp-contracts-plugin-deploy";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
let wallet: JWKInterface = readJSON('./.secrets/33F0QHcb22W7LwWR1iRC8Az1ntZG09XQ03YWuw2ABqA.json');
|
let wallet: JWKInterface = readJSON('./.secrets/33F0QHcb22W7LwWR1iRC8Az1ntZG09XQ03YWuw2ABqA.json');
|
||||||
@@ -18,14 +19,15 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const warp = WarpFactory.forMainnet({ ...defaultCacheOptions, inMemory: true });
|
const warp = WarpFactory.forMainnet({...defaultCacheOptions, inMemory: true})
|
||||||
|
.use(new DeployPlugin());
|
||||||
|
|
||||||
const jsContractSrc = fs.readFileSync(path.join(__dirname, 'data/js/token-pst.js'), 'utf8');
|
const jsContractSrc = fs.readFileSync(path.join(__dirname, 'data/js/token-pst.js'), 'utf8');
|
||||||
const initialState = fs.readFileSync(path.join(__dirname, 'data/js/token-pst.json'), 'utf8');
|
const initialState = fs.readFileSync(path.join(__dirname, 'data/js/token-pst.json'), 'utf8');
|
||||||
|
|
||||||
// case 1 - full deploy, js contract
|
// case 1 - full deploy, js contract
|
||||||
const { contractTxId, srcTxId } = await warp.deploy({
|
const { contractTxId, srcTxId } = await warp.deploy({
|
||||||
wallet,
|
wallet: new ArweaveSigner(wallet),
|
||||||
initState: initialState,
|
initState: initialState,
|
||||||
src: jsContractSrc
|
src: jsContractSrc
|
||||||
/*evaluationManifest: {
|
/*evaluationManifest: {
|
||||||
@@ -77,6 +79,8 @@ async function main() {
|
|||||||
function: 'transfer',
|
function: 'transfer',
|
||||||
target: 'M-mpNeJbg9h7mZ-uHaNsa5jwFFRAq0PsTkNWXJ-ojwI',
|
target: 'M-mpNeJbg9h7mZ-uHaNsa5jwFFRAq0PsTkNWXJ-ojwI',
|
||||||
qty: 100
|
qty: 100
|
||||||
|
}, {
|
||||||
|
disableBundling: true
|
||||||
})
|
})
|
||||||
/*contract.writeInteraction<any>({
|
/*contract.writeInteraction<any>({
|
||||||
function: "mint",
|
function: "mint",
|
||||||
@@ -85,7 +89,7 @@ async function main() {
|
|||||||
}),*/
|
}),*/
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//const {cachedValue} = await contract.readState();
|
const {cachedValue} = await contract.readState();
|
||||||
|
|
||||||
//logger.info("Result", await contract.getStorageValue('33F0QHcb22W7LwWR1iRC8Az1ntZG09XQ03YWuw2ABqA'));
|
//logger.info("Result", await contract.getStorageValue('33F0QHcb22W7LwWR1iRC8Az1ntZG09XQ03YWuw2ABqA'));
|
||||||
//console.dir(cachedValue.state);
|
//console.dir(cachedValue.state);
|
||||||
|
|||||||
Reference in New Issue
Block a user