-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for issues #1000 and #1002 #1005
base: main
Are you sure you want to change the base?
Changes from all commits
84fcc8b
6a398a0
f28d2f2
058b2a8
1a5e968
974e1c7
ec88a17
6b2ac1f
4e3c59e
6cd0a0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,12 +165,13 @@ export const uploadModuleWith = | |
*/ | ||
export const spawnProcessWith = | ||
({ walletExists, readWallet, create }) => | ||
async ({ walletPath, module, tags }) => { | ||
async ({ walletPath, module, scheduler, tags }) => { | ||
if (!(await walletExists(walletPath))) throw new WalletNotFoundError() | ||
|
||
const wallet = await readWallet(walletPath) | ||
const res = await create({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
module, | ||
scheduler, | ||
tags, | ||
wallet | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,10 @@ export async function init ({ lang = 'lua' }, name) { | |
|
||
export const command = new Command() | ||
.description('Create an ao Process Source Project') | ||
.usage('-l cpp <my-project-name>') | ||
.usage('-l c <my-project-name>') | ||
.option( | ||
'-l, --lang <language:string>', | ||
'The starter to use. Defaults to Lua. Options are "lua" and "cpp"' | ||
'The starter to use. Defaults to Lua. Options are "lua" and "c"' | ||
Comment on lines
+22
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be in this PR. If anything, it should be a separate issue and PR, so that our team can look at it, by itself. |
||
) | ||
.arguments('<name:string>') | ||
.action(init) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,22 +4,30 @@ import { Command } from '../deps.js' | |
import { tagsArg, walletArgs } from '../utils.js' | ||
import { VERSION } from '../versions.js' | ||
|
||
function sourceArgs (src) { | ||
function moduleArgs (src) { | ||
return [ | ||
'-e', | ||
`MODULE_TX=${src}` | ||
] | ||
} | ||
|
||
function schedulerArgs (src) { | ||
return [ | ||
'-e', | ||
`SCHEDULER_ADDRESS=${src}` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see where this is used in |
||
] | ||
} | ||
|
||
/** | ||
* TODO: | ||
* - Validate existence of wallet | ||
* - require confirmation and bypass with --yes | ||
*/ | ||
export async function spawn ({ wallet, tag, value, source }) { | ||
export async function spawn ({ wallet, tag, value, module, scheduler }) { | ||
const cmdArgs = [ | ||
...walletArgs(wallet), | ||
...sourceArgs(source), | ||
...moduleArgs(module), | ||
...schedulerArgs(scheduler), | ||
...tagsArg({ tags: tag, values: value }) | ||
] | ||
|
||
|
@@ -50,6 +58,11 @@ export const command = new Command() | |
'the transaction that contains the ao Module', | ||
{ required: true } | ||
) | ||
.option( | ||
'-s, --scheduler <address:string>', | ||
'the ao scheduler address', | ||
{ required: true } | ||
) | ||
Comment on lines
+61
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
.option( | ||
'-t, --tag <tag:string>', | ||
'additional tag to add to the transaction. MUST have a corresponding --value', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be in this PR. There needs to be internal discussion on if there should even be defaults for this or if it should be derived from the build flags used to produce the wasm binary (see #983)
Let's keep this PR small and focused on only the issues highlighted in the issues it claims to address.