Skip to content

Commit

Permalink
rename contract1 and contract2 to simple-state and amm-contract
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Nov 8, 2024
1 parent 7609c91 commit 24cf5ad
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 22 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ git clone https://github.com/hyperweb-io/hyperweb-boilerplate.git
yarn
```

## Repository overview

* `src/`: Contains source code for each contract, with each sub-directory as a separate contract.
* `simple-state`: A simple contract to demonstrate state transitions.
* `amm-contract`: An automated market maker contract using the Bank module.
* `scripts/`: Holds the build script to create contract bundles.
* `__tests__/`: Includes test cases to validate contract functionality.
* `dist/`: Output folder for bundled contracts ready for deployment.

## Quickstart

### Bundle Contracts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Contract 2: AMM contract test', () => {

it('instantiate contract', async () => {
// Read contract code from external file
const contractPath = path.join(__dirname, '../dist/contracts/bundle2.js');
const contractPath = path.join(__dirname, '../dist/contracts/ammContract.js');
contractCode = fs.readFileSync(contractPath, 'utf8');

const msg = jsd.jsd.MessageComposer.fromPartial.instantiate({
Expand Down
5 changes: 0 additions & 5 deletions __tests__/first.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('JSD tests', () => {

it('instantiate contract', async () => {
// Read contract code from external file
const contractPath = path.join(__dirname, '../dist/contracts/bundle1.js');
const contractPath = path.join(__dirname, '../dist/contracts/simpleState.js');
contractCode = fs.readFileSync(contractPath, 'utf8');

const msg = jsd.jsd.MessageComposer.fromPartial.instantiate({
Expand Down
12 changes: 6 additions & 6 deletions dist/contracts/bundle2.js → dist/contracts/ammContract.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/contracts/bundle1.js → dist/contracts/simpleState.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ interface BuildConfig {

const configs: BuildConfig[] = [
{
entryFile: 'src/contract1/index.ts',
outFile: 'dist/contracts/bundle1.js',
entryFile: 'src/simple-state/index.ts',
outFile: 'dist/contracts/simpleState.js',
externalPackages: ['otherpackage', '~somepackage']
},
{
entryFile: 'src/contract2/index.ts',
outFile: 'dist/contracts/bundle2.js',
entryFile: 'src/amm-contract/index.ts',
outFile: 'dist/contracts/ammContract.js',
externalPackages: ['~bank'],
}
];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 24cf5ad

Please sign in to comment.