Skip to content

Commit

Permalink
fix!: avoid "game", "join", "place"
Browse files Browse the repository at this point in the history
 - rename build-game1-start
 - strike "game" from test-contract.js, CONTRIBUTING.md
 - update repo URLs - strike "game"
 - strike "game" from package names
 - avoid "game" in contract filename
 - rename contract instance, brand, keywords
 - avoid "game" in ui, incl invitation maker
  • Loading branch information
dckc committed Jan 24, 2024
1 parent 853c415 commit 493016a
Show file tree
Hide file tree
Showing 19 changed files with 276 additions and 222 deletions.
89 changes: 73 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,103 @@ yarn test
```

```
$ yarn test
yarn run v1.22.19
yarn run v1.22.21
$ ava --verbose
✔ bundle-source › bundleSource() bundles the contract for use with zoe (3.3s)
...
start proposal module evaluating
bundles/ add: assetContract from /home/connolly/projects/dapp-offer-up/contract/src/offer-up.contract.js
✔ bundle-source › bundleSource() bundles the contract for use with zoe (1s)
ℹ 7fffb45de65f0c887401d4a5c5185ad87d41e3842d6eb2e10559a06c747358fe0dc5ef41fd4c04457c5e9bb27ed85e48ea1ff8bdeac524063b7743205f4817e6
ℹ Object @Alleged: BundleInstallation {}
bundles/ bundled 85 files in bundle-assetContract.js at 2024-01-23T02:30:57.437Z
startOfferUpContract()...
✔ contract › Install the contract
ℹ Object @Alleged: BundleInstallation {}
✔ contract › Start the contract (1.3s)
...
✔ contract › Alice trades: give some play money, want some game places (1.3s)
✔ contract › Start the contract (901ms)
ℹ terms: {
tradePrice: {
brand: Object @Alleged: PlayMoney brand {},
value: 5n,
},
}
ℹ Object @Alleged: InstanceHandle {}
CoreEval script: started contract Object [Alleged: InstanceHandle] {}
✔ contract › Alice trades: give some play money, want items (939ms)
ℹ Object @Alleged: InstanceHandle {}
ℹ Alice gives {
Price: {
brand: Object @Alleged: PlayMoney brand {},
value: 5n,
},
}
ℹ Alice payout brand Object @Alleged: Place brand {}
ℹ Alice payout brand Object @Alleged: Item brand {}
ℹ Alice payout value Object @copyBag {
payload: [
[
'Park Place',
'scroll',
1n,
],
[
'Boardwalk',
'map',
1n,
],
],
}
✔ contract › Trade in IST rather than play money (8.5s)
...
✔ contract › use the code that will go on chain to start the contract (8.5s)
...
CoreEval script: share via agoricNames: Object [Alleged: Item brand] {}
offerUp (re)started
----- OfferUp.2 2 trade give { Price: { brand: Object [Alleged: PlayMoney brand] {}, value: 5n } } want Object [copyBag] { payload: [ [ 'scroll', 1n ], [ 'map', 1n ] ] }
bundles/ add: centralSupply from /home/connolly/projects/dapp-offer-up/node_modules/@agoric/vats/src/centralSupply.js
bundles/ bundled 132 files in bundle-centralSupply.js at 2024-01-23T02:30:59.505Z
----- OfferUp.2 2 trade give {
Price: { brand: Object [Alleged: ZDEFAULT brand] {}, value: 250000n }
} want Object [copyBag] { payload: [ [ 'scroll', 1n ], [ 'map', 1n ] ] }
✔ contract › Trade in IST rather than play money (2.5s)
ℹ Alice gives {
Price: {
brand: Object @Alleged: ZDEFAULT brand {},
value: 250000n,
},
}
ℹ Alice payout brand Object @Alleged: Item brand {}
ℹ Alice payout value Object @copyBag {
payload: [
[
'scroll',
1n,
],
[
'map',
1n,
],
],
}
✔ contract › use the code that will go on chain to start the contract (2.5s)
ℹ Alice gives {
Price: {
brand: Object @Alleged: ZDEFAULT brand {},
value: 250000n,
},
}
ℹ Alice payout brand Object @Alleged: Item brand {}
ℹ Alice payout value Object @copyBag {
payload: [
[
'scroll',
1n,
],
[
'map',
1n,
],
],
}
----- OfferUp.2 2 trade give {
Price: { brand: Object [Alleged: ZDEFAULT brand] {}, value: 250000n }
} want Object [copyBag] { payload: [ [ 'scroll', 1n ], [ 'map', 1n ] ] }
6 tests passed
Done in 12.74s.
Done in 4.74s.
```

Any `Error#1: changed ...` diagnostics are benign reports of updated files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Agoric App Starter: Simple Game
# Agoric Dapp Starter: Offer Up

