Skip to content

Commit 24cf5ad

Browse files
committedNov 8, 2024
rename contract1 and contract2 to simple-state and amm-contract
1 parent 7609c91 commit 24cf5ad

14 files changed

+26
-22
lines changed
 

‎README.md

+9
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ git clone https://github.com/hyperweb-io/hyperweb-boilerplate.git
5050
yarn
5151
```
5252

53+
## Repository overview
54+
55+
* `src/`: Contains source code for each contract, with each sub-directory as a separate contract.
56+
* `simple-state`: A simple contract to demonstrate state transitions.
57+
* `amm-contract`: An automated market maker contract using the Bank module.
58+
* `scripts/`: Holds the build script to create contract bundles.
59+
* `__tests__/`: Includes test cases to validate contract functionality.
60+
* `dist/`: Output folder for bundled contracts ready for deployment.
61+
5362
## Quickstart
5463

5564
### Bundle Contracts

‎__tests__/contract2.test.ts ‎__tests__/ammContract.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('Contract 2: AMM contract test', () => {
7373

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

7979
const msg = jsd.jsd.MessageComposer.fromPartial.instantiate({

‎__tests__/first.test.ts

-5
This file was deleted.

‎__tests__/contract1.test.ts ‎__tests__/simpleState.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('JSD tests', () => {
5757

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

6363
const msg = jsd.jsd.MessageComposer.fromPartial.instantiate({

‎dist/contracts/bundle2.js ‎dist/contracts/ammContract.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/contracts/bundle2.js.map ‎dist/contracts/ammContract.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/contracts/bundle1.js ‎dist/contracts/simpleState.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/contracts/bundle1.js.map ‎dist/contracts/simpleState.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/build.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ interface BuildConfig {
99

1010
const configs: BuildConfig[] = [
1111
{
12-
entryFile: 'src/contract1/index.ts',
13-
outFile: 'dist/contracts/bundle1.js',
12+
entryFile: 'src/simple-state/index.ts',
13+
outFile: 'dist/contracts/simpleState.js',
1414
externalPackages: ['otherpackage', '~somepackage']
1515
},
1616
{
17-
entryFile: 'src/contract2/index.ts',
18-
outFile: 'dist/contracts/bundle2.js',
17+
entryFile: 'src/amm-contract/index.ts',
18+
outFile: 'dist/contracts/ammContract.js',
1919
externalPackages: ['~bank'],
2020
}
2121
];
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)