Skip to content

Commit

Permalink
Merge branch 'main' into anmol/docs-first-contract
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 authored Nov 11, 2024
2 parents 5570230 + 5519044 commit d88f981
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 26 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
9 changes: 5 additions & 4 deletions configs/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ chains:
faucet: 8000
exposer: 8001
resources:
cpu: "0.3"
memory: "300M"
cpu: "0.4"
memory: "400M"
faucet:
enabled: true
type: starship
concurrency: 2
resources:
cpu: "0.1"
memory: "100M"
cpu: "0.2"
memory: "200M"

registry:
enabled: true
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 d88f981

Please sign in to comment.