This is a simple app for the [Agoric smart contract platform](https://docs.agoric.com/).

Expand Down
4 changes: 2 additions & 2 deletions _agstate/agoric-servers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "game-places-agservers",
"name": "offer-up-agservers",
"version": "0.0.1",
"description": "Agoric server instances for dapp-game-places",
"description": "Agoric server instances for dapp-offer-up",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$note": "@agoric/create-dapp@0.1.0 expects an api/package.json",
"name": "game-places-api",
"name": "offer-up-api",
"version": "0.1.0"
}
4 changes: 2 additions & 2 deletions contract/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
start-game1-permit.json
start-game1.js
start-offer-up-permit.json
start-offer-up.js
bundles/
8 changes: 5 additions & 3 deletions contract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,19 @@ print-key: /root/.agoric/user1.key
@agd keys show user1 -a --keyring-backend="test"
@echo

start-contract: start-game1.js start-game1-permit.json install-bundles
SCRIPT=start-offer-up.js
PERMIT=start-offer-up-permit.json
start-contract: $(SCRIPT) $(PERMIT) install-bundles
scripts/propose-start-contract.sh

install-bundles: bundles/bundle-list
./scripts/install-bundles.sh

build-proposal: bundles/bundle-list

bundles/bundle-list start-game1.js start-game1-permit.json:
bundles/bundle-list $(SCRIPT) $(PERMIT):
./scripts/build-proposal.sh


clean:
@rm -rf start-game1.js start-game1-permit.json bundles/
@rm -rf $(SCRIPT) $(PERMIT) bundles/
12 changes: 6 additions & 6 deletions contract/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "game-places-contract",
"name": "offer-up-contract",
"version": "0.1.0",
"private": true,
"description": "Game Asset Contract",
"description": "Offer Up Contract",
"type": "module",
"scripts": {
"start:docker": "docker compose up -d",
Expand All @@ -11,7 +11,7 @@
"docker:make": "docker compose exec agd make -C /workspace/contract",
"make:help": "make list",
"start": "yarn docker:make clean start-contract print-key",
"build": "agoric run scripts/build-game1-start.js",
"build": "agoric run scripts/build-contract-deployer.js",
"test": "ava --verbose",
"lint": "eslint '**/*.js'",
"lint:fix": "eslint --fix '**/*.js'"
Expand Down Expand Up @@ -60,14 +60,14 @@
"keywords": [],
"repository": {
"type": "git",
"url": "git+https://github.com/agoric-labs/dapp-join-game"
"url": "git+https://github.com/Agoric/dapp-offer-up"
},
"author": "Agoric",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/agoric-labs/dapp-join-game/issues"
"url": "https://github.com/Agoric/dapp-offer-up/issues"
},
"homepage": "https://github.com/agoric-labs/dapp-join-game#readme",
"homepage": "https://github.com/Agoric/dapp-offer-up#readme",
"eslintConfig": {
"parserOptions": {
"sourceType": "module",
Expand Down
36 changes: 36 additions & 0 deletions contract/scripts/build-contract-deployer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @file Permission Contract Deployment builder
*
* Usage:
* agoric run build-contract-deployer.js
*/

import { makeHelpers } from '@agoric/deploy-script-support';
import { getManifestForOfferUp } from '../src/offer-up-proposal.js';

/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */
export const offerUpProposalBuilder = async ({ publishRef, install }) => {
return harden({
sourceSpec: '../src/offer-up-proposal.js',
getManifestCall: [
getManifestForOfferUp.name,
{
offerUpRef: publishRef(
install(
'../src/offer-up.contract.js',
'../bundles/bundle-offer-up.js',
{
persist: true,
},
),
),
},
],
});
};

/** @type {DeployScriptFunction} */
export default async (homeP, endowments) => {
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
await writeCoreProposal('start-offer-up', offerUpProposalBuilder);
};
34 changes: 0 additions & 34 deletions contract/scripts/build-game1-start.js

This file was deleted.

2 changes: 1 addition & 1 deletion contract/scripts/build-proposal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
cd /workspace/contract

mkdir -p bundles
(agoric run ./scripts/build-game1-start.js )>/tmp/,run.log
(agoric run ./scripts/build-contract-deployer.js )>/tmp/,run.log
./scripts/parseProposals.mjs </tmp/,run.log \
| jq -r '.bundles[]' | sort -u > bundles/bundle-list

Expand Down
6 changes: 3 additions & 3 deletions contract/scripts/propose-start-contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ set -xueo pipefail

cd /workspace/contract

SCRIPT=start-game1.js
PERMIT=start-game1-permit.json
SCRIPT=start-offer-up.js
PERMIT=start-offer-up-permit.json
ls -sh "$SCRIPT" "$PERMIT"

PROPOSAL=$(agd query gov proposals --output json | jq -c '.proposals | length | .+1')

make fund-acct

agd tx gov submit-proposal swingset-core-eval "$PERMIT" "$SCRIPT" \
--title="Start Game Place Contract" --description="Evaluate $SCRIPT" \
--title="Start Offer Up Contract" --description="Evaluate $SCRIPT" \
--deposit=10000000ubld --gas=auto --gas-adjustment=1.2 \
--from user1 --chain-id agoriclocal --keyring-backend=test \
--yes -b block
Expand Down
70 changes: 0 additions & 70 deletions contract/src/gameAssetContract.js

This file was deleted.

Loading

0 comments on commit 493016a

Please sign in to comment.