Skip to content

Commit

Permalink
chore: Don't install all the wasms for no reason.
Browse files Browse the repository at this point in the history
  • Loading branch information
kovipu committed Nov 23, 2024
1 parent 3bd3017 commit c8b9538
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execSync } from 'child_process';
import { mkdirSync, readdirSync, readFileSync, writeFileSync } from 'fs';
import { mkdirSync, readFileSync, writeFileSync } from 'fs';
import path from 'path';

// Load environment variables starting with PUBLIC_ into the environment,
Expand Down Expand Up @@ -45,17 +45,17 @@ export const installContracts = () => {
const contractsDir = `./.stellar/contract-wasm-hash`;
mkdirSync(contractsDir, { recursive: true });

const wasmFiles = readdirSync(`./target/wasm32-unknown-unknown/release`).filter((file) => file.endsWith('.wasm'));

wasmFiles.forEach((wasmFile) => {
install(`./target/wasm32-unknown-unknown/release/${wasmFile}`);
});
install('loan_manager');
install('loan_pool');
};

/* Install a contract */
const install = (wasm: string) => {
const install = (contractName: string) => {
exe(
`stellar contract install --wasm ${wasm} --ignore-checks > ./.stellar/contract-wasm-hash/${filenameNoExtension(wasm)}.txt`,
`stellar contract install \
--wasm ./target/wasm32-unknown-unknown/release/${contractName}.wasm \
--ignore-checks \
> ./.stellar/contract-wasm-hash/${contractName}.txt`,
);
};

Expand Down

0 comments on commit c8b9538

Please sign in to comment.