mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Merge pull request #891 from cosmos/remove-CW1_ENABLED
Remove unused leftovers of cw1/cw3
This commit is contained in:
commit
d39cde1305
@ -149,22 +149,6 @@ export const deployedIbcReflect = {
|
||||
],
|
||||
};
|
||||
|
||||
/** Deployed as part of scripts/wasmd/init.sh */
|
||||
export const deployedCw3 = {
|
||||
codeId: 3,
|
||||
instances: [
|
||||
"wasm1xqeym28j9xgv0p93pwwt6qcxf9tdvf9z83duy9", // Multisig (1/3)
|
||||
"wasm1jka38ckju8cpjap00jf9xdvdyttz9cauchu0zl", // Multisig (2/3)
|
||||
"wasm12dnl585uxzddjw9hw4ca694f054shgpgffnawy", // Multisig (uneven weights)
|
||||
],
|
||||
};
|
||||
|
||||
/** Deployed as part of scripts/wasmd/init.sh */
|
||||
export const deployedCw1 = {
|
||||
codeId: 4,
|
||||
instances: ["wasm1vs2vuks65rq7xj78mwtvn7vvnm2gn7ad78g6yp"],
|
||||
};
|
||||
|
||||
export function wasmdEnabled(): boolean {
|
||||
return !!process.env.WASMD_ENABLED;
|
||||
}
|
||||
@ -175,26 +159,6 @@ export function pendingWithoutWasmd(): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function cw3Enabled(): boolean {
|
||||
return !!process.env.CW3_ENABLED;
|
||||
}
|
||||
|
||||
export function pendingWithoutCw3(): void {
|
||||
if (!cw3Enabled()) {
|
||||
return pending("Set CW3_ENABLED to enable CW3-based tests");
|
||||
}
|
||||
}
|
||||
|
||||
export function cw1Enabled(): boolean {
|
||||
return !!process.env.CW1_ENABLED;
|
||||
}
|
||||
|
||||
export function pendingWithoutCw1(): void {
|
||||
if (!cw1Enabled()) {
|
||||
return pending("Set CW1_ENABLED to enable CW1-based tests");
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns first element. Throws if array has a different length than 1. */
|
||||
export function fromOneElementArray<T>(elements: ArrayLike<T>): T {
|
||||
if (elements.length !== 1) throw new Error(`Expected exactly one element but got ${elements.length}`);
|
||||
|
@ -19,8 +19,6 @@ module.exports = [
|
||||
new webpack.EnvironmentPlugin({
|
||||
WASMD_ENABLED: "",
|
||||
ERC20_ENABLED: "",
|
||||
CW3_ENABLED: "",
|
||||
CW1_ENABLED: "",
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
Buffer: ["buffer", "Buffer"],
|
||||
|
@ -1,4 +1,2 @@
|
||||
37f868eda7a723a769f6ff77cc27435455c3cff7b14481a114895d3d93cf8326 cw1_subkeys.wasm
|
||||
203ceb9ffa61fdcb34b859a4d1249bec517112ecbaf9a9092b3787dc8199dde6 cw3_fixed_multisig.wasm
|
||||
716a97b1c086e0d7769ae7887edaa0e34faba2d7b8cda07f741f9fbf95706e8c hackatom.wasm
|
||||
0a127c6e04c8aad95dd3d50177e95b6116606546f0a4fc894ba82a29ce3b6fc1 ibc_reflect.wasm
|
||||
|
BIN
scripts/wasmd/contracts/cw1_subkeys.wasm
(Stored with Git LFS)
BIN
scripts/wasmd/contracts/cw1_subkeys.wasm
(Stored with Git LFS)
Binary file not shown.
BIN
scripts/wasmd/contracts/cw3_fixed_multisig.wasm
(Stored with Git LFS)
BIN
scripts/wasmd/contracts/cw3_fixed_multisig.wasm
(Stored with Git LFS)
Binary file not shown.
@ -3,12 +3,8 @@
|
||||
# This must get from 2-3 different repos, fix the versions here:
|
||||
|
||||
COSMWASM_VERSION="v0.16.0"
|
||||
PLUS_VERSION="v0.8.0-rc1"
|
||||
|
||||
curl -sS -L -O "https://github.com/CosmWasm/cosmwasm/releases/download/${COSMWASM_VERSION}/hackatom.wasm"
|
||||
curl -sS -L -O "https://github.com/CosmWasm/cosmwasm/releases/download/${COSMWASM_VERSION}/ibc_reflect.wasm"
|
||||
|
||||
curl -sS -L -O "https://github.com/CosmWasm/cosmwasm-plus/releases/download/${PLUS_VERSION}/cw1_subkeys.wasm"
|
||||
curl -sS -L -O "https://github.com/CosmWasm/cosmwasm-plus/releases/download/${PLUS_VERSION}/cw3_fixed_multisig.wasm"
|
||||
|
||||
sha256sum *.wasm >checksums.sha256
|
||||
|
@ -1,75 +0,0 @@
|
||||
#!/usr/bin/env -S yarn node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-stargate");
|
||||
const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing");
|
||||
const { GasPrice, calculateFee } = require("@cosmjs/stargate");
|
||||
const fs = require("fs");
|
||||
|
||||
const endpoint = "http://localhost:26659";
|
||||
const alice = {
|
||||
mnemonic: "enlist hip relief stomach skate base shallow young switch frequent cry park",
|
||||
address0: "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk",
|
||||
// address1: "wasm1hhg2rlu9jscacku2wwckws7932qqqu8xm5ca8y",
|
||||
// address2: "wasm1xv9tklw7d82sezh9haa573wufgy59vmwnxhnsl",
|
||||
// address3: "wasm17yg9mssjenmc3jkqth6ulcwj9cxujrxxg9nmzk",
|
||||
// address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j",
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const gasPrice = GasPrice.fromString("0.025ucosm");
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/cw1_subkeys.wasm");
|
||||
const uploadFee = calculateFee(1_500_000, gasPrice);
|
||||
const uploadReceipt = await client.upload(
|
||||
alice.address0,
|
||||
wasm,
|
||||
uploadFee,
|
||||
"Upload CW1 subkeys contract",
|
||||
);
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
const initMsg = {
|
||||
admins: [alice.address0],
|
||||
mutable: true,
|
||||
};
|
||||
const label = "Subkey test";
|
||||
const instantiateFee = calculateFee(500_000, gasPrice);
|
||||
const { contractAddress } = await client.instantiate(
|
||||
alice.address0,
|
||||
uploadReceipt.codeId,
|
||||
initMsg,
|
||||
label,
|
||||
instantiateFee,
|
||||
{
|
||||
memo: `Create a CW1 instance for ${alice.address0}`,
|
||||
admin: alice.address0,
|
||||
},
|
||||
);
|
||||
const sendFee = calculateFee(80_000, gasPrice);
|
||||
await client.sendTokens(
|
||||
alice.address0,
|
||||
contractAddress,
|
||||
[
|
||||
{
|
||||
amount: "1000",
|
||||
denom: "ucosm",
|
||||
},
|
||||
],
|
||||
sendFee,
|
||||
);
|
||||
console.info(`Contract instantiated for ${alice.address0} subkey at ${contractAddress}`);
|
||||
}
|
||||
|
||||
main().then(
|
||||
() => {
|
||||
console.info("All done, let the coins flow.");
|
||||
process.exit(0);
|
||||
},
|
||||
(error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
},
|
||||
);
|
@ -1,114 +0,0 @@
|
||||
#!/usr/bin/env -S yarn node
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-stargate");
|
||||
const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing");
|
||||
const { GasPrice, calculateFee } = require("@cosmjs/stargate");
|
||||
const fs = require("fs");
|
||||
|
||||
const endpoint = "http://localhost:26659";
|
||||
const alice = {
|
||||
mnemonic: "enlist hip relief stomach skate base shallow young switch frequent cry park",
|
||||
address0: "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk",
|
||||
address1: "wasm1hhg2rlu9jscacku2wwckws7932qqqu8xm5ca8y",
|
||||
address2: "wasm1xv9tklw7d82sezh9haa573wufgy59vmwnxhnsl",
|
||||
address3: "wasm17yg9mssjenmc3jkqth6ulcwj9cxujrxxg9nmzk",
|
||||
address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j",
|
||||
};
|
||||
|
||||
const initData = [
|
||||
{
|
||||
admin: alice.address0,
|
||||
label: "Multisig (1/3)",
|
||||
initMsg: {
|
||||
voters: [
|
||||
{ addr: alice.address0, weight: 1 },
|
||||
{ addr: alice.address1, weight: 1 },
|
||||
{ addr: alice.address2, weight: 1 },
|
||||
],
|
||||
required_weight: 1,
|
||||
max_voting_period: { height: 12345 },
|
||||
},
|
||||
},
|
||||
{
|
||||
admin: alice.address0,
|
||||
label: "Multisig (2/3)",
|
||||
initMsg: {
|
||||
voters: [
|
||||
{ addr: alice.address0, weight: 1 },
|
||||
{ addr: alice.address1, weight: 1 },
|
||||
{ addr: alice.address2, weight: 1 },
|
||||
],
|
||||
required_weight: 2,
|
||||
max_voting_period: { height: 12345 },
|
||||
},
|
||||
},
|
||||
{
|
||||
admin: alice.address0,
|
||||
label: "Multisig (uneven weights)",
|
||||
initMsg: {
|
||||
voters: [
|
||||
{ addr: alice.address0, weight: 1 },
|
||||
{ addr: alice.address1, weight: 2 },
|
||||
{ addr: alice.address2, weight: 3 },
|
||||
],
|
||||
required_weight: 3,
|
||||
max_voting_period: { height: 12345 },
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
async function main() {
|
||||
const gasPrice = GasPrice.fromString("0.025ucosm");
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/cw3_fixed_multisig.wasm");
|
||||
const uploadFee = calculateFee(1_500_000, gasPrice);
|
||||
const uploadReceipt = await client.upload(
|
||||
alice.address0,
|
||||
wasm,
|
||||
uploadFee,
|
||||
"Upload CW3 fixed multisig contract",
|
||||
);
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
const instantiateFee = calculateFee(500_000, gasPrice);
|
||||
const sendFee = calculateFee(80_000, gasPrice);
|
||||
for (const { admin, initMsg, label } of initData) {
|
||||
const { contractAddress } = await client.instantiate(
|
||||
alice.address0,
|
||||
uploadReceipt.codeId,
|
||||
initMsg,
|
||||
label,
|
||||
instantiateFee,
|
||||
{
|
||||
memo: `Create a CW3 instance for ${initMsg.symbol}`,
|
||||
admin: admin,
|
||||
},
|
||||
);
|
||||
await client.sendTokens(
|
||||
alice.address0,
|
||||
contractAddress,
|
||||
[
|
||||
{
|
||||
amount: "1000",
|
||||
denom: "ucosm",
|
||||
},
|
||||
],
|
||||
sendFee,
|
||||
);
|
||||
console.info(`Contract instantiated for ${label} at ${contractAddress}`);
|
||||
}
|
||||
}
|
||||
|
||||
main().then(
|
||||
() => {
|
||||
console.info("All done, let the coins flow.");
|
||||
process.exit(0);
|
||||
},
|
||||
(error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
},
|
||||
);
|
@ -27,5 +27,3 @@ SCRIPT_DIR="$(realpath "$(dirname "$0")")"
|
||||
)
|
||||
"$SCRIPT_DIR/deploy_hackatom.js"
|
||||
"$SCRIPT_DIR/deploy_ibc_reflect.js"
|
||||
# "$SCRIPT_DIR/deploy_cw3.js"
|
||||
# "$SCRIPT_DIR/deploy_cw1.js"
|
||||
|
Loading…
x
Reference in New Issue
Block a user