diff --git a/.circleci/config.yml b/.circleci/config.yml index 86149483..d020123b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -152,7 +152,6 @@ jobs: name: Run tests environment: LAUNCHPAD_ENABLED: 1 - ERC20_ENABLED: 1 TENDERMINT_ENABLED: 1 SOCKETSERVER_ENABLED: 1 SKIP_BUILD: 1 @@ -273,7 +272,6 @@ jobs: - run: environment: LAUNCHPAD_ENABLED: 1 - ERC20_ENABLED: 1 SIMAPP42_ENABLED: 1 SLOW_SIMAPP42_ENABLED: 1 TENDERMINT_ENABLED: 1 @@ -292,7 +290,13 @@ jobs: name: Run CLI examples working_directory: packages/cli environment: + LAUNCHPAD_ENABLED: 1 + SIMAPP42_ENABLED: 1 + SLOW_SIMAPP42_ENABLED: 1 + TENDERMINT_ENABLED: 1 + SOCKETSERVER_ENABLED: 1 SKIP_BUILD: 1 + WASMD_ENABLED: 1 command: ./run_examples.sh - run: name: Stop chains @@ -389,7 +393,6 @@ jobs: - run: environment: LAUNCHPAD_ENABLED: 1 - ERC20_ENABLED: 1 SIMAPP42_ENABLED: 1 SLOW_SIMAPP42_ENABLED: 1 TENDERMINT_ENABLED: 1 @@ -491,7 +494,6 @@ jobs: - run: environment: LAUNCHPAD_ENABLED: 1 - ERC20_ENABLED: 1 SIMAPP42_ENABLED: 1 SLOW_SIMAPP42_ENABLED: 1 TENDERMINT_ENABLED: 1 diff --git a/HACKING.md b/HACKING.md index 3b29adbd..cb9752d6 100644 --- a/HACKING.md +++ b/HACKING.md @@ -55,7 +55,6 @@ multiple versions of raw Tendermint and a basic WebSocket server. ./scripts/launchpad/start.sh ./scripts/launchpad/init.sh export LAUNCHPAD_ENABLED=1 -export ERC20_ENABLED=1 # Start Tendermint ./scripts/tendermint/all_start.sh @@ -71,7 +70,6 @@ yarn test # And at the end of the day unset SOCKETSERVER_ENABLED unset TENDERMINT_ENABLED -unset ERC20_ENABLED unset LAUNCHPAD_ENABLED ./scripts/socketserver/stop.sh ./scripts/tendermint/all_stop.sh diff --git a/packages/cli/examples/cosmwasm.ts b/packages/cli/examples/cosmwasm.ts index 59bb9dd5..6a75c7a5 100755 --- a/packages/cli/examples/cosmwasm.ts +++ b/packages/cli/examples/cosmwasm.ts @@ -23,12 +23,7 @@ async function main(hackatomWasmPath: string) { // Upload contract const wasm = fs.readFileSync(hackatomWasmPath); const uploadFee = calculateFee(1_500_000, gasPrice); - const uploadReceipt = await client.upload( - alice.address0, - wasm, - uploadFee, - "Upload hackatom contract", - ); + const uploadReceipt = await client.upload(alice.address0, wasm, uploadFee, "Upload hackatom contract"); console.info("Upload succeeded. Receipt:", uploadReceipt); // Instantiate diff --git a/packages/cli/examples/stargate.ts b/packages/cli/examples/stargate.ts index b666cd76..fabd8c11 100644 --- a/packages/cli/examples/stargate.ts +++ b/packages/cli/examples/stargate.ts @@ -1,7 +1,8 @@ import { makeCosmoshubPath } from "@cosmjs/amino"; import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { assertIsBroadcastTxSuccess, SigningStargateClient } from "@cosmjs/stargate"; +import { assertIsBroadcastTxSuccess, calculateFee, GasPrice, SigningStargateClient } from "@cosmjs/stargate"; +// Wallet const mnemonic = "economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone"; const path = makeCosmoshubPath(3); @@ -10,15 +11,27 @@ const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, { hdPaths: [ const [account] = await wallet.getAccounts(); console.log("Signer address:", account.address); +// Network config const rpcEndpoint = "ws://localhost:26658"; +const gasPrice = GasPrice.fromString("0.025ucosm"); + +// Setup client const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, wallet); +// Send transaction const recipient = "cosmos1xv9tklw7d82sezh9haa573wufgy59vmwe6xxe5"; const amount = { denom: "ucosm", amount: "1234567", }; -const result = await client.sendTokens(account.address, recipient, [amount], "Have fun with your star coins"); +const fee = calculateFee(200_000, gasPrice); +const result = await client.sendTokens( + account.address, + recipient, + [amount], + fee, + "Have fun with your star coins", +); assertIsBroadcastTxSuccess(result); console.log("Successfully broadcasted:", result); diff --git a/packages/cli/run_examples.sh b/packages/cli/run_examples.sh index b5a60f94..897442ca 100755 --- a/packages/cli/run_examples.sh +++ b/packages/cli/run_examples.sh @@ -2,7 +2,7 @@ set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" -if [ -n "${SIMAPP42_ENABLED:-}" ]; then +if [ -n "${WASMD_ENABLED:-}" ]; then yarn node ./bin/cosmwasm-cli --init examples/cosmwasm.ts --code "process.exit(0)" fi if [ -n "${LAUNCHPAD_ENABLED:-}" ]; then diff --git a/packages/cosmwasm-stargate/webpack.web.config.js b/packages/cosmwasm-stargate/webpack.web.config.js index 30d31cf4..bdb2fbbb 100644 --- a/packages/cosmwasm-stargate/webpack.web.config.js +++ b/packages/cosmwasm-stargate/webpack.web.config.js @@ -18,7 +18,6 @@ module.exports = [ plugins: [ new webpack.EnvironmentPlugin({ WASMD_ENABLED: "", - ERC20_ENABLED: "", }), new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"],