Skip to content

Commit

Permalink
lint: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Aug 14, 2024
1 parent 15861e9 commit a2e6aa6
Show file tree
Hide file tree
Showing 18 changed files with 528 additions and 324 deletions.
183 changes: 182 additions & 1 deletion contract/,tx.json
Original file line number Diff line number Diff line change
@@ -1 +1,182 @@
{"height":"1007","txhash":"13E7554F159251539A014512706124416E5A14781CB4C64497F0BB137372CF96","codespace":"","code":0,"data":"12260A242F636F736D6F732E62616E6B2E763162657461312E4D736753656E64526573706F6E7365","raw_log":"[{\"msg_index\":0,\"events\":[{\"type\":\"coin_received\",\"attributes\":[{\"key\":\"receiver\",\"value\":\"agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk\"},{\"key\":\"amount\",\"value\":\"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA\"}]},{\"type\":\"coin_spent\",\"attributes\":[{\"key\":\"spender\",\"value\":\"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl\"},{\"key\":\"amount\",\"value\":\"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmos.bank.v1beta1.MsgSend\"},{\"key\":\"sender\",\"value\":\"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk\"},{\"key\":\"sender\",\"value\":\"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl\"},{\"key\":\"amount\",\"value\":\"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA\"}]}]}]","logs":[{"msg_index":0,"log":"","events":[{"type":"coin_received","attributes":[{"key":"receiver","value":"agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk"},{"key":"amount","value":"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"}]},{"type":"coin_spent","attributes":[{"key":"spender","value":"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl"},{"key":"amount","value":"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"}]},{"type":"message","attributes":[{"key":"action","value":"/cosmos.bank.v1beta1.MsgSend"},{"key":"sender","value":"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl"},{"key":"module","value":"bank"}]},{"type":"transfer","attributes":[{"key":"recipient","value":"agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk"},{"key":"sender","value":"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl"},{"key":"amount","value":"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"}]}]}],"info":"","gas_wanted":"93980","gas_used":"75297","tx":null,"timestamp":"","events":[{"type":"tx","attributes":[{"key":"ZmVl","value":"","index":true},{"key":"ZmVlX3BheWVy","value":"YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs","index":true}]},{"type":"tx","attributes":[{"key":"YWNjX3NlcQ==","value":"YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRsLzU3","index":true}]},{"type":"tx","attributes":[{"key":"c2lnbmF0dXJl","value":"Vks3cTlTN09BSUt3eEhnNnhyR2p6WEwvcGNiWUZQTlBITmd0Z0draVBnZzZSaDY2bXljVFA3M2traERmTzhuMVFkajB4TEh2WnhWekpjWTRZcTRaekE9PQ==","index":true}]},{"type":"message","attributes":[{"key":"YWN0aW9u","value":"L2Nvc21vcy5iYW5rLnYxYmV0YTEuTXNnU2VuZA==","index":true}]},{"type":"coin_spent","attributes":[{"key":"c3BlbmRlcg==","value":"YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs","index":true},{"key":"YW1vdW50","value":"MTAwMDAwMDAwMGliYy9CQTMxM0M0QTE5REZCRjk0MzU4NkMwMzg3RTZCMTEyODZGOUU0MTZCNEREMjc1NzRFNjkwOUNBQkUwRTM0MkZB","index":true}]},{"type":"coin_received","attributes":[{"key":"cmVjZWl2ZXI=","value":"YWdvcmljMXJ3d2xleTU1MGs5bW1rNnVxNm1tNno0dWRyZzhreXV5dmZzempr","index":true},{"key":"YW1vdW50","value":"MTAwMDAwMDAwMGliYy9CQTMxM0M0QTE5REZCRjk0MzU4NkMwMzg3RTZCMTEyODZGOUU0MTZCNEREMjc1NzRFNjkwOUNBQkUwRTM0MkZB","index":true}]},{"type":"transfer","attributes":[{"key":"cmVjaXBpZW50","value":"YWdvcmljMXJ3d2xleTU1MGs5bW1rNnVxNm1tNno0dWRyZzhreXV5dmZzempr","index":true},{"key":"c2VuZGVy","value":"YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs","index":true},{"key":"YW1vdW50","value":"MTAwMDAwMDAwMGliYy9CQTMxM0M0QTE5REZCRjk0MzU4NkMwMzg3RTZCMTEyODZGOUU0MTZCNEREMjc1NzRFNjkwOUNBQkUwRTM0MkZB","index":true}]},{"type":"message","attributes":[{"key":"c2VuZGVy","value":"YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs","index":true}]},{"type":"message","attributes":[{"key":"bW9kdWxl","value":"YmFuaw==","index":true}]}]}
{
"height": "1007",
"txhash": "13E7554F159251539A014512706124416E5A14781CB4C64497F0BB137372CF96",
"codespace": "",
"code": 0,
"data": "12260A242F636F736D6F732E62616E6B2E763162657461312E4D736753656E64526573706F6E7365",
"raw_log": "[{\"msg_index\":0,\"events\":[{\"type\":\"coin_received\",\"attributes\":[{\"key\":\"receiver\",\"value\":\"agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk\"},{\"key\":\"amount\",\"value\":\"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA\"}]},{\"type\":\"coin_spent\",\"attributes\":[{\"key\":\"spender\",\"value\":\"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl\"},{\"key\":\"amount\",\"value\":\"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmos.bank.v1beta1.MsgSend\"},{\"key\":\"sender\",\"value\":\"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk\"},{\"key\":\"sender\",\"value\":\"agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl\"},{\"key\":\"amount\",\"value\":\"1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA\"}]}]}]",
"logs": [
{
"msg_index": 0,
"log": "",
"events": [
{
"type": "coin_received",
"attributes": [
{
"key": "receiver",
"value": "agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk"
},
{
"key": "amount",
"value": "1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"
}
]
},
{
"type": "coin_spent",
"attributes": [
{
"key": "spender",
"value": "agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl"
},
{
"key": "amount",
"value": "1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"
}
]
},
{
"type": "message",
"attributes": [
{ "key": "action", "value": "/cosmos.bank.v1beta1.MsgSend" },
{
"key": "sender",
"value": "agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl"
},
{ "key": "module", "value": "bank" }
]
},
{
"type": "transfer",
"attributes": [
{
"key": "recipient",
"value": "agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk"
},
{
"key": "sender",
"value": "agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl"
},
{
"key": "amount",
"value": "1000000000ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"
}
]
}
]
}
],
"info": "",
"gas_wanted": "93980",
"gas_used": "75297",
"tx": null,
"timestamp": "",
"events": [
{
"type": "tx",
"attributes": [
{ "key": "ZmVl", "value": "", "index": true },
{
"key": "ZmVlX3BheWVy",
"value": "YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs",
"index": true
}
]
},
{
"type": "tx",
"attributes": [
{
"key": "YWNjX3NlcQ==",
"value": "YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRsLzU3",
"index": true
}
]
},
{
"type": "tx",
"attributes": [
{
"key": "c2lnbmF0dXJl",
"value": "Vks3cTlTN09BSUt3eEhnNnhyR2p6WEwvcGNiWUZQTlBITmd0Z0draVBnZzZSaDY2bXljVFA3M2traERmTzhuMVFkajB4TEh2WnhWekpjWTRZcTRaekE9PQ==",
"index": true
}
]
},
{
"type": "message",
"attributes": [
{
"key": "YWN0aW9u",
"value": "L2Nvc21vcy5iYW5rLnYxYmV0YTEuTXNnU2VuZA==",
"index": true
}
]
},
{
"type": "coin_spent",
"attributes": [
{
"key": "c3BlbmRlcg==",
"value": "YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs",
"index": true
},
{
"key": "YW1vdW50",
"value": "MTAwMDAwMDAwMGliYy9CQTMxM0M0QTE5REZCRjk0MzU4NkMwMzg3RTZCMTEyODZGOUU0MTZCNEREMjc1NzRFNjkwOUNBQkUwRTM0MkZB",
"index": true
}
]
},
{
"type": "coin_received",
"attributes": [
{
"key": "cmVjZWl2ZXI=",
"value": "YWdvcmljMXJ3d2xleTU1MGs5bW1rNnVxNm1tNno0dWRyZzhreXV5dmZzempr",
"index": true
},
{
"key": "YW1vdW50",
"value": "MTAwMDAwMDAwMGliYy9CQTMxM0M0QTE5REZCRjk0MzU4NkMwMzg3RTZCMTEyODZGOUU0MTZCNEREMjc1NzRFNjkwOUNBQkUwRTM0MkZB",
"index": true
}
]
},
{
"type": "transfer",
"attributes": [
{
"key": "cmVjaXBpZW50",
"value": "YWdvcmljMXJ3d2xleTU1MGs5bW1rNnVxNm1tNno0dWRyZzhreXV5dmZzempr",
"index": true
},
{
"key": "c2VuZGVy",
"value": "YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs",
"index": true
},
{
"key": "YW1vdW50",
"value": "MTAwMDAwMDAwMGliYy9CQTMxM0M0QTE5REZCRjk0MzU4NkMwMzg3RTZCMTEyODZGOUU0MTZCNEREMjc1NzRFNjkwOUNBQkUwRTM0MkZB",
"index": true
}
]
},
{
"type": "message",
"attributes": [
{
"key": "c2VuZGVy",
"value": "YWdvcmljMWVzdHNld3Q2anFzeDc3cHdjeGtuNWFoMGpxZ3U4cmhnZmx3ZmRs",
"index": true
}
]
},
{
"type": "message",
"attributes": [{ "key": "bW9kdWxl", "value": "YmFuaw==", "index": true }]
}
]
}
6 changes: 0 additions & 6 deletions contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"eslint-plugin-jsdoc": "^46.4.3",
"eslint-plugin-prettier": "^5.0.0",
"import-meta-resolve": "^2.2.1",
"prettier": "^3.0.3",
"prettier-plugin-jsdoc": "^1.0.0",
"rollup": "^4.18.0",
"type-coverage": "^2.26.3",
Expand Down Expand Up @@ -113,11 +112,6 @@
"@agoric"
]
},
"prettier": {
"trailingComma": "all",
"arrowParens": "avoid",
"singleQuote": true
},
"files": [
"*.js",
"*.ts",
Expand Down
3 changes: 1 addition & 2 deletions contract/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
import typescript from '@rollup/plugin-typescript';


/**
* @param {*} opts
* @returns {import('rollup').RollupOptions}
Expand Down Expand Up @@ -83,7 +82,7 @@ const config1 = ({
// preventAssignment: true,
// }),
typescript({
tsconfig: './tsconfig.json', // Ensure you have a tsconfig.json file in your project root
tsconfig: './tsconfig.json', // Ensure you have a tsconfig.json file in your project root
}),
],
});
Expand Down
66 changes: 29 additions & 37 deletions contract/src/orca.proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { E } from '@endo/far';
import { makeTracer } from '@agoric/internal';


const { Fail } = assert;

const pathSegmentPattern = /^[a-zA-Z0-9_-]{1,100}$/;
Expand All @@ -24,11 +23,8 @@ const pathSegmentPattern = /^[a-zA-Z0-9_-]{1,100}$/;

const contractName = 'ORCA';



// const trace = makeTracer('StartOrca', true);


/**
* Core eval script to start contract
*
Expand All @@ -41,23 +37,19 @@ const contractName = 'ORCA';
* instance: PromiseSpaceOf<{ Dao: Instance }>
* }} DaoSpace
*/
export const startDaoContract = async (
powers,
config,
) => {
export const startDaoContract = async (powers, config) => {
console.log('core eval for', contractName);

const {
// must be supplied by caller or template-replaced
bundleID = Fail`no bundleID`,
} = config?.options?.[contractName] ?? {};


const {
consume: {
consume: {
agoricNames,
board,
chainStorage,
board,
chainStorage,
startUpgradable,
// orchestration,
chainTimerService,
Expand All @@ -77,37 +69,37 @@ export const startDaoContract = async (
bundleID,
});


//basic terms
const terms = {};

const mainNode = await E(chainStorage).makeChildNode("orca");
const storageNode = await E(mainNode).makeChildNode("state");
const mainNode = await E(chainStorage).makeChildNode('orca');
const storageNode = await E(mainNode).makeChildNode('state');
const marshaller = await E(board).getPublishingMarshaller();



// const privateArgs = {
// storageNode,
// marshaller,
// };

const started = await startContract(powers, {
name: contractName,
startArgs: {
installation,
terms,
const started = await startContract(
powers,
{
name: contractName,
startArgs: {
installation,
terms,
},
issuerNames: [],
},
// privateArgs
{
privateArgs: {
orchestration: await orchestration,
storageNode,
marshaller,
timer: await chainTimerService,
},
},
issuerNames: [],
},
// privateArgs
{
privateArgs: {
orchestration: await orchestration,
storageNode,
marshaller,
timer: await chainTimerService,
}
}
);

console.log(contractName, '(re)started');
Expand All @@ -120,21 +112,21 @@ export const permit = harden({
consume: {
agoricNames: true,
brandAuxPublisher: true,
startUpgradable: true,
startUpgradable: true,
zoe: true,
board: true,
chainStorage: true,
orchestration: true,
chainTimerService: true
chainTimerService: true,
},
installation: {
consume: { [contractName]: true },
produce: { [contractName]: true },
},
instance: { produce: { [contractName]: true } },
// permitting brands
issuer: { consume: { IST: true }, produce: { } },
brand: { consume: { IST: true }, produce: { } },
issuer: { consume: { IST: true }, produce: {} },
brand: { consume: { IST: true }, produce: {} },
});

export const main = startDaoContract;
11 changes: 5 additions & 6 deletions contract/src/platform-goals/start-contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ export const installContract = async (
export const startContract = async (
powers,
{ name, startArgs, issuerNames },
privateArgs
privateArgs,
) => {

console.log("POWERS")
console.log(powers)
console.log(privateArgs)
console.log('POWERS');
console.log(powers);
console.log(privateArgs);
const {
consume: { startUpgradable },
installation: { consume: consumeInstallation },
Expand All @@ -56,7 +55,7 @@ export const startContract = async (
const installation = await consumeInstallation[name];

console.log(name, 'start args:', startArgs);

const started = await E(startUpgradable)({
...startArgs,
installation,
Expand Down
Loading

0 comments on commit a2e6aa6

Please sign in to comment.