-
Notifications
You must be signed in to change notification settings - Fork 229
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
extending cli to work with tribbles #10936
base: master
Are you sure you want to change the base?
Conversation
|
||
// Alternative: Async pipe executes functions left to right (sometimes more intuitive) | ||
|
||
test('tribbles airdrop program', async t => { |
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.
Steps for running:
- pull down
tg-cli-extension
- cd into
agoric-sdk/packages/fast-usdc
- execute the following command
yarn ava ./test/cli/airdrop-commands.test.js
.action(async opts => { | ||
const { proof, tier, pubkey } = opts; | ||
const powers = await collectPowers({ | ||
delay: 500, | ||
fetch, | ||
env: { AGORIC_NET: 'xnet' }, | ||
})(); | ||
|
||
const [instance, brand] = await getInstanceAndBrand({ | ||
brandName: 'IST', | ||
instanceName: 'tribblesXnetDeployment', | ||
})(powers); | ||
console.log('------------------------'); | ||
console.log({ instance, brand }); | ||
|
||
/** @type {import('@agoric/smart-wallet/src/invitations.js').InvitationSpec} */ | ||
const offer = makeClaimAirdropOffer( | ||
{ feeBrand: brand, instanceName: 'tribblesXnetDeployment' }, | ||
{ proof, tier, pubkey }, | ||
); | ||
|
||
console.log({ offer }); | ||
outputActionAndHint( | ||
{ method: 'executeOffer', offer }, | ||
{ stderr, stdout }, | ||
powers.marshaller, | ||
); | ||
}); |
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 is the sole action i'm concerned with wiring up as it facilitates claim attempts to be made programatically.
By inspecting the logs, you will see that the code is successful in its efforts to query capabilities that exist on the chain (e.g. instane
, brand
) as well as their corresponding slot value. However, execution of outputActionAndHint
appears to be where trouble arises.
It is programmed to print a string at the end of execution but no such string appears currently thus indicating that there is an issue. Additionally, the offer
object is receiving some complaints from VSCode intellisense. I've compared it to OfferSpec
s that i am using to submit these very invitations to ensure that it has the correct shape but VSCode continues to say otherwise 🤷♂️ .
}).invoke(); | ||
await program.parseAsync(argv); | ||
|
||
const action = marshalData.fromCapData(JSON.parse(out.join(''))); |
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.
reason for this test assertion is that it existed in the *commands test file I originally copied as my starting point. The result of this logic is the following error:
Error {
message: 'internal: decodeRemotableFromSmallcaps option must return a remotable: "board0257"',
}
Test PR