Skip to content
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

Tickets + JS CLI #998

Open
wants to merge 44 commits into
base: d4hines/typescript-cleanup
Choose a base branch
from
Open

Conversation

aguillon
Copy link
Collaborator

@aguillon aguillon commented Nov 28, 2022

This depends on #1002

Commits in this PR:

  1. Users need to access their balance.
  2. As far as I understand, tickets are not representable in Michelson or in Ligo. This may change in the coming weeks, but until then I propose to just parse arguments following the pattern (Pair string bytes amount) as tickets.
  3. As far as I understand again, tickets need to be explicitly transmitted in the VM operation so that the VM allows the balance to change. This commit is adding stuff to parse the invoke command line, looking for the same pattern as before, which gives something like
deku-cli invoke wallet.json DK141PdoGDp9gZea9okEiPJfL3Y9z5GhhZ5T 'Left (Pair "DK1JxMLmohbyKXbGhQWLJZyktSsZKGxaM6jz" 0x 10) ... rest of the argument' '(Pair "DK1JxMLmohbyKXbGhQWLJZyktSsZKGxaM6jz" 0x 10)'

where the first expression is the smart contract's call (parsed by Tunac) and the last expression is the ticket is an authorization for those tickets to be consumed.
4. Just doc lol. I add a chapter to give a deeper example of the usage of tickets. Unfortunately it seems that I found new bugs in the VM, so the chapter is incomplete (and I'll open an issue shortly).

Overall, not a great PR, but a PR nonetheless.

@aguillon aguillon requested a review from Pilou97 November 28, 2022 10:02
@d4hines d4hines force-pushed the d4hines/typescript-cleanup branch from e1ed1f9 to 028ecfb Compare November 29, 2022 18:58
Base automatically changed from d4hines/typescript-cleanup to main November 29, 2022 19:00
@aguillon aguillon force-pushed the js-cli-improvements branch 2 times, most recently from 45f8e37 to 4806b69 Compare November 30, 2022 18:37
@aguillon aguillon changed the base branch from main to js-fix-and-doc December 1, 2022 14:21
@aguillon aguillon marked this pull request as ready for review December 1, 2022 14:41
Base automatically changed from js-fix-and-doc to d4hines/typescript-cleanup December 1, 2022 19:14
@aguillon aguillon changed the title Js cli improvements Tickets + JS CLI Dec 2, 2022
Pilou97 and others added 16 commits December 2, 2022 10:09
- It was failing whena node requested a block 0

Co-authored-by: EduardoRFS <[email protected]>
* replace yojson by data_encoding

almost done

compelte withdrawal_handle

compiling, lets debug

switch to object

fix interop

API + deposit are OK. Need to fix withdraw

Prepare next dev version of toolkits

feat: add contract address in vm receipts (#991)

drop unused deku-p example

move all examples to a single folder

drop unused ocaml deku-cli

move all examples to ./examples

fix: rename deku-cli to @marigold-dev/deku-cli

feat: on-chain counter example for deku-c

drop support for deku-p cli

Temporary solution until we add support for deku-p back to main.

refactor: combine toolkits into a single package

refactor: rename DekuToolkit to DekuPClient

refactor: extend DekuPClient from DekuCClient

fix: octez_client bash alias (#997)

Co-authored-by: aguillon <[email protected]>

fix: remove deku-toolkit from yarn.lock

fix: request ghostnet permissions in example dapp

remove useless files

fix: add NIX_SSL_CERT_FILE to nix shell for ligo

body encoding to object

* bug: make it compile

Maybe this commit (and the previous one) can cause desync of the API
TODO: fixup this commit if it works

* fix: blake2b encoding

The commit on tezos is working

* fix: retrieve level from the API in the tests

* fix: wrong tag in encoding

* fix: wrong tag in encoding

* fix: encoding of operation body endpoint already exist

conv is useless
no need to return a tup1

* fix: Data_encoding can crash

Data_encoding.Json.desctruct can raise an exception

* fix: encoding already defined

* fix: endpoint operations needs an obj

* fix: proof_test

* wip: change operation encoding from tup to obj

It's temporary, I am planning to define an api_encoding for encodings
that are only used by the API (I am not sure of the name)

* fix: api error encoding

* fix: wasm-vm api state encoding

* fix: client get state

* fix: client invokation

* fix: genesis encoding

* fix: get head block api

* fix: get block by level or hash

* fix: do not use Blake2b.encoding

* refacto: get receipt

* refacto: compile origination

* fix: compile invocation

* fix: fix response encoding from interop

* refacto: remove yojson from functors

* refacto: rename of_yojson to_yojson of the external vm

* fix: remove useless comment with yojson code

* refacto: remove useless exception

* refacto: yojson is no more needed in the stdlib

* refacto: rename function in e2e tests

* refacto: renaming in test

* refacto: remove yojson from nix and dune files

* fix: wasm cram test

* fix: uncomment protocol disabled test

* refacto: remove yojson functors

* refacto: remove useless yojson

* refacto: remove yojson from dune/nix

* fix: adapt deku_helper to data_encoding

* settings: upgrade client version

* settings: upgrade deku lib in examples and deku-cli

Co-authored-by: Pierre-Louis <[email protected]>
Co-authored-by: InfiniteSwerve <[email protected]>
@aguillon aguillon force-pushed the js-cli-improvements branch from 28a5f32 to 4523fc7 Compare December 10, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants