From f2bff77ffda37e4aafc036588aef174d40b31c5e Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Wed, 26 Feb 2020 03:27:11 -0800 Subject: [PATCH 01/40] Change LIGO documentation introduction to be about LIGO --- .../what-and-why.md => advanced/michelson.md} | 139 +-------------- gitlab-pages/docs/intro/ligo-intro.md | 163 ++++++++++++++++++ gitlab-pages/website/sidebars.json | 5 +- gitlab-pages/website/siteConfig.js | 2 +- 4 files changed, 176 insertions(+), 133 deletions(-) rename gitlab-pages/docs/{intro/what-and-why.md => advanced/michelson.md} (56%) create mode 100644 gitlab-pages/docs/intro/ligo-intro.md diff --git a/gitlab-pages/docs/intro/what-and-why.md b/gitlab-pages/docs/advanced/michelson.md similarity index 56% rename from gitlab-pages/docs/intro/what-and-why.md rename to gitlab-pages/docs/advanced/michelson.md index f195b97a7..9c11498b7 100644 --- a/gitlab-pages/docs/intro/what-and-why.md +++ b/gitlab-pages/docs/advanced/michelson.md @@ -1,19 +1,19 @@ --- -id: what-and-why +id: michelson-and-ligo title: Michelson and LIGO --- -Before we get into what LIGO is and why LIGO needs to exist, let us -take a look at what options the Tezos blockchain offers us out of the -box. If you want to implement smart contracts natively on Tezos, you -have to learn -[Michelson](https://tezos.gitlab.io/whitedoc/michelson.html). +Currently LIGO compiles to [Michelson](https://tezos.gitlab.io/whitedoc/michelson.html), +the native smart contract language supported by Tezos. This page explains the +relationship between LIGO and the underlying Michelson it compiles to. Understanding +Michelson is not a requirement to use LIGO, but it does become important if you want +to formally verify contracts using [Mi-Cho-Coq](https://gitlab.com/nomadic-labs/mi-cho-coq/) +or tune the performance of contracts outputted by the LIGO compiler. **The rationale and design of Michelson** -The language native to the Tezos blockchain for writing smart -contracts is *Michelson*, a Domain-Specific Language (DSL) inspired by -Lisp and Forth. This unusual lineage aims at satisfying unusual +Michelson is a Domain-Specific Language (DSL) for writing Tezos smart contracts +inspired by Lisp and Forth. This unusual lineage aims at satisfying unusual constraints, but entails some tensions in the design. First, to measure stepwise gas consumption, *Michelson is interpreted*. @@ -135,124 +135,3 @@ We cannot run Javascript on the Tezos blockchain, but we can choose LIGO, which will abstract the stack management and allow us to create readable, type-safe, and efficient smart contracts. -## LIGO for Programming Smart Contracts on Tezos - -Perhaps the most striking feature of LIGO is that it comes in -different concrete syntaxes, and even different programming -paradigms. In other words, LIGO is not defined by one syntax and one -paradigm, like imperative versus functional. - - - There is **PascaLIGO**, which is inspired by Pascal, hence is an - imperative language with lots of keywords, where values can be - locally mutated after they have been annotated with their types - (declaration). - - - There is **CameLIGO**, which is inspired by the pure subset of - [OCaml](https://ocaml.org/), hence is a functional language with - few keywords, where values cannot be mutated, but still require - type annotations (unlike OCaml, whose compiler performs almost - full type inference). - - - There is **ReasonLIGO**, which is inspired by the pure subset of - [ReasonML](https://reasonml.github.io/), which is based upon - OCaml. - -Let us decline the same LIGO contract in the three flavours above. Do -not worry if it is a little confusing at first; we will explain all -the syntax in the upcoming sections of the documentation. - - - -```pascaligo group=a -type storage is int - -type parameter is - Increment of int -| Decrement of int -| Reset - -type return is list (operation) * storage - -function main (const action : parameter; const store : storage) : return is - ((nil : list (operation)), - case action of - Increment (n) -> store + n - | Decrement (n) -> store - n - | Reset -> 0 - end) -``` - - -```cameligo group=a -type storage = int - -type parameter = - Increment of int -| Decrement of int -| Reset - -type return = operation list * storage - -let main (action, store : parameter * storage) : return = - ([] : operation list), - (match action with - Increment n -> store + n - | Decrement n -> store - n - | Reset -> 0) -``` - - -```reasonligo group=a -type storage = int; - -type parameter = - Increment (int) -| Decrement (int) -| Reset; - -type return = (list (operation), storage); - -let main = ((action, store): (parameter, storage)) : return => { - (([] : list (operation)), - (switch (action) { - | Increment (n) => store + n - | Decrement (n) => store - n - | Reset => 0})); -}; -``` - - - - - - -This LIGO contract behaves almost exactly* like the Michelson -contract we saw first, and it accepts the following LIGO expressions: -`Increment(n)`, `Decrement(n)` and `Reset`. Those serve as -`entrypoint` identification, same as `%add` `%sub` or `%default` in -the Michelson contract. - -**The Michelson contract also checks if the `AMOUNT` sent is `0`* - ---- - -## Runnable code snippets & exercises - -Some of the sections in this documentation will include runnable code snippets and exercises. Sources for those are available at -the [LIGO Gitlab repository](https://gitlab.com/ligolang/ligo). - -### Snippets -For example **code snippets** for the *Types* subsection of this doc, can be found here: -`gitlab-pages/docs/language-basics/src/types/**` - -### Exercises -Solutions to exercises can be found e.g. here: `gitlab-pages/docs/language-basics/exercises/types/**/solutions/**` - -### Running snippets / exercise solutions -In certain cases it makes sense to be able to run/evaluate the given snippet or a solution, usually there'll be an example command which you can use, such as: - -```shell -ligo evaluate-value -s pascaligo gitlab-pages/docs/language-basics/src/variables-and-constants/const.ligo age -# Outputs: 25 -``` diff --git a/gitlab-pages/docs/intro/ligo-intro.md b/gitlab-pages/docs/intro/ligo-intro.md new file mode 100644 index 000000000..c66b8b8eb --- /dev/null +++ b/gitlab-pages/docs/intro/ligo-intro.md @@ -0,0 +1,163 @@ +--- +id: introduction +title: Introduction To LIGO +--- + +LIGO is a programming language for writing [Tezos](https://tezos.com/) smart contracts. + +If we had to describe the philosophy of LIGO in a few sentences, it would be this: + +1. Design a clean, simple language with no extraneous parts or additions. + +2. Give that language multiple syntaxes borrowed from other languages so users don't +have to clutter their brain with Yet Another Notation for the same programming +concepts we've been using since the 1980's. + +3. Have that simple language encourage people to write simple code, so that it's +easy to formally verify the compiled output using a project like [Mi-Cho-Coq](https://gitlab.com/nomadic-labs/mi-cho-coq/). + +4. Stop waking up in the morning to find that your smart contract lost all its money +to some [stupid exploit](https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/). + +We can elaborate on each: + +* **Clean and simple** — Programming languages for making video games or websites +tend to prioritize accumulating a vast number of features, they're big languages for +making big projects. You use an army of mediocre programmers to write thousands +and thousands of lines of code, and then accelerate development by including dozens +or hundreds of unvetted dependencies; each of which provides an opportunity to +introduce a security exploit or insert malicious code. That's fine for a game, but +we don't think that's a very intelligent way to write a smart contract. Most useful +smart contracts can express their core functionality in under a thousand lines of +code, and the problem domain necessitates that you get as close as possible to +the minimal code size and resource use. LIGO is a functional language designed +to include the features you need, avoiding patterns that make formal verification +hard. + +* **Multiple Syntaxes** — LIGO provides three syntaxes for users which express the +same underlying language semantics. PascaLIGO is an imperative syntax based on +[Pascal](https://en.wikipedia.org/wiki/Pascal_%28programming_language%29), CameLIGO +is a syntax which closely mimics the look and feel of [OCaml](https://en.wikipedia.org/wiki/OCaml), +and ReasonLIGO is based on Facebook's JavaScript-flavored [ReasonML](https://reasonml.github.io/) syntax. + +* **Simple Code & Formal Verification** — LIGO doesn't use an object oriented paradigm, +currently code is organized using functions. While LIGO plans to have a module system +in the future, it's not the intent that this be used to create npm style cathedrals +of logical mystery meat. Once a contract is put on the blockchain, it's not possible +to change it. A new version can be uploaded, but the original contract remains +available. This makes formal verification of contract logic attractive. When the +cost of bugs is extreme and patches aren't possible it pays to get things right +the first time. + +## LIGO for Programming Smart Contracts on Tezos + +Perhaps the most striking feature of LIGO is that it comes in +different concrete syntaxes, and even different programming +paradigms. In other words, LIGO is not defined by one syntax and one +paradigm, like imperative versus functional. + + - There is **PascaLIGO**, which is inspired by Pascal, hence is an + imperative language with lots of keywords, where values can be + locally mutated after they have been annotated with their types + (declaration). + + - There is **CameLIGO**, which is inspired by the pure subset of + [OCaml](https://ocaml.org/), hence is a functional language with + few keywords, where values cannot be mutated, but still require + type annotations (unlike OCaml, whose compiler performs almost + full type inference). + + - There is **ReasonLIGO**, which is inspired by the pure subset of + [ReasonML](https://reasonml.github.io/), which is based upon + OCaml. + +Let's define some LIGO contract in the three flavours above. Do +not worry if it is a little confusing at first; we will explain all +the syntax in the upcoming sections of the documentation. + + + +```pascaligo group=a +type storage is int + +type parameter is + Increment of int +| Decrement of int +| Reset + +type return is list (operation) * storage + +function main (const action : parameter; const store : storage) : return is + ((nil : list (operation)), + case action of + Increment (n) -> store + n + | Decrement (n) -> store - n + | Reset -> 0 + end) +``` + + +```cameligo group=a +type storage = int + +type parameter = + Increment of int +| Decrement of int +| Reset + +type return = operation list * storage + +let main (action, store : parameter * storage) : return = + ([] : operation list), + (match action with + Increment n -> store + n + | Decrement n -> store - n + | Reset -> 0) +``` + + +```reasonligo group=a +type storage = int; + +type parameter = + Increment (int) +| Decrement (int) +| Reset; + +type return = (list (operation), storage); + +let main = ((action, store): (parameter, storage)) : return => { + (([] : list (operation)), + (switch (action) { + | Increment (n) => store + n + | Decrement (n) => store - n + | Reset => 0})); +}; +``` + + +This LIGO contract accepts the following LIGO expressions: +`Increment(n)`, `Decrement(n)` and `Reset`. Those serve as +`entrypoint` identification. + +--- + +## Runnable code snippets & exercises + +Some of the sections in this documentation will include runnable code snippets and exercises. Sources for those are available at +the [LIGO Gitlab repository](https://gitlab.com/ligolang/ligo). + +### Snippets +For example **code snippets** for the *Types* subsection of this doc, can be found here: +`gitlab-pages/docs/language-basics/src/types/**` + +### Exercises +Solutions to exercises can be found e.g. here: `gitlab-pages/docs/language-basics/exercises/types/**/solutions/**` + +### Running snippets / exercise solutions +In certain cases it makes sense to be able to run/evaluate the given snippet or a solution, usually there'll be an example command which you can use, such as: + +```shell +ligo evaluate-value -s pascaligo gitlab-pages/docs/language-basics/src/variables-and-constants/const.ligo age +# Outputs: 25 +``` diff --git a/gitlab-pages/website/sidebars.json b/gitlab-pages/website/sidebars.json index 1f5fec284..bde7acba5 100644 --- a/gitlab-pages/website/sidebars.json +++ b/gitlab-pages/website/sidebars.json @@ -1,6 +1,6 @@ { "docs": { - "Intro": ["intro/what-and-why", "intro/installation", "intro/editor-support"], + "Intro": ["intro/introduction", "intro/installation", "intro/editor-support"], "Language Basics": [ "language-basics/types", "language-basics/constants-and-variables", @@ -18,7 +18,8 @@ "advanced/timestamps-addresses", "advanced/entrypoints-contracts", "advanced/include", - "advanced/first-contract" + "advanced/first-contract", + "advanced/michelson-and-ligo" ], "API & Reference": [ "api/cli-commands", diff --git a/gitlab-pages/website/siteConfig.js b/gitlab-pages/website/siteConfig.js index d98334e97..9691d6697 100644 --- a/gitlab-pages/website/siteConfig.js +++ b/gitlab-pages/website/siteConfig.js @@ -23,7 +23,7 @@ const siteConfig = { headerLinks: [ { href: 'https://ide.ligolang.org/', label: 'Try Online' }, { doc: 'intro/installation', label: 'Install' }, - { doc: 'intro/what-and-why', label: 'Docs' }, + { doc: 'intro/introduction', label: 'Docs' }, { doc: 'tutorials/get-started/tezos-taco-shop-smart-contract', label: 'Tutorials' From 93682629b4b3dc94974e9ca0c95aae184ce043ce Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Thu, 27 Feb 2020 17:51:29 +0100 Subject: [PATCH 02/40] Updating contracts. --- src/test/contracts/address.mligo | 4 +- src/test/contracts/amount.ligo | 8 +-- src/test/contracts/amount.mligo | 2 +- src/test/contracts/arithmetic.mligo | 27 +++----- src/test/contracts/assert.mligo | 2 +- src/test/contracts/attributes.mligo | 6 +- src/test/contracts/balance_constant.mligo | 11 ++-- src/test/contracts/big_map.mligo | 14 ++--- src/test/contracts/bitwise_arithmetic.mligo | 10 +-- src/test/contracts/boolean_operators.mligo | 15 ++--- src/test/contracts/bytes_arithmetic.mligo | 9 +-- src/test/contracts/bytes_unpack.mligo | 18 +++--- src/test/contracts/check_signature.mligo | 2 +- src/test/contracts/closure.mligo | 12 ++-- src/test/contracts/condition-annot.mligo | 6 +- src/test/contracts/condition-shadowing.mligo | 2 +- src/test/contracts/counter.mligo | 4 +- src/test/contracts/crypto.mligo | 4 +- src/test/contracts/curry.mligo | 10 +-- src/test/contracts/empty_case.mligo | 12 ++-- src/test/contracts/eq_bool.mligo | 2 +- src/test/contracts/failwith.mligo | 4 +- src/test/contracts/fibo.mligo | 12 ++-- src/test/contracts/fibo2.mligo | 12 ++-- src/test/contracts/fibo3.mligo | 12 ++-- src/test/contracts/function-shared.mligo | 6 +- src/test/contracts/guess_string.mligo | 22 +++---- src/test/contracts/option.ligo | 6 +- .../contracts/parser-bad-reported-term.ligo | 6 -- src/test/contracts/procedure.ligo | 11 ---- src/test/contracts/quote-declaration.ligo | 9 +-- src/test/contracts/quote-declarations.ligo | 14 +---- src/test/contracts/record.ligo | 62 +++++-------------- src/test/contracts/redeclaration.ligo | 8 +-- src/test/contracts/replaceable_id.ligo | 40 ++++++------ src/test/contracts/self_address.ligo | 2 +- src/test/contracts/set_arithmetic-1.ligo | 26 ++++---- src/test/contracts/set_arithmetic.ligo | 35 +++++------ src/test/contracts/set_delegate.ligo | 11 ++-- src/test/contracts/shadow.ligo | 3 +- src/test/contracts/simple_access.ligo | 32 +++++----- src/test/contracts/string.ligo | 4 +- src/test/contracts/string_arithmetic.ligo | 4 +- src/test/contracts/super-counter.ligo | 18 +++--- src/test/contracts/tez.ligo | 24 +++---- src/test/contracts/time-lock.ligo | 29 +++++---- src/test/contracts/timestamp.ligo | 3 +- src/test/contracts/toto.ligo | 5 +- src/test/contracts/tuple.ligo | 18 +++--- src/test/contracts/variant-matching.ligo | 10 +-- src/test/contracts/variant.ligo | 2 +- src/test/contracts/website1.ligo | 4 +- src/test/contracts/website2.ligo | 20 +++--- 53 files changed, 288 insertions(+), 366 deletions(-) delete mode 100644 src/test/contracts/parser-bad-reported-term.ligo delete mode 100644 src/test/contracts/procedure.ligo diff --git a/src/test/contracts/address.mligo b/src/test/contracts/address.mligo index 3651ea223..2b24b7d08 100644 --- a/src/test/contracts/address.mligo +++ b/src/test/contracts/address.mligo @@ -1,3 +1,3 @@ let main (p : key_hash) = - let c : unit contract = Current.implicit_account p in - Current.address c \ No newline at end of file + let c : unit contract = Current.implicit_account p + in Current.address c diff --git a/src/test/contracts/amount.ligo b/src/test/contracts/amount.ligo index 8d4961be8..9c0263635 100644 --- a/src/test/contracts/amount.ligo +++ b/src/test/contracts/amount.ligo @@ -1,8 +1,8 @@ -function check (const p: unit) : int is - begin +function check (const p : unit) : int is + block { var result : int := 0; - if amount = 100tz then + if Tezos.amount = 100tz then result := 42 else result := 0 - end with result + } with result diff --git a/src/test/contracts/amount.mligo b/src/test/contracts/amount.mligo index 8e31e2d0c..a2db44946 100644 --- a/src/test/contracts/amount.mligo +++ b/src/test/contracts/amount.mligo @@ -1 +1 @@ -let check_ (p: unit) : int = if Current.amount = 100tz then 42 else 0 +let check = if Tezos.amount > 100tez then 42 else 0 diff --git a/src/test/contracts/arithmetic.mligo b/src/test/contracts/arithmetic.mligo index e3bb8ba07..66c241f86 100644 --- a/src/test/contracts/arithmetic.mligo +++ b/src/test/contracts/arithmetic.mligo @@ -1,30 +1,17 @@ // Test CameLIGO arithmetic operators -let mod_op (n : int) : nat = - n mod 42 +let mod_op (n : int) : nat = n mod 42 -let plus_op (n : int) : int = - n + 42 +let plus_op (n : int) : int = n + 42 -let minus_op (n : int) : int = - n - 42 +let minus_op (n : int) : int = n - 42 -let times_op (n : int) : int = - n * 42 +let times_op (n : int) : int = n * 42 -let div_op (n : int) : int = - n / 2 +let div_op (n : int) : int = n / 2 -(* TODO (?): Support conversion from nat to int and back - -let int_op (n : nat) : int = - Int n - -*) - -let neg_op (n : int) : int = - -n +let neg_op (n : int) : int = -n let foo (n : int) : int = n + 10 -let neg_op_2 (b: int) : int = -(foo b) +let neg_op_2 (b : int) : int = -(foo b) diff --git a/src/test/contracts/assert.mligo b/src/test/contracts/assert.mligo index 143f7066f..41785c58d 100644 --- a/src/test/contracts/assert.mligo +++ b/src/test/contracts/assert.mligo @@ -1,3 +1,3 @@ -let main (p, s: bool * unit) = +let main (p, s : bool * unit) = let u : unit = assert p in ([] : operation list), s diff --git a/src/test/contracts/attributes.mligo b/src/test/contracts/attributes.mligo index 8f582a725..a96d63710 100644 --- a/src/test/contracts/attributes.mligo +++ b/src/test/contracts/attributes.mligo @@ -1,10 +1,10 @@ let x = 1 [@@inline] -let foo (a: int): int = +let foo (a : int): int = (let test = 2 + a [@@inline] in test) [@@inline] let y = 1 [@@inline][@@other] -let bar (b: int): int = - let test = fun (z: int) -> 2 + b + z [@@inline][@@foo][@@bar] +let bar (b : int): int = + let test = fun (z : int) -> 2 + b + z [@@inline][@@foo][@@bar] in test b diff --git a/src/test/contracts/balance_constant.mligo b/src/test/contracts/balance_constant.mligo index c364d2bce..b73319f8f 100644 --- a/src/test/contracts/balance_constant.mligo +++ b/src/test/contracts/balance_constant.mligo @@ -1,17 +1,16 @@ -(** - +(* This test makes sure that the balance is accessible in CameLIGO. -It's there to detect a regression of: https://gitlab.com/ligolang/ligo/issues/61 -Which results in this error when you attempt to compile this contract: +It is there to detect a regression of: +https://gitlab.com/ligolang/ligo/issues/61 + +which results in this error when you attempt to compile this contract: generated. unrecognized constant: {"constant":"BALANCE","location":"generated"} - *) type storage = tez let main (p, s : unit * storage) = ([] : operation list), balance - diff --git a/src/test/contracts/big_map.mligo b/src/test/contracts/big_map.mligo index 35a173f82..434878013 100644 --- a/src/test/contracts/big_map.mligo +++ b/src/test/contracts/big_map.mligo @@ -2,22 +2,20 @@ type foo = (int, int) big_map let set_ (n, m: int * foo) : foo = Big_map.update 23 (Some n) m -let add (n,m : int * foo) : foo = Big_map.add 23 n m +let add (n, m : int * foo) : foo = Big_map.add 23 n m let rm (m : foo) : foo = Big_map.remove 42 m let gf (m : foo) : int = Big_map.find 23 m -let get (m: foo): int option = Big_map.find_opt 42 m +let get (m : foo): int option = Big_map.find_opt 42 m let empty_map : foo = Big_map.empty -let map1 : foo = Big_map.literal - [ (23 , 0) ; (42, 0) ] +let map1 : foo = Big_map.literal [(23,0); (42,0)] -let map1 : foo = Big_map.literal - [ (23 , 0) ; (42, 0) ] +let map1 : foo = Big_map.literal [(23,0); (42,0)] let mutimaps (m : foo) (n : foo) : foo = - let bar : foo = Big_map.update 42 (Some 0) m in - Big_map.update 42 (get bar) n + let bar : foo = Big_map.update 42 (Some 0) m + in Big_map.update 42 (get bar) n diff --git a/src/test/contracts/bitwise_arithmetic.mligo b/src/test/contracts/bitwise_arithmetic.mligo index d79cbe348..5675df1b8 100644 --- a/src/test/contracts/bitwise_arithmetic.mligo +++ b/src/test/contracts/bitwise_arithmetic.mligo @@ -1,7 +1,7 @@ (* Test CameLIGO bitwise operators *) -let or_op (n: nat) : nat = Bitwise.or n 4n -let and_op (n: nat) : nat = Bitwise.and n 7n -let xor_op (n: nat) : nat = Bitwise.xor n 7n -let lsl_op (n: nat) : nat = Bitwise.shift_left n 7n -let lsr_op (n: nat) : nat = Bitwise.shift_right n 7n +let or_op (n : nat) : nat = Bitwise.lor n 4n +let and_op (n : nat) : nat = Bitwise.land n 7n +let xor_op (n : nat) : nat = Bitwise.lxor n 7n +let lsl_op (n : nat) : nat = Bitwise.shift_left n 7n +let lsr_op (n : nat) : nat = Bitwise.shift_right n 7n diff --git a/src/test/contracts/boolean_operators.mligo b/src/test/contracts/boolean_operators.mligo index 7eb3cfd69..63091dbf8 100644 --- a/src/test/contracts/boolean_operators.mligo +++ b/src/test/contracts/boolean_operators.mligo @@ -1,16 +1,11 @@ // Test CameLIGO boolean operators -let or_true (b : bool) : bool = - b || true +let or_true (b : bool) : bool = b || true -let or_false (b : bool) : bool = - b || false +let or_false (b : bool) : bool = b || false -let and_true (b : bool) : bool = - b && true +let and_true (b : bool) : bool = b && true -let and_false (b : bool) : bool = - b && false +let and_false (b : bool) : bool = b && false -let not_bool (b: bool) : bool = - not b +let not_bool (b : bool) : bool = not b diff --git a/src/test/contracts/bytes_arithmetic.mligo b/src/test/contracts/bytes_arithmetic.mligo index 4d71994a2..44d89cb36 100644 --- a/src/test/contracts/bytes_arithmetic.mligo +++ b/src/test/contracts/bytes_arithmetic.mligo @@ -1,8 +1,5 @@ -let concat_op (s : bytes) : bytes = - Bytes.concat s 0x7070 +let concat_op (s : bytes) : bytes = Bytes.concat s 0x7070 -let slice_op (s : bytes) : bytes = - Bytes.slice 1n 2n s +let slice_op (s : bytes) : bytes = Bytes.slice 1n 2n s -let hasherman (s : bytes) : bytes = - Crypto.sha256 s +let hasherman (s : bytes) : bytes = Crypto.sha256 s diff --git a/src/test/contracts/bytes_unpack.mligo b/src/test/contracts/bytes_unpack.mligo index e33f09b47..56028af77 100644 --- a/src/test/contracts/bytes_unpack.mligo +++ b/src/test/contracts/bytes_unpack.mligo @@ -1,11 +1,11 @@ -let id_string (p: string) : string option = - let packed: bytes = Bytes.pack p in - ((Bytes.unpack packed): string option) +let id_string (p : string) : string option = + let packed : bytes = Bytes.pack p in + (Bytes.unpack packed : string option) -let id_int (p: int) : int option = - let packed: bytes = Bytes.pack p in - ((Bytes.unpack packed): int option) +let id_int (p : int) : int option = + let packed : bytes = Bytes.pack p in + (Bytes.unpack packed : int option) -let id_address (p: address) : address option = - let packed: bytes = Bytes.pack p in - ((Bytes.unpack packed): address option) +let id_address (p : address) : address option = + let packed : bytes = Bytes.pack p in + (Bytes.unpack packed : address option) diff --git a/src/test/contracts/check_signature.mligo b/src/test/contracts/check_signature.mligo index ecd56eb4b..93218ee0f 100644 --- a/src/test/contracts/check_signature.mligo +++ b/src/test/contracts/check_signature.mligo @@ -1,2 +1,2 @@ -let check_signature (pk, signed, msg: key * signature * bytes) : bool = +let check_signature (pk, signed, msg : key * signature * bytes) : bool = Crypto.check pk signed msg diff --git a/src/test/contracts/closure.mligo b/src/test/contracts/closure.mligo index ee5f616ae..ddd866df7 100644 --- a/src/test/contracts/closure.mligo +++ b/src/test/contracts/closure.mligo @@ -1,9 +1,7 @@ (* Test whether closures retain values in CameLIGO *) -let test (k: int) : int = - let j: int = k + 5 in - let close: (int -> int) = - fun (i: int) -> i + j - in - let j: int = 20 in (* Shadow original variable to see if value close'd *) - close 20 +let test (k : int) : int = + let j : int = k + 5 in + let close : int -> int = fun (i : int) -> i + j in + let j : int = 20 (* Shadow original variable *) + in close 20 diff --git a/src/test/contracts/condition-annot.mligo b/src/test/contracts/condition-annot.mligo index 697329fcb..93aece587 100644 --- a/src/test/contracts/condition-annot.mligo +++ b/src/test/contracts/condition-annot.mligo @@ -1,2 +1,4 @@ -let main (i: int) = - if (i=2 : bool) then (42: int) else (0: int) +type integer is int + +let main (i : int) = + if (i = 2 : bool) then (42 : int) else (0 : integer) diff --git a/src/test/contracts/condition-shadowing.mligo b/src/test/contracts/condition-shadowing.mligo index c4dbbbb7b..97ee6eb51 100644 --- a/src/test/contracts/condition-shadowing.mligo +++ b/src/test/contracts/condition-shadowing.mligo @@ -1,6 +1,6 @@ (* TODO : make a test using mutation, not shadowing *) -let main (i: int) = +let main (i : int) = let result = 0 in if i = 2 then let result = 42 in result diff --git a/src/test/contracts/counter.mligo b/src/test/contracts/counter.mligo index 615dfa62a..548a1e07e 100644 --- a/src/test/contracts/counter.mligo +++ b/src/test/contracts/counter.mligo @@ -1,4 +1,4 @@ type storage = int -let main (ps: int * storage) = - (([] : operation list) , ps.0 + ps.1) +let main (ps : int * storage) = + ([] : operation list), ps.0 + ps.1 diff --git a/src/test/contracts/crypto.mligo b/src/test/contracts/crypto.mligo index 9fa7e99e8..902cd088e 100644 --- a/src/test/contracts/crypto.mligo +++ b/src/test/contracts/crypto.mligo @@ -1,2 +1,2 @@ -let hasherman512 (s: bytes) : bytes = Crypto.sha512 s -let hasherman_blake (s: bytes) : bytes = Crypto.blake2b s +let hasherman512 (s : bytes) : bytes = Crypto.sha512 s +let hasherman_blake (s : bytes) : bytes = Crypto.blake2b s diff --git a/src/test/contracts/curry.mligo b/src/test/contracts/curry.mligo index eee47985a..ffcaafe15 100644 --- a/src/test/contracts/curry.mligo +++ b/src/test/contracts/curry.mligo @@ -1,9 +1,9 @@ -let conv_test (j: int) (k: int) = j + k +let conv_test (j : int) (k : int) = j + k -let main (i: int) : int = conv_test i 10 +let main (i : int) : int = conv_test i 10 -let partial (a: int) (b: int) : int = a + b +let partial (a : int) (b : int) : int = a + b -let mk_partial (j: int) : (int -> int) = partial j +let mk_partial (j : int) : int -> int = partial j -let partial_apply (i: int) : int = (mk_partial 10) i +let partial_apply (i : int) : int = mk_partial 10 i diff --git a/src/test/contracts/empty_case.mligo b/src/test/contracts/empty_case.mligo index 844897f01..4d08d9c3c 100644 --- a/src/test/contracts/empty_case.mligo +++ b/src/test/contracts/empty_case.mligo @@ -1,8 +1,8 @@ type foo = - | Bar of int - | Baz + Bar of int +| Baz -let main (f: foo): int = - match f with - | Bar i -> i - | Baz -> -1 \ No newline at end of file +let main (f : foo) : int = + match f with + Bar i -> i + | Baz -> -1 diff --git a/src/test/contracts/eq_bool.mligo b/src/test/contracts/eq_bool.mligo index 6869d5dfd..ef2aefe55 100644 --- a/src/test/contracts/eq_bool.mligo +++ b/src/test/contracts/eq_bool.mligo @@ -1,3 +1,3 @@ // Test conditional in CameLIGO -let main (a , b : bool * bool) = if a = b then 999 else 1 +let main (a, b : bool * bool) = if a = b then 999 else 1 diff --git a/src/test/contracts/failwith.mligo b/src/test/contracts/failwith.mligo index fbc5976bd..2938a703d 100644 --- a/src/test/contracts/failwith.mligo +++ b/src/test/contracts/failwith.mligo @@ -1,4 +1,4 @@ type storage = unit -let main (p: unit) storage = - if true then failwith "This contract always fails" else () +let main (p : unit; store : storage) : operation list * storage = + if true then failwith "This contract always fails" diff --git a/src/test/contracts/fibo.mligo b/src/test/contracts/fibo.mligo index fa345f653..3d2e3a687 100644 --- a/src/test/contracts/fibo.mligo +++ b/src/test/contracts/fibo.mligo @@ -1,7 +1,9 @@ type storage = unit -let main (p: unit) storage = - (fun (f: (int * int) -> int) (x: int) (y: int) -> f (y,x)) - (fun (x: int) (y: int) -> x + y) - 0 - 1 +let main (p : unit; store : storage) : operation list * storage = + let n = + (fun (f : int * int -> int) (x : int) (y : int) -> f (y,x)) + (fun (x : int) (y : int) -> x + y) + 0 + 1 + in ([] : operation list), store diff --git a/src/test/contracts/fibo2.mligo b/src/test/contracts/fibo2.mligo index 0b12826fc..f41ee0e3d 100644 --- a/src/test/contracts/fibo2.mligo +++ b/src/test/contracts/fibo2.mligo @@ -1,7 +1,9 @@ type storage = unit -let main (p: unit) storage = - (fun (f: int -> int) (_: int) (y: int) -> f y) - (fun (x: int) -> x) - 0 - 1 +let main (p : unit; store : storage) : operation list * storage = + let n = + (fun (f : int -> int) (z : int) (y : int) -> f y) + (fun (x : int) -> x) + 0 + 1 + in ([] : operation list), store diff --git a/src/test/contracts/fibo3.mligo b/src/test/contracts/fibo3.mligo index 1310bfa10..836f24517 100644 --- a/src/test/contracts/fibo3.mligo +++ b/src/test/contracts/fibo3.mligo @@ -1,7 +1,9 @@ type storage = unit -let main (p: unit) storage = - (fun (f: int -> int -> int) (x: int) (y: int) -> f y (x+y)) - (fun (x: int) (y: int) -> x + y) - 0 - 1 +let main (p : unit; store : storage) : operation list * storage = + let n = + (fun (f : int -> int -> int) (x : int) (y : int) -> f y (x+y)) + (fun (x : int) (y : int) -> x + y) + 0 + 1 + in ([] : operation list), store diff --git a/src/test/contracts/function-shared.mligo b/src/test/contracts/function-shared.mligo index 3568f0b3a..e8f70f6bd 100644 --- a/src/test/contracts/function-shared.mligo +++ b/src/test/contracts/function-shared.mligo @@ -1,7 +1,7 @@ (* Test use of multiple subroutines in a CameLIGO function *) -let foo (i: int) : int = i + 20 +let foo (i : int) : int = i + 20 -let bar (i: int) : int = i + 50 +let bar (i : int) : int = i + 50 -let foobar (i: int) : int = (foo i) + (bar i) +let foobar (i : int) : int = foo i + bar i diff --git a/src/test/contracts/guess_string.mligo b/src/test/contracts/guess_string.mligo index 3921d4108..adde5b642 100644 --- a/src/test/contracts/guess_string.mligo +++ b/src/test/contracts/guess_string.mligo @@ -1,20 +1,18 @@ type storage = { - challenge : string; + challenge : string } type param = { new_challenge : string; - attempt : string; + attempt : string } -let attempt (p: param) storage = - (* if p.attempt <> storage.challenge then failwith "Failed challenge" else *) - let contract : unit contract = - Operation.get_contract sender in +type return = operation list * storage + +let attempt (p: param; store : storage) : return = + (* if p.attempt <> store.challenge then failwith "Failed challenge" else *) + let contract : unit contract = Operation.get_contract sender in let transfer : operation = - Operation.transaction (unit , contract , 10.00tz) in - (* TODO: no syntax for functional updates yet *) - (* let storage : storage = { storage with challenge = p.new_challenge } in *) - (* for now, rebuild the record by hand. *) - let storage : storage = { challenge = p.new_challenge } - in ([] : operation list), storage + Operation.transaction (unit, contract, 10.00tez) in + let store : storage = {challenge = p.new_challenge} + in ([] : operation list), store diff --git a/src/test/contracts/option.ligo b/src/test/contracts/option.ligo index 424171c93..39614435d 100644 --- a/src/test/contracts/option.ligo +++ b/src/test/contracts/option.ligo @@ -1,13 +1,13 @@ // Test the option type in PascaLIGO -type foobar is option(int) +type foobar is option (int) -const s : foobar = Some(42) +const s : foobar = Some (42) const n : foobar = None function assign (var m : int) : foobar is block { var coco : foobar := None; - coco := Some(m); + coco := Some (m); coco := (None : foobar); //temporary annotation added until type inference } with coco diff --git a/src/test/contracts/parser-bad-reported-term.ligo b/src/test/contracts/parser-bad-reported-term.ligo deleted file mode 100644 index 05dc69e3e..000000000 --- a/src/test/contracts/parser-bad-reported-term.ligo +++ /dev/null @@ -1,6 +0,0 @@ -function f (const x : unit) : unit is - begin skip end with unit - -function main (const p : unit ; const s : unit) : unit is - behin skip end with f unit -// the srcloc is correct but the reported term is "skip" instead of "behin". diff --git a/src/test/contracts/procedure.ligo b/src/test/contracts/procedure.ligo deleted file mode 100644 index a0f6664c6..000000000 --- a/src/test/contracts/procedure.ligo +++ /dev/null @@ -1,11 +0,0 @@ -// Test a trivial PascaLIGO procedure - -procedure sub (const j: int) is - begin - i := i + 1 - end - -function main (const i: int) : int is - begin - sub(i) - end with i diff --git a/src/test/contracts/quote-declaration.ligo b/src/test/contracts/quote-declaration.ligo index 4c5547d4c..d11fa919b 100644 --- a/src/test/contracts/quote-declaration.ligo +++ b/src/test/contracts/quote-declaration.ligo @@ -1,8 +1,3 @@ -function foo (const input : int) : int is begin - skip -end with (input + 42) +function foo (const input : int) : int is input + 42 -function main (const i : int) : int is - begin - skip - end with i + foo (i) +function main (const i : int) : int is i + foo (i) diff --git a/src/test/contracts/quote-declarations.ligo b/src/test/contracts/quote-declarations.ligo index 1b783066d..d98fbe15a 100644 --- a/src/test/contracts/quote-declarations.ligo +++ b/src/test/contracts/quote-declarations.ligo @@ -1,13 +1,5 @@ -function foo (const input : int) : int is begin - skip -end with (input + 23) +function foo (const input : int) : int is input + 23 -function bar (const input : int) : int is begin - skip -end with (input + 51) +function bar (const input : int) : int is input + 51 - -function main (const i : int) : int is - begin - skip - end with foo (i) + bar (i) +function main (const i : int) : int is foo (i) + bar (i) diff --git a/src/test/contracts/record.ligo b/src/test/contracts/record.ligo index 94b49d9fc..1cc6ad2a2 100644 --- a/src/test/contracts/record.ligo +++ b/src/test/contracts/record.ligo @@ -1,68 +1,38 @@ // Test record type in PascaLIGO -type foobar is record - foo : int ; - bar : int ; -end +type foobar is record [foo : int; bar : int] -const fb : foobar = record - foo = 0 ; - bar = 0 ; -end +const fb : foobar = record [foo = 0; bar = 0] -type abc is record - a : int ; - b : int ; - c : int ; -end +type abc is record [a : int; b : int; c : int] -const abc : abc = record - a = 42 ; - b = 142 ; - c = 242 ; -end +const abc : abc = record [a = 42; b = 142; c = 242] -const a : int = abc.a ; -const b : int = abc.b ; -const c : int = abc.c ; +const a : int = abc.a +const b : int = abc.b +const c : int = abc.c -function projection (const r : foobar) : int is - begin - skip - end with r.foo + r.bar +function projection (const r : foobar) : int is r.foo + r.bar -function modify (const r : foobar) : foobar is +function modify (var r : foobar) : foobar is block { - r.foo := 256 ; + r.foo := 256 } with r function modify_abc (const r : abc) : abc is block { const c : int = 42; - r := r with record b = 2048; c = c; end; + r := r with record [b=2048; c=c] } with r -type big_record is record - a : int ; - b : int ; - c : int ; - d : int ; - e : int ; -end +type big_record is record [a : int; b : int; c : int; d : int; e : int] -const br : big_record = record - a = 23 ; - b = 23 ; - c = 23 ; - d = 23 ; - e = 23 ; -end +const br : big_record = + record [a = 23; b = 23; c = 23; d = 23; e = 23] -type double_record is record - inner : abc; -end +type double_record is record [inner : abc] function modify_inner (const r : double_record) : double_record is block { - r := r with record inner.b = 2048; end; + r := r with record [inner.b = 2048] } with r diff --git a/src/test/contracts/redeclaration.ligo b/src/test/contracts/redeclaration.ligo index c74594ad3..b8bcecbc2 100644 --- a/src/test/contracts/redeclaration.ligo +++ b/src/test/contracts/redeclaration.ligo @@ -1,6 +1,6 @@ -function foo(const p : unit) : int is 0 +function foo (const p : unit) : int is 0 -function main(const p : unit; const s : int) : list(operation) * int is - ((list end : list(operation)), foo(unit)) +function main (const p : unit; const s : int) : list (operation) * int is + ((nil : list (operation)), foo (unit)) -function foo(const p : unit) : int is 1 \ No newline at end of file +function foo (const p : unit) : int is 1 diff --git a/src/test/contracts/replaceable_id.ligo b/src/test/contracts/replaceable_id.ligo index 3b116e69b..8e46cde84 100644 --- a/src/test/contracts/replaceable_id.ligo +++ b/src/test/contracts/replaceable_id.ligo @@ -1,35 +1,35 @@ // storage type -type storage_t is address; +type storage_t is address // entry points parameter types type change_addr_pt is address -type message_t is list (operation) ; -type pass_message_pt is (unit -> message_t) +type message_t is list (operation) +type pass_message_pt is unit -> message_t -type contract_return_t is (list(operation) * storage_t) +type contract_return_t is list (operation) * storage_t type entry_point_t is -| Change_address of change_addr_pt -| Pass_message of pass_message_pt + Change_address of change_addr_pt +| Pass_message of pass_message_pt function change_address (const param : change_addr_pt; const s : storage_t) : contract_return_t is - begin - if sender =/= s then failwith("Unauthorized sender") + block { + if sender =/= s then failwith ("Unauthorized sender") else skip -end with ((nil : list(operation)), param) + } with ((nil : list (operation)), param) -function pass_message ( const param: pass_message_pt; - const s : storage_t ) : contract_return_t is - begin - if sender =/= s then failwith("Unauthorized sender") else skip ; - var message : pass_message_pt := param ; -end with (param(unit),s) +function pass_message (const param: pass_message_pt; + const s : storage_t ) : contract_return_t is + block { + if sender =/= s then failwith("Unauthorized sender") else skip; + var message : pass_message_pt := param + } with (param (unit), s) -function main(const param : entry_point_t; const s : storage_t) : contract_return_t is -block {skip} with +function main (const param : entry_point_t; const s : storage_t) : + contract_return_t is case param of - | Change_address (p) -> change_address(p,s) - | Pass_message (p) -> pass_message(p,s) -end \ No newline at end of file + Change_address (p) -> change_address (p,s) + | Pass_message (p) -> pass_message (p,s) + end diff --git a/src/test/contracts/self_address.ligo b/src/test/contracts/self_address.ligo index 72872ce0f..e6f440a7e 100644 --- a/src/test/contracts/self_address.ligo +++ b/src/test/contracts/self_address.ligo @@ -1 +1 @@ -function main (const p: unit) : address is self_address +function main (const p : unit) : address is self_address diff --git a/src/test/contracts/set_arithmetic-1.ligo b/src/test/contracts/set_arithmetic-1.ligo index 87e2621b2..4ad3b13cf 100644 --- a/src/test/contracts/set_arithmetic-1.ligo +++ b/src/test/contracts/set_arithmetic-1.ligo @@ -1,17 +1,17 @@ // Test set iteration in PascaLIGO -function iter_op (const s : set(int)) : int is - begin - var r : int := 0 ; - function aggregate (const i : int) : unit is - begin - r := r + i ; - end with unit ; - set_iter(aggregate, s) ; - end with r - -function fold_op (const s : set(int)) : int is +function iter_op (const s : set (int)) : int is block { - function aggregate (const i : int ; const j : int) : int is + var r : int := 0; + function aggregate (const i : int) : unit is + block { + r := r + i + } with unit; + set_iter (aggregate, s) + } with r // ALWAYS RETURNS 0 + +function fold_op (const s : set (int)) : int is + block { + function aggregate (const i : int; const j : int) : int is i + j - } with set_fold(aggregate, s , 15) + } with set_fold (aggregate, s, 15) diff --git a/src/test/contracts/set_arithmetic.ligo b/src/test/contracts/set_arithmetic.ligo index eb0f8cf9e..2c801abbe 100644 --- a/src/test/contracts/set_arithmetic.ligo +++ b/src/test/contracts/set_arithmetic.ligo @@ -1,30 +1,27 @@ // Test set type and basic operations in PascaLIGO -const s_e : set(string) = (set_empty : set(string)) +const s_e : set (string) = set_empty -const s_fb : set(string) = set [ - "foo" ; - "bar" ; -] +const s_fb : set (string) = set ["foo"; "bar"] -function add_op (const s : set(string)) : set(string) is - begin skip end with set_add("foobar" , s) +function add_op (const s : set (string)) : set (string) is + set_add ("foobar", s) -function remove_op (const s : set(string)) : set(string) is - begin skip end with set_remove("foobar" , s) +function remove_op (const s : set (string)) : set (string) is + set_remove ("foobar", s) // Test the PascaLIGO syntactic sugar for set removal vs. the function call -function remove_syntax (var s : set(string)) : set(string) is - begin remove "foobar" from set s; end with s +function remove_syntax (var s : set (string)) : set (string) is + block {remove "foobar" from set s} with s -function remove_deep (var s : set(string) * nat) : set(string) * nat is - begin remove "foobar" from set s.0; end with s +function remove_deep (var s : set (string) * nat) : set (string) * nat is + block {remove "foobar" from set s.0} with s -function patch_op (var s: set(string)) : set(string) is - begin patch s with set ["foobar"]; end with s +function patch_op (var s : set (string)) : set (string) is + block {patch s with set ["foobar"]} with s -function patch_op_deep (var s: set(string)*nat) : set(string)*nat is - begin patch s.0 with set ["foobar"]; end with s +function patch_op_deep (var s : set (string) * nat) : set (string) * nat is + block {patch s.0 with set ["foobar"]} with s -function mem_op (const s : set(string)) : bool is - begin skip end with set_mem("foobar" , s) +function mem_op (const s : set (string)) : bool is + set_mem ("foobar", s) diff --git a/src/test/contracts/set_delegate.ligo b/src/test/contracts/set_delegate.ligo index 32f571741..dfdc7a0ef 100644 --- a/src/test/contracts/set_delegate.ligo +++ b/src/test/contracts/set_delegate.ligo @@ -1,6 +1,5 @@ -function main (const p: key_hash) : list(operation) is - begin - const unused: operation = set_delegate(Some(p)) ; - const dummy: list(operation) = nil; - end with dummy - +function main (const p : key_hash) : list (operation) is + block { + const unused : operation = set_delegate (Some (p)); + const dummy : list (operation) = nil + } with dummy diff --git a/src/test/contracts/shadow.ligo b/src/test/contracts/shadow.ligo index a1891c651..a170b6d43 100644 --- a/src/test/contracts/shadow.ligo +++ b/src/test/contracts/shadow.ligo @@ -1,5 +1,4 @@ function foo (const i : int) : int is block { - function bar (const i : int) : int is - i ; + function bar (const i : int) : int is i } with bar (0) diff --git a/src/test/contracts/simple_access.ligo b/src/test/contracts/simple_access.ligo index e26e23bc7..9a5c585a3 100644 --- a/src/test/contracts/simple_access.ligo +++ b/src/test/contracts/simple_access.ligo @@ -1,21 +1,21 @@ -//Test simple_access in PascalLigo -type tpi is (int*int) -type rpi is record -x : int; -y : int; -end -type mpi is map(string,int) +//Test simple_access in PascaLIGO + +type tpi is int * int + +type rpi is record [x : int; y : int] + +type mpi is map (string, int) function main (const toto : tpi) : int is - begin + block { var a : tpi := toto; - var b : rpi := record x = 0; y=1 ; end; - var m : mpi := map "y" -> 1; end; + var b : rpi := record [x=0; y=1]; + var m : mpi := map ["y" -> 1]; a.0 := 2; b.x := a.0; - m["x"] := b.x; - end with - case m["x"] of - | Some (s) -> s - | None -> 42 - end + m["x"] := b.x + } with + case m["x"] of + Some (s) -> s + | None -> 42 + end diff --git a/src/test/contracts/string.ligo b/src/test/contracts/string.ligo index 846daf7e5..c563cd16c 100644 --- a/src/test/contracts/string.ligo +++ b/src/test/contracts/string.ligo @@ -1,3 +1,3 @@ const s : string = "toto" -const x : string = s^"bar" -const y : string = "foo"^x +const x : string = s ^ "bar" +const y : string = "foo" ^ x diff --git a/src/test/contracts/string_arithmetic.ligo b/src/test/contracts/string_arithmetic.ligo index c8ceacb01..d76fd041d 100644 --- a/src/test/contracts/string_arithmetic.ligo +++ b/src/test/contracts/string_arithmetic.ligo @@ -1,5 +1,5 @@ function concat_op (const s : string) : string is - begin skip end with string_concat(s , "toto") + string_concat (s, "toto") function slice_op (const s : string) : string is - begin skip end with string_slice(1n , 2n , s) + string_slice (1n, 2n, s) diff --git a/src/test/contracts/super-counter.ligo b/src/test/contracts/super-counter.ligo index fcfa8422e..5bdde86d0 100644 --- a/src/test/contracts/super-counter.ligo +++ b/src/test/contracts/super-counter.ligo @@ -1,10 +1,14 @@ type action is -| Increment of int + Increment of int | Decrement of int -function main (const p : action ; const s : int) : (list(operation) * int) is - block {skip} with ((nil : list(operation)), - case p of - | Increment (n) -> s + n - | Decrement (n) -> s - n - end) +type storage is int + +type return is list (operation) * storage + +function main (const p : action; const s : int) : return is + ((nil : list (operation)), + case p of + Increment (n) -> s + n + | Decrement (n) -> s - n + end) diff --git a/src/test/contracts/tez.ligo b/src/test/contracts/tez.ligo index 31d5915cf..d39524d2b 100644 --- a/src/test/contracts/tez.ligo +++ b/src/test/contracts/tez.ligo @@ -1,16 +1,18 @@ -const add_tez : tez = 21mutez + 0.000021tz; -const sub_tez : tez = 21mutez - 20mutez; +const add_tez : tez = 21mutez + 0.000_021tez + +const sub_tez : tez = 21mutez - 20mutez + (* This is not enough. *) -const not_enough_tez : tez = 4611686018427387903mutez; +const not_enough_tez : tez = 461_168_601_842_738_7903mutez -const nat_mul_tez : tez = 1n * 100mutez; -const tez_mul_nat : tez = 100mutez * 10n; +const nat_mul_tez : tez = 1n * 100mutez +const tez_mul_nat : tez = 100mutez * 10n -const tez_div_tez1 : nat = 100mutez / 1mutez; -const tez_div_tez2 : nat = 100mutez / 90mutez; -const tez_div_tez3 : nat = 100mutez / 110mutez; +const tez_div_tez1 : nat = 100mutez / 1mutez +const tez_div_tez2 : nat = 100mutez / 90mutez +const tez_div_tez3 : nat = 100mutez / 110mutez -const tez_mod_tez1 : tez = 100mutez mod 1mutez; -const tez_mod_tez2 : tez = 100mutez mod 90mutez; -const tez_mod_tez3 : tez = 100mutez mod 110mutez; +const tez_mod_tez1 : tez = 100mutez mod 1mutez +const tez_mod_tez2 : tez = 100mutez mod 90mutez +const tez_mod_tez3 : tez = 100mutez mod 110mutez diff --git a/src/test/contracts/time-lock.ligo b/src/test/contracts/time-lock.ligo index c45f40a23..24065e25a 100644 --- a/src/test/contracts/time-lock.ligo +++ b/src/test/contracts/time-lock.ligo @@ -1,25 +1,28 @@ type storage_t is timestamp -type message_t is (unit -> list(operation)) +type message_t is unit -> list (operation) type default_pt is unit type call_pt is message_t -type contract_return_t is (list(operation) * storage_t) +type contract_return_t is list (operation) * storage_t type entry_point_t is | Call of call_pt | Default of default_pt -function call (const p : call_pt; const s : storage_t) : contract_return_t is block { - if s >= now then failwith("Contract is still time locked") else skip ; - const message : message_t = p ; - const ret_ops : list(operation) = message(unit) ; -} with (ret_ops,s) +function call (const p : call_pt; const s : storage_t) : contract_return_t is + block { + if s >= now then failwith ("Contract is still time locked") else skip; + const message : message_t = p; + const ret_ops : list (operation) = message (unit) + } with (ret_ops, s) -function default (const p : default_pt; const s : storage_t) : contract_return_t is - ((nil: list(operation)) , s) +function default (const p : default_pt; const s : storage_t) : + contract_return_t is + ((nil : list (operation)), s) -function main(const param : entry_point_t; const s : storage_t) : contract_return_t is +function main(const param : entry_point_t; const s : storage_t) : + contract_return_t is case param of - | Call (p) -> call(p,s) - | Default (p) -> default(p,s) -end \ No newline at end of file + Call (p) -> call (p,s) + | Default (p) -> default (p,s) + end diff --git a/src/test/contracts/timestamp.ligo b/src/test/contracts/timestamp.ligo index 4e105c45f..7d176cda8 100644 --- a/src/test/contracts/timestamp.ligo +++ b/src/test/contracts/timestamp.ligo @@ -1,3 +1,4 @@ type storage_ is timestamp -function main(const p : unit; const s : storage_) : list(operation) * storage_ is ((nil: list(operation)), now) \ No newline at end of file +function main (const p : unit; const s : storage_) : + list (operation) * storage_ is ((nil: list (operation)), now) diff --git a/src/test/contracts/toto.ligo b/src/test/contracts/toto.ligo index 785655b4a..6fd888e1c 100644 --- a/src/test/contracts/toto.ligo +++ b/src/test/contracts/toto.ligo @@ -1,6 +1,3 @@ -type toto is record - a : nat ; - b : nat -end +type toto is record [a : nat; b : nat] const foo : int = 3 diff --git a/src/test/contracts/tuple.ligo b/src/test/contracts/tuple.ligo index 9a39cde03..afe953345 100644 --- a/src/test/contracts/tuple.ligo +++ b/src/test/contracts/tuple.ligo @@ -1,22 +1,18 @@ -type abc is (int * int * int) +type abc is int * int * int -function projection_abc (const tpl : abc) : int is - block { skip } with tpl.1 +function projection_abc (const tpl : abc) : int is tpl.1 function modify_abc (const tpl : abc) : abc is block { - tpl.1 := 2048 ; + tpl.1 := 2048 } with tpl -type foobar is (int * int) +type foobar is int * int -const fb : foobar = (0, 0) +const fb : foobar = (0,0) -function projection (const tpl : foobar) : int is - begin - skip - end with tpl.0 + tpl.1 +function projection (const tpl : foobar) : int is tpl.0 + tpl.1 -type big_tuple is (int * int * int * int * int) +type big_tuple is int * int * int * int * int const br : big_tuple = (23, 23, 23, 23, 23) diff --git a/src/test/contracts/variant-matching.ligo b/src/test/contracts/variant-matching.ligo index 5c13a5053..b19303da3 100644 --- a/src/test/contracts/variant-matching.ligo +++ b/src/test/contracts/variant-matching.ligo @@ -1,11 +1,11 @@ type foobar is -| Foo of int + Foo of int | Bar of bool | Kee of nat -function fb(const p : foobar) : int is - block { skip } with (case p of - | Foo (n) -> n +function fb (const p : foobar) : int is + case p of + Foo (n) -> n | Bar (t) -> 42 | Kee (n) -> 23 - end) + end diff --git a/src/test/contracts/variant.ligo b/src/test/contracts/variant.ligo index b98001a02..af84d1731 100644 --- a/src/test/contracts/variant.ligo +++ b/src/test/contracts/variant.ligo @@ -1,5 +1,5 @@ type foobar is -| Foo of int + Foo of int | Bar of bool | Kee of nat diff --git a/src/test/contracts/website1.ligo b/src/test/contracts/website1.ligo index 4c8272d64..38ea61b8f 100644 --- a/src/test/contracts/website1.ligo +++ b/src/test/contracts/website1.ligo @@ -1,2 +1,2 @@ -function main (const p : int ; const s : int) : (list(operation) * int) is - block {skip} with ((nil : list(operation)), s + 1) +function main (const p : int; const s : int) : list (operation) * int is + ((nil : list (operation)), s + 1) diff --git a/src/test/contracts/website2.ligo b/src/test/contracts/website2.ligo index ac13b7c6f..7d326e407 100644 --- a/src/test/contracts/website2.ligo +++ b/src/test/contracts/website2.ligo @@ -1,16 +1,20 @@ -// variant defining pseudo multi-entrypoint actions +// variant defining entrypoints + type action is -| Increment of int + Increment of int | Decrement of int -function add (const a : int ; const b : int) : int is a + b +type return is list (operation) * int -function subtract (const a : int ; const b : int) : int is a - b +function add (const a : int; const b : int) : int is a + b -// real entrypoint that re-routes the flow based on the action provided -function main (const p : action ; const s : int) : (list(operation) * int) is - ((nil : list(operation)), +function subtract (const a : int; const b : int) : int is a - b + +// main function routing the flow based on the action provided + +function main (const p : action; const s : int) : return is + ((nil : list (operation)), case p of - | Increment (n) -> add (s, n) + Increment (n) -> add (s, n) | Decrement (n) -> subtract (s, n) end) From a9214f864d933bb01f01e6cbf68619f3e9887fbe Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Thu, 27 Feb 2020 19:09:14 +0100 Subject: [PATCH 03/40] Reviewing again the PascaLIGO contracts. --- src/bin/expect_tests/contract_tests.ml | 22 ++++++--- src/passes/operators/operators.ml | 48 +++++++++--------- src/test/contracts/address.ligo | 6 +-- src/test/contracts/amount.ligo | 5 +- src/test/contracts/amount.mligo | 2 +- src/test/contracts/arithmetic.ligo | 16 ++---- src/test/contracts/assign.ligo | 5 +- src/test/contracts/bad_timestamp.ligo | 2 +- src/test/contracts/balance_constant.ligo | 2 +- src/test/contracts/big_map.ligo | 6 +-- src/test/contracts/boolean_operators.ligo | 14 ++---- src/test/contracts/bytes_arithmetic.ligo | 8 ++- src/test/contracts/bytes_unpack.ligo | 12 ++--- src/test/contracts/chain_id.ligo | 2 +- src/test/contracts/check_signature.ligo | 6 +-- src/test/contracts/coase.ligo | 42 +++++++++++----- src/test/contracts/condition-annot.mligo | 2 +- src/test/contracts/condition-shadowing.mligo | 2 - src/test/contracts/condition.mligo | 2 +- src/test/contracts/counter.ligo | 4 +- src/test/contracts/crypto.ligo | 5 +- src/test/contracts/declarations.ligo | 2 - src/test/contracts/deep_access.ligo | 7 ++- src/test/contracts/dispatch-counter.ligo | 1 - src/test/contracts/entrypoints.ligo | 13 +++-- src/test/contracts/failwith.mligo | 4 +- src/test/contracts/for_fail.ligo | 2 +- src/test/contracts/get_contract.ligo | 19 ++++---- src/test/contracts/heap.ligo | 16 ++++-- src/test/contracts/implicit_account.ligo | 3 +- src/test/contracts/key_hash.ligo | 6 +-- src/test/contracts/key_hash_comparable.ligo | 11 +++-- src/test/contracts/list.ligo | 6 +-- src/test/contracts/loop_bugs.ligo | 4 +- src/test/contracts/map.ligo | 14 ++---- src/test/contracts/multisig-v2.ligo | 45 +++++++++-------- src/test/contracts/multisig.ligo | 8 +-- src/test/integration_tests.ml | 51 +++++++------------- 38 files changed, 209 insertions(+), 216 deletions(-) diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index facee666d..317c8a87a 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -7,7 +7,7 @@ let bad_contract basename = let%expect_test _ = run_ligo_good [ "measure-contract" ; contract "coase.ligo" ; "main" ] ; - [%expect {| 1747 bytes |}] ; + [%expect {| 1870 bytes |}] ; run_ligo_good [ "measure-contract" ; contract "multisig.ligo" ; "main" ] ; [%expect {| 1324 bytes |}] ; @@ -86,7 +86,9 @@ let%expect_test _ = SWAP ; DIP { DUP ; CAR ; CAR } ; GET ; - IF_NONE { PUSH string "MAP FIND" ; FAILWITH } {} ; + IF_NONE + { PUSH string "buy_single: No card pattern." ; FAILWITH } + { DUP ; DIP { DROP } } ; DUP ; CAR ; DIP { DUP ; CDR ; PUSH nat 1 ; ADD } ; @@ -159,7 +161,9 @@ let%expect_test _ = SWAP ; DIP { DUP ; CAR ; CDR } ; GET ; - IF_NONE { PUSH string "MAP FIND" ; FAILWITH } {} ; + IF_NONE + { PUSH string "sell_single: No card." ; FAILWITH } + { DUP ; DIP { DROP } } ; DUP ; CAR ; SENDER ; @@ -173,7 +177,9 @@ let%expect_test _ = CDR ; DIP { DIP 2 { DUP } ; DIG 2 ; CAR ; CAR } ; GET ; - IF_NONE { PUSH string "MAP FIND" ; FAILWITH } {} ; + IF_NONE + { PUSH string "sell_single: No card pattern." ; FAILWITH } + { DUP ; DIP { DROP } } ; DUP ; DIP { DUP } ; SWAP ; @@ -209,7 +215,9 @@ let%expect_test _ = MUL ; SENDER ; CONTRACT unit ; - IF_NONE { PUSH string "bad address for get_contract" ; FAILWITH } {} ; + IF_NONE + { PUSH string "sell_single: No contract." ; FAILWITH } + { DUP ; DIP { DROP } } ; DIP { DUP } ; SWAP ; DIP { DUP } ; @@ -246,7 +254,9 @@ let%expect_test _ = CAR ; DIP { DUP } ; GET ; - IF_NONE { PUSH string "MAP FIND" ; FAILWITH } {} ; + IF_NONE + { PUSH string "transfer_single: No card." ; FAILWITH } + { DUP ; DIP { DROP } } ; DUP ; CAR ; SENDER ; diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index 7cc7f556d..4c72934b2 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -68,30 +68,30 @@ module Simplify = struct (* Tezos module (ex-Michelson) *) | "Tezos.chain_id" -> ok C_CHAIN_ID - | "chain_id" -> ok C_CHAIN_ID (* Deprecated *) - | "get_chain_id" -> ok C_CHAIN_ID (* Deprecated *) + | "chain_id" -> ok C_CHAIN_ID (* Deprecated *) + | "get_chain_id" -> ok C_CHAIN_ID (* Deprecated *) | "Tezos.balance" -> ok C_BALANCE - | "balance" -> ok C_BALANCE (* Deprecated *) + | "balance" -> ok C_BALANCE (* Deprecated *) | "Tezos.now" -> ok C_NOW - | "now" -> ok C_NOW (* Deprecated *) + | "now" -> ok C_NOW (* Deprecated *) | "Tezos.amount" -> ok C_AMOUNT - | "amount" -> ok C_AMOUNT (* Deprecated *) + | "amount" -> ok C_AMOUNT (* Deprecated *) | "Tezos.sender" -> ok C_SENDER - | "sender" -> ok C_SENDER (* Deprecated *) + | "sender" -> ok C_SENDER (* Deprecated *) | "Tezos.address" -> ok C_ADDRESS - | "address" -> ok C_ADDRESS (* Deprecated *) + | "address" -> ok C_ADDRESS (* Deprecated *) | "Tezos.self_address" -> ok C_SELF_ADDRESS - | "self_address" -> ok C_SELF_ADDRESS (* Deprecated *) + | "self_address" -> ok C_SELF_ADDRESS (* Deprecated *) | "Tezos.implicit_account" -> ok C_IMPLICIT_ACCOUNT - | "implicit_account" -> ok C_IMPLICIT_ACCOUNT (* Deprecated *) + | "implicit_account" -> ok C_IMPLICIT_ACCOUNT (* Deprecated *) | "Tezos.source" -> ok C_SOURCE - | "source" -> ok C_SOURCE (* Deprecated *) + | "source" -> ok C_SOURCE (* Deprecated *) | "Tezos.failwith" -> ok C_FAILWITH - | "failwith" -> ok C_FAILWITH + | "failwith" -> ok C_FAILWITH - | "Tezos.transaction" -> ok C_CALL + | "Tezos.transaction" -> ok C_CALL | "transaction" -> ok C_CALL (* Deprecated *) - | "Tezos.set_delegate" -> ok C_SET_DELEGATE + | "Tezos.set_delegate" -> ok C_SET_DELEGATE | "set_delegate" -> ok C_SET_DELEGATE (* Deprecated *) | "get_contract" -> ok C_CONTRACT (* Deprecated *) | "Tezos.get_contract_opt" -> ok C_CONTRACT_OPT @@ -144,7 +144,7 @@ module Simplify = struct | "Bytes.unpack" -> ok C_BYTES_UNPACK | "bytes_unpack" -> ok C_BYTES_UNPACK (* Deprecated *) | "Bytes.length" -> ok C_SIZE - | "Bytes.size" -> ok C_SIZE + | "Bytes.size" -> ok C_SIZE (* Deprecated *) | "bytes_concat" -> ok C_CONCAT (* Deprecated *) | "Bytes.concat" -> ok C_CONCAT | "Bytes.slice" -> ok C_SLICE @@ -165,7 +165,8 @@ module Simplify = struct (* Set module *) - | "Set.size" -> ok C_SIZE + | "Set.cardinal" -> ok C_SIZE + | "Set.size" -> ok C_SIZE (* Deprecated *) | "set_size" -> ok C_SIZE (* Deprecated *) | "set_empty" -> ok C_SET_EMPTY (* Deprecated *) | "Set.mem" -> ok C_SET_MEM @@ -339,14 +340,15 @@ module Simplify = struct (* Set module *) - | "Set.mem" -> ok C_SET_MEM - | "Set.iter" -> ok C_SET_ITER - | "Set.empty" -> ok C_SET_EMPTY - | "Set.literal" -> ok C_SET_LITERAL - | "Set.add" -> ok C_SET_ADD - | "Set.remove" -> ok C_SET_REMOVE - | "Set.fold" -> ok C_SET_FOLD - | "Set.size" -> ok C_SIZE + | "Set.mem" -> ok C_SET_MEM + | "Set.iter" -> ok C_SET_ITER + | "Set.empty" -> ok C_SET_EMPTY + | "Set.literal" -> ok C_SET_LITERAL + | "Set.add" -> ok C_SET_ADD + | "Set.remove" -> ok C_SET_REMOVE + | "Set.fold" -> ok C_SET_FOLD + | "Set.size" -> ok C_SIZE (* Deprecated *) + | "Set.cardinal" -> ok C_SIZE (* Map module *) diff --git a/src/test/contracts/address.ligo b/src/test/contracts/address.ligo index 59d5bff4c..ae863ac81 100644 --- a/src/test/contracts/address.ligo +++ b/src/test/contracts/address.ligo @@ -1,5 +1,3 @@ -// function main (const c : contract (unit)) : address is address (c) - function main (const p : key_hash) : address is block { - const c : contract (unit) = implicit_account (p); -} with address (c) \ No newline at end of file + const c : contract (unit) = Tezos.implicit_account (p); +} with Tezos.address (c) diff --git a/src/test/contracts/amount.ligo b/src/test/contracts/amount.ligo index 9c0263635..c7816fae3 100644 --- a/src/test/contracts/amount.ligo +++ b/src/test/contracts/amount.ligo @@ -1,8 +1,5 @@ function check (const p : unit) : int is block { var result : int := 0; - if Tezos.amount = 100tz then - result := 42 - else - result := 0 + if amount = 100tz then result := 42 else result := 0 } with result diff --git a/src/test/contracts/amount.mligo b/src/test/contracts/amount.mligo index a2db44946..c14228fc4 100644 --- a/src/test/contracts/amount.mligo +++ b/src/test/contracts/amount.mligo @@ -1 +1 @@ -let check = if Tezos.amount > 100tez then 42 else 0 +let check_ (p : unit) : int = if Tezos.amount = 100tz then 42 else 0 diff --git a/src/test/contracts/arithmetic.ligo b/src/test/contracts/arithmetic.ligo index de3dc14ae..a4a6c51cb 100644 --- a/src/test/contracts/arithmetic.ligo +++ b/src/test/contracts/arithmetic.ligo @@ -1,15 +1,9 @@ // Test PascaLIGO arithmetic operators -function mod_op (const n : int) : nat is n mod 42 - -function plus_op (const n : int) : int is n + 42 - +function mod_op (const n : int) : nat is n mod 42 +function plus_op (const n : int) : int is n + 42 function minus_op (const n : int) : int is n - 42 - function times_op (const n : int) : int is n * 42 - -function div_op (const n : int) : int is n / 2 - -function int_op (const n : nat) : int is int (n) - -function neg_op (const n : int) : int is -n +function div_op (const n : int) : int is n / 2 +function int_op (const n : nat) : int is int (n) +function neg_op (const n : int) : int is -n diff --git a/src/test/contracts/assign.ligo b/src/test/contracts/assign.ligo index 6c6de5351..b5181e2fd 100644 --- a/src/test/contracts/assign.ligo +++ b/src/test/contracts/assign.ligo @@ -1,4 +1 @@ -function main (const i : int) : int is - block { - i := i + 1 - } with i +function main (const i : int) : int is block {i := i + 1} with i diff --git a/src/test/contracts/bad_timestamp.ligo b/src/test/contracts/bad_timestamp.ligo index 8be6968e2..dff8f6f24 100644 --- a/src/test/contracts/bad_timestamp.ligo +++ b/src/test/contracts/bad_timestamp.ligo @@ -6,4 +6,4 @@ function main (const p : parameter; const s : storage) : return is block { var stamp : timestamp := ("badtimestamp" : timestamp) } - with ((nil: list(operation)), stamp) + with ((nil : list (operation)), stamp) diff --git a/src/test/contracts/balance_constant.ligo b/src/test/contracts/balance_constant.ligo index 6a5af3fe4..b23ae23e6 100644 --- a/src/test/contracts/balance_constant.ligo +++ b/src/test/contracts/balance_constant.ligo @@ -9,4 +9,4 @@ type storage is tez type return is list (operation) * storage function main (const param : parameter; const store: storage) : return is - ((nil : list (operation)), balance) + ((nil : list (operation)), Tezos.balance) diff --git a/src/test/contracts/big_map.ligo b/src/test/contracts/big_map.ligo index 9b8364ac3..b89fb8f05 100644 --- a/src/test/contracts/big_map.ligo +++ b/src/test/contracts/big_map.ligo @@ -8,7 +8,7 @@ function main (const p : parameter; const s : storage) : return is toto := s.0[23]; s.0[2] := 444 } - with ((nil: list(operation)), s) + with ((nil : list (operation)), s) type foo is big_map (int, int) @@ -16,14 +16,12 @@ function set_ (var n : int; var m : foo) : foo is block { m[23] := n } with m -function add (var n : int ; var m : foo) : foo is set_(n,m) +function add (var n : int ; var m : foo) : foo is set_ (n,m) function rm (var m : foo) : foo is block { remove 42 from map m } with m -function gf (const m : foo) : int is get_force (23, m) - function get (const m : foo) : option (int) is m[42] const empty_big_map : big_map (int,int) = big_map [] diff --git a/src/test/contracts/boolean_operators.ligo b/src/test/contracts/boolean_operators.ligo index 122894d25..d19e5ad72 100644 --- a/src/test/contracts/boolean_operators.ligo +++ b/src/test/contracts/boolean_operators.ligo @@ -1,11 +1,5 @@ -// Test PascaLIGO boolean operators - -function or_true (const b : bool) : bool is b or True - -function or_false (const b : bool) : bool is b or False - -function and_true (const b : bool) : bool is b and True - +function or_true (const b : bool) : bool is b or True +function or_false (const b : bool) : bool is b or False +function and_true (const b : bool) : bool is b and True function and_false (const b : bool) : bool is b and False - -function not_bool (const b : bool) : bool is not b +function not_bool (const b : bool) : bool is not b diff --git a/src/test/contracts/bytes_arithmetic.ligo b/src/test/contracts/bytes_arithmetic.ligo index 6d39dd4c9..820cf6fdc 100644 --- a/src/test/contracts/bytes_arithmetic.ligo +++ b/src/test/contracts/bytes_arithmetic.ligo @@ -1,5 +1,3 @@ -function concat_op (const s : bytes) : bytes is bytes_concat (s, 0x7070) - -function slice_op (const s : bytes) : bytes is bytes_slice (1n, 2n, s) - -function hasherman (const s : bytes) : bytes is sha_256 (s) +function concat_op (const s : bytes) : bytes is Bytes.concat (s, 0x7070) +function slice_op (const s : bytes) : bytes is Bytes.sub (1n, 2n, s) +function hasherman (const s : bytes) : bytes is Crypto.sha256 (s) diff --git a/src/test/contracts/bytes_unpack.ligo b/src/test/contracts/bytes_unpack.ligo index e57ace2ab..feb76f806 100644 --- a/src/test/contracts/bytes_unpack.ligo +++ b/src/test/contracts/bytes_unpack.ligo @@ -1,11 +1,11 @@ function id_string (const p : string) : option (string) is block { - const packed : bytes = bytes_pack (p) -} with (bytes_unpack (packed) : option (string)) + const packed : bytes = Bytes.pack (p) +} with (Bytes.unpack (packed) : option (string)) function id_int (const p : int) : option (int) is block { - const packed : bytes = bytes_pack (p) -} with (bytes_unpack (packed) : option (int)) + const packed : bytes = Bytes.pack (p) +} with (Bytes.unpack (packed) : option (int)) function id_address (const p : address) : option (address) is block { - const packed : bytes = bytes_pack (p) -} with (bytes_unpack (packed) : option (address)) + const packed : bytes = Bytes.pack (p) +} with (Bytes.unpack (packed) : option (address)) diff --git a/src/test/contracts/chain_id.ligo b/src/test/contracts/chain_id.ligo index 353ba4a45..ad9f17395 100644 --- a/src/test/contracts/chain_id.ligo +++ b/src/test/contracts/chain_id.ligo @@ -1 +1 @@ -function chain_id (const tt : chain_id) : chain_id is get_chain_id +function chain_id (const tt : chain_id) : chain_id is Tezos.chain_id diff --git a/src/test/contracts/check_signature.ligo b/src/test/contracts/check_signature.ligo index 97de04bd2..83554433e 100644 --- a/src/test/contracts/check_signature.ligo +++ b/src/test/contracts/check_signature.ligo @@ -1,4 +1,4 @@ -function check_signature (const pk : key; +function check_signature (const pk : key; const signed : signature; - const msg: bytes) : bool -is crypto_check (pk, signed, msg) + const msg : bytes) : bool +is Crypto.check (pk, signed, msg) diff --git a/src/test/contracts/coase.ligo b/src/test/contracts/coase.ligo index 5f5b00644..5897b8686 100644 --- a/src/test/contracts/coase.ligo +++ b/src/test/contracts/coase.ligo @@ -45,27 +45,38 @@ type parameter is | Transfer_single of action_transfer_single function transfer_single (const action : action_transfer_single; - const s : storage) : return is block { + const s : storage) : return is + block { const cards : cards = s.cards; - const card : card = get_force (action.card_to_transfer, cards); + const card : card = + case cards[action.card_to_transfer] of + Some (card) -> card + | None -> (failwith ("transfer_single: No card.") : card) + end; if card.card_owner =/= sender then failwith ("This card doesn't belong to you") else skip; card.card_owner := action.destination; cards[action.card_to_transfer] := card; - s.cards := cards; - const operations : list (operation) = nil - } with (operations, s) + s.cards := cards + } with ((nil : list (operation)), s) function sell_single (const action : action_sell_single; const s : storage) : return is block { - const card : card = get_force (action.card_to_sell, s.cards); + const card : card = + case s.cards[action.card_to_sell] of + Some (card) -> card + | None -> (failwith ("sell_single: No card.") : card) + end; if card.card_owner =/= sender then failwith ("This card doesn't belong to you") else skip; const card_pattern : card_pattern = - get_force (card.card_pattern, s.card_patterns); + case s.card_patterns[card.card_pattern] of + Some (pattern) -> pattern + | None -> (failwith ("sell_single: No card pattern.") : card_pattern) + end; card_pattern.quantity := abs (card_pattern.quantity - 1n); const card_patterns : card_patterns = s.card_patterns; card_patterns[card.card_pattern] := card_pattern; @@ -74,8 +85,12 @@ function sell_single (const action : action_sell_single; remove action.card_to_sell from map cards; s.cards := cards; const price : tez = card_pattern.coefficient * card_pattern.quantity; - const receiver : contract (unit) = get_contract (sender); - const op : operation = transaction (unit, price, receiver); + const receiver : contract (unit) = + case (Tezos.get_contract_opt (Tezos.sender) : option (contract (unit))) of + Some (contract) -> contract + | None -> (failwith ("sell_single: No contract.") : contract (unit)) + end; + const op : operation = Tezos.transaction (unit, price, receiver); const operations : list (operation) = list [op] } with (operations, s) @@ -84,12 +99,13 @@ function buy_single (const action : action_buy_single; block { // Check funds const card_pattern : card_pattern = - get_force (action.card_to_buy, s.card_patterns); + case s.card_patterns[action.card_to_buy] of + Some (pattern) -> pattern + | None -> (failwith ("buy_single: No card pattern.") : card_pattern) + end; const price : tez = card_pattern.coefficient * (card_pattern.quantity + 1n); if price > amount then failwith ("Not enough money") else skip; - // Administrative procedure - const operations : list(operation) = nil; // Increase quantity card_pattern.quantity := card_pattern.quantity + 1n; const card_patterns : card_patterns = s.card_patterns; @@ -103,7 +119,7 @@ function buy_single (const action : action_buy_single; ]; s.cards := cards; s.next_id := s.next_id + 1n - } with (operations, s) + } with ((nil : list (operation)), s) function main (const action : parameter; const s : storage) : return is case action of diff --git a/src/test/contracts/condition-annot.mligo b/src/test/contracts/condition-annot.mligo index 93aece587..1eb1bf0f9 100644 --- a/src/test/contracts/condition-annot.mligo +++ b/src/test/contracts/condition-annot.mligo @@ -1,4 +1,4 @@ -type integer is int +type integer = int let main (i : int) = if (i = 2 : bool) then (42 : int) else (0 : integer) diff --git a/src/test/contracts/condition-shadowing.mligo b/src/test/contracts/condition-shadowing.mligo index 97ee6eb51..64f1ff42f 100644 --- a/src/test/contracts/condition-shadowing.mligo +++ b/src/test/contracts/condition-shadowing.mligo @@ -1,5 +1,3 @@ -(* TODO : make a test using mutation, not shadowing *) - let main (i : int) = let result = 0 in if i = 2 then diff --git a/src/test/contracts/condition.mligo b/src/test/contracts/condition.mligo index 31568e353..4807f36c1 100644 --- a/src/test/contracts/condition.mligo +++ b/src/test/contracts/condition.mligo @@ -1,3 +1,3 @@ // Test conditional in CameLIGO -let main (i: int) = if i = 2 then 42 else 0 +let main (i : int) = if i = 2 then 42 else 0 diff --git a/src/test/contracts/counter.ligo b/src/test/contracts/counter.ligo index 295c540ee..70bd7ed30 100644 --- a/src/test/contracts/counter.ligo +++ b/src/test/contracts/counter.ligo @@ -1,7 +1,7 @@ type t is int -function main (const p : int ; const s : t) : list (operation) * int is +function main (const p : int; const s : t) : list (operation) * int is block { skip } // skip is a do nothing instruction, needed for empty blocks - with ((nil : list(operation)), p + s) + with ((nil : list (operation)), p+s) diff --git a/src/test/contracts/crypto.ligo b/src/test/contracts/crypto.ligo index 08d417241..5c963fe6e 100644 --- a/src/test/contracts/crypto.ligo +++ b/src/test/contracts/crypto.ligo @@ -1,3 +1,2 @@ -function hasherman512 (const s: bytes) : bytes is sha_512 (s) - -function hasherman_blake (const s: bytes) : bytes is blake2b (s) +function hasherman512 (const s : bytes) : bytes is Crypto.sha512 (s) +function hasherman_blake (const s : bytes) : bytes is Crypto.blake2b (s) diff --git a/src/test/contracts/declarations.ligo b/src/test/contracts/declarations.ligo index d6cc5dfb5..b41c36819 100644 --- a/src/test/contracts/declarations.ligo +++ b/src/test/contracts/declarations.ligo @@ -1,5 +1,3 @@ -// Test PascaLIGO top-level declarations - const foo : int = 42 function main (const i : int) : int is i + foo diff --git a/src/test/contracts/deep_access.ligo b/src/test/contracts/deep_access.ligo index 2d9ad32d4..4c4159111 100644 --- a/src/test/contracts/deep_access.ligo +++ b/src/test/contracts/deep_access.ligo @@ -21,9 +21,12 @@ function asymetric_tuple_access (const foo : unit) : int is } with tuple.0 + tuple.1.0 + tuple.1.1.0 + tuple.1.1.1 type nested_record_t is - record [nesty : record [mymap : map (int,string)]] + record [nesty : record [mymap : map (int, string)]] function nested_record (var nee : nested_record_t) : string is block { nee.nesty.mymap[1] := "one" - } with get_force (1, nee.nesty.mymap) + } with case nee.nesty.mymap[1] of + Some (s) -> s + | None -> (failwith ("Should not happen.") : string) + end diff --git a/src/test/contracts/dispatch-counter.ligo b/src/test/contracts/dispatch-counter.ligo index c513381ae..0ef19ab75 100644 --- a/src/test/contracts/dispatch-counter.ligo +++ b/src/test/contracts/dispatch-counter.ligo @@ -7,7 +7,6 @@ type storage is int type return is list (operation) * storage function increment (const i : int; const n : int) : int is i+n - function decrement (const i : int; const n : int) : int is i-n const nop : list (operation) = nil diff --git a/src/test/contracts/entrypoints.ligo b/src/test/contracts/entrypoints.ligo index d1945ac8d..d47a8b78a 100644 --- a/src/test/contracts/entrypoints.ligo +++ b/src/test/contracts/entrypoints.ligo @@ -4,9 +4,12 @@ type return is list (operation) * storage function cb (const a : address; const s : storage) : return is block { - const c : contract (unit) = get_entrypoint ("%cb", a) - } - with (list [transaction (unit, 0mutez, c)], s) + const c : contract (unit) = + case (Tezos.get_entrypoint_opt ("%cb", a) : option (contract (unit))) of + Some (contract) -> contract + | None -> (failwith ("cb: Entrypoint not found.") : contract (unit)) + end + } with (list [Tezos.transaction (unit, 0tez, c)], s) function cbo (const a : address; const s : storage) : return is @@ -14,6 +17,6 @@ function cbo (const a : address; const s : storage) : return is const c : contract (unit) = case (get_entrypoint_opt ("%cbo", a) : option (contract (unit))) of Some (c) -> c - | None -> (failwith ("entrypoint not found") : contract (unit)) + | None -> (failwith ("cbo: Entrypoint not found.") : contract (unit)) end - } with (list [transaction(unit, 0mutez, c)], s) + } with (list [Tezos.transaction (unit, 0tez, c)], s) diff --git a/src/test/contracts/failwith.mligo b/src/test/contracts/failwith.mligo index 2938a703d..9d82ed6e3 100644 --- a/src/test/contracts/failwith.mligo +++ b/src/test/contracts/failwith.mligo @@ -1,4 +1,4 @@ type storage = unit -let main (p : unit; store : storage) : operation list * storage = - if true then failwith "This contract always fails" +let main (p, store : unit * storage) : operation list * storage = + failwith "This contract always fails" diff --git a/src/test/contracts/for_fail.ligo b/src/test/contracts/for_fail.ligo index a8c870843..682c5e295 100644 --- a/src/test/contracts/for_fail.ligo +++ b/src/test/contracts/for_fail.ligo @@ -1,2 +1,2 @@ -function main (const a: int) : int is +function main (const a : int) : int is block { for i := 0 to 100 block { skip } } with i diff --git a/src/test/contracts/get_contract.ligo b/src/test/contracts/get_contract.ligo index 8ace2277d..5a7ca3541 100644 --- a/src/test/contracts/get_contract.ligo +++ b/src/test/contracts/get_contract.ligo @@ -1,19 +1,20 @@ type storage is unit type return is list (operation) * storage -function cb (const s : storage) : return is - block { - const c : contract(unit) = get_contract(sender) - } - with (list [transaction(unit, 0mutez, c)], s) +function cb (const s : storage) : return is block { + const c : contract (unit) = + case (Tezos.get_contract_opt (Tezos.sender) : option (contract (unit))) of + Some (contract) -> contract + | None -> (failwith ("cb: No contract.") : contract (unit)) + end +} with (list [Tezos.transaction (unit, 0tez, c)], s) function cbo (const s : unit) : return is block { const c : contract (unit) = - case (get_contract_opt(sender) : option(contract(unit))) of - Some (c) -> c + case (Tezos.get_contract_opt (Tezos.sender) : option (contract (unit))) of + Some (contract) -> contract | None -> (failwith ("contract not found") : contract (unit)) end - } - with (list [transaction(unit, 0mutez, c)], s) + } with (list [Tezos.transaction (unit, 0tez, c)], s) diff --git a/src/test/contracts/heap.ligo b/src/test/contracts/heap.ligo index 66c7747b6..9ff8f8154 100644 --- a/src/test/contracts/heap.ligo +++ b/src/test/contracts/heap.ligo @@ -10,8 +10,12 @@ function get_top (const h : heap) : heap_elt is get_force (1n, h) function pop_switch (const h : heap) : heap is block { const result : heap_elt = get_top (h); - const s : nat = size (h); - const last : heap_elt = get_force (s, h); + const s : nat = Map.size (h); + const last : heap_elt = + case h[s] of + Some (e) -> e + | None -> (failwith ("No element.") : heap_elt) + end; remove 1n from map h; h[1n] := last } with h @@ -19,8 +23,12 @@ function pop_switch (const h : heap) : heap is function pop_ (const h : heap) : nat is block { const result : heap_elt = get_top (h); - const s : nat = size (h); - var current : heap_elt := get_force (s, h); + const s : nat = Map.size (h); + var current : heap_elt := + case h[s] of + Some (e) -> e + | None -> (failwith ("No element.") : heap_elt) + end; const i : nat = 1n; const left : nat = 2n * i; const right : nat = left + 1n; diff --git a/src/test/contracts/implicit_account.ligo b/src/test/contracts/implicit_account.ligo index ad0a6c54b..c1f8b3649 100644 --- a/src/test/contracts/implicit_account.ligo +++ b/src/test/contracts/implicit_account.ligo @@ -1 +1,2 @@ -function main (const kh: key_hash) : contract (unit) is implicit_account (kh) +function main (const kh: key_hash) : contract (unit) is + Tezos.implicit_account (kh) diff --git a/src/test/contracts/key_hash.ligo b/src/test/contracts/key_hash.ligo index 865abfbb8..41c7fe56b 100644 --- a/src/test/contracts/key_hash.ligo +++ b/src/test/contracts/key_hash.ligo @@ -1,7 +1,5 @@ function check_hash_key (const kh1 : key_hash; const k2 : key) : bool * key_hash is block { - var ret : bool := False; - var kh2 : key_hash := crypto_hash_key (k2); - if kh1 = kh2 then ret := True else skip - } with (ret, kh2) + var kh2 : key_hash := Crypto.hash_key (k2); + } with ((kh1 = kh2), kh2) diff --git a/src/test/contracts/key_hash_comparable.ligo b/src/test/contracts/key_hash_comparable.ligo index 02003b927..7c5a60613 100644 --- a/src/test/contracts/key_hash_comparable.ligo +++ b/src/test/contracts/key_hash_comparable.ligo @@ -1,8 +1,9 @@ -type storage is record - one: map(key_hash, nat); - two: big_map(key_hash, bool); -end +type storage is record [ + one : map (key_hash, nat); + two : big_map (key_hash, bool) +] type return is list (operation) * storage -function main (const a : int; const store : storage) : return is ((nil: list(operation)), store) \ No newline at end of file +function main (const a : int; const store : storage) : return is + ((nil : list (operation)), store) diff --git a/src/test/contracts/list.ligo b/src/test/contracts/list.ligo index 155b80ac5..ae01f1559 100644 --- a/src/test/contracts/list.ligo +++ b/src/test/contracts/list.ligo @@ -17,17 +17,17 @@ const bl : foobar = list [144; 51; 42; 120; 421] function fold_op (const s : list (int)) : int is block { function aggregate (const prec: int; const cur: int) : int is prec+cur - } with list_fold (aggregate, s, 10) + } with List.fold (aggregate, s, 10) function iter_op (const s : list (int)) : int is block { var r : int := 0; function aggregate (const i : int) : unit is block { r := r + i } with unit; - list_iter (aggregate, s) + List.iter (aggregate, s) } with r function map_op (const s : list (int)) : list (int) is block { function increment (const i : int) : int is i+1 - } with list_map (increment, s) + } with List.map (increment, s) diff --git a/src/test/contracts/loop_bugs.ligo b/src/test/contracts/loop_bugs.ligo index 1a18a6758..55b443352 100644 --- a/src/test/contracts/loop_bugs.ligo +++ b/src/test/contracts/loop_bugs.ligo @@ -1,6 +1,6 @@ function shadowing_in_body (var nee : unit) : string is block { var st : string := ""; - var list1 : list(string) := list "to"; "to" end; + var list1 : list (string) := list ["to"; "to"]; for x in list list1 block { const x : string = "ta"; st := st ^ x; @@ -10,7 +10,7 @@ function shadowing_in_body (var nee : unit) : string is block { function shadowing_assigned_in_body (var nee : unit) : string is block { var st : string := ""; - var list1 : list(string) := list "to"; "to" end; + var list1 : list (string) := list ["to"; "to"]; for x in list list1 block { st := st ^ x; var st : string := "ta"; diff --git a/src/test/contracts/map.ligo b/src/test/contracts/map.ligo index eabd8edc7..51339ada4 100644 --- a/src/test/contracts/map.ligo +++ b/src/test/contracts/map.ligo @@ -30,32 +30,28 @@ function patch_ (var m : foobar) : foobar is block { function patch_deep (var m : foobar * nat) : foobar * nat is block { patch m.0 with map [1 -> 9] } with m -function size_ (const m : foobar) : nat is size (m) - -function gf (const m : foobar) : int is get_force (23, m) +function size_ (const m : foobar) : nat is Map.size (m) function get (const m : foobar) : option (int) is m[42] -function get_ (const m : foobar) : option (int) is map_get (42, m) - -function mem (const k: int; const m: foobar) : bool is map_mem (k, m) +function mem (const k: int; const m: foobar) : bool is Map.mem (k, m) function iter_op (const m : foobar) : unit is block { function aggregate (const i : int; const j : int) : unit is block { if i=j then skip else failwith ("fail") } with unit - } with map_iter (aggregate, m) + } with Map.iter (aggregate, m) function map_op (const m : foobar) : foobar is block { function increment (const i : int; const j : int) : int is j+1 - } with map_map (increment, m) + } with Map.map (increment, m) function fold_op (const m : foobar) : int is block { function aggregate (const i : int; const j : int * int) : int is i + j.0 + j.1 - } with map_fold(aggregate, m, 10) + } with Map.fold (aggregate, m, 10) function deep_op (var m : foobar) : foobar is block { diff --git a/src/test/contracts/multisig-v2.ligo b/src/test/contracts/multisig-v2.ligo index cb3292d18..002379827 100644 --- a/src/test/contracts/multisig-v2.ligo +++ b/src/test/contracts/multisig-v2.ligo @@ -37,22 +37,22 @@ function send (const param : send_pt; const s : storage) : return is block { // check sender against the authorized addresses - if not set_mem (sender, s.authorized_addresses) + if not Set.mem (Tezos.sender, s.authorized_addresses) then failwith("Unauthorized address") else skip; // check message size against the stored limit var message : message := param; - const packed_msg : bytes = bytes_pack (message); - if size (packed_msg) > s.max_message_size + const packed_msg : bytes = Bytes.pack (message); + if Bytes.length (packed_msg) > s.max_message_size then failwith ("Message size exceed maximum limit") else skip; (* compute the new set of addresses associated with the message and update counters *) - var new_store : addr_set := set_empty; + var new_store : addr_set := set []; case map_get (packed_msg, s.message_store) of Some (voters) -> @@ -60,26 +60,25 @@ function send (const param : send_pt; const s : storage) : return is (* The message is already stored. Increment the counter only if the sender is not already associated with the message. *) - if set_mem (sender, voters) + if Set.mem (Tezos.sender, voters) then skip - else s.proposal_counters[sender] := - get_force (sender, s.proposal_counters) + 1n; - - new_store := set_add(sender,voters) + else s.proposal_counters[Tezos.sender] := + get_force (Tezos.sender, s.proposal_counters) + 1n; + new_store := Set.add (Tezos.sender,voters) } | None -> block { // the message has never been received before s.proposal_counters[sender] := - get_force (sender, s.proposal_counters) + 1n; - new_store := set [sender] + get_force (Tezos.sender, s.proposal_counters) + 1n; + new_store := set [Tezos.sender] } end; // check sender counters against the maximum number of proposal var sender_proposal_counter : nat := - get_force (sender, s.proposal_counters); + get_force (Tezos.sender, s.proposal_counters); if sender_proposal_counter > s.max_proposal then failwith ("Maximum number of proposal reached") @@ -89,14 +88,14 @@ function send (const param : send_pt; const s : storage) : return is var ret_ops : list (operation) := nil; - if size (new_store) >= s.threshold then { + if Set.cardinal (new_store) >= s.threshold then { remove packed_msg from map s.message_store; ret_ops := message (s.state_hash); // update the state hash - s.state_hash := sha_256 (bytes_concat (s.state_hash, packed_msg)); + s.state_hash := Crypto.sha256 (Bytes.concat (s.state_hash, packed_msg)); // decrement the counters for addr -> ctr in map s.proposal_counters block { - if set_mem(addr,new_store) then + if Set.mem (addr, new_store) then s.proposal_counters[addr] := abs (ctr - 1n) else skip } @@ -106,26 +105,26 @@ function send (const param : send_pt; const s : storage) : return is function withdraw (const param : withdraw_pt; const s : storage) : return is block { var message : message := param; - const packed_msg : bytes = bytes_pack (message); + const packed_msg : bytes = Bytes.pack (message); - case map_get(packed_msg, s.message_store) of + case s.message_store[packed_msg] of Some (voters) -> block { // The message is stored - const new_set : addr_set = set_remove (sender, voters); + const new_set : addr_set = Set.remove (Tezos.sender, voters); (* Decrement the counter only if the sender was already associated with the message *) - if size (voters) =/= size (new_set) - then s.proposal_counters[sender] := - abs (get_force (sender, s.proposal_counters) - 1n) - else skip ; + if Set.cardinal (voters) =/= Set.cardinal (new_set) + then s.proposal_counters[Tezos.sender] := + abs (get_force (Tezos.sender, s.proposal_counters) - 1n) + else skip; (* If the message is left without any associated addresses, remove the corresponding message_store field *) - if size (new_set) = 0n + if Set.cardinal (new_set) = 0n then remove packed_msg from map s.message_store else s.message_store[packed_msg] := new_set } diff --git a/src/test/contracts/multisig.ligo b/src/test/contracts/multisig.ligo index f0cdb636c..19c8fc3c4 100644 --- a/src/test/contracts/multisig.ligo +++ b/src/test/contracts/multisig.ligo @@ -38,7 +38,7 @@ function check_message (const param : check_message_pt; failwith ("Counters does not match") else { const packed_payload : bytes = - bytes_pack ((message, param.counter, s.id, get_chain_id)); + Bytes.pack ((message, param.counter, s.id, Tezos.chain_id)); var valid : nat := 0n; var keys : authorized_keys := s.auth; @@ -47,12 +47,12 @@ function check_message (const param : check_message_pt; nil -> skip | key # tl -> block { keys := tl; - if pkh_sig.0 = crypto_hash_key (key) then - if crypto_check (key, pkh_sig.1, packed_payload) + if pkh_sig.0 = Crypto.hash_key (key) then + if Crypto.check (key, pkh_sig.1, packed_payload) then valid := valid + 1n else failwith ("Invalid signature") else skip - } + } end }; diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index b8270e005..2ad0dfc8f 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -1019,21 +1019,11 @@ let map_ type_f path : unit result = let make_expected = e_nat in expect_eq_n_strict_pos_small program "size_" make_input make_expected in - let%bind () = - let make_input = fun n -> ez [(23, n) ; (42, 4)] in - let make_expected = e_int in - expect_eq_n program "gf" make_input make_expected - in let%bind () = let make_input = fun n -> ez [(23, n) ; (42, 4)] in let make_expected = fun _ -> e_some @@ e_int 4 in expect_eq_n program "get" make_input make_expected in - let%bind () = - let make_input = fun n -> ez [(23, n) ; (42, 4)] in - let make_expected = fun _ -> e_some @@ e_int 4 in - expect_eq_n program "get_" make_input make_expected - in let%bind () = let input_map = ez [(23, 10) ; (42, 4)] in expect_eq program "mem" (e_tuple [(e_int 23) ; input_map]) (e_bool true) @@ -1081,11 +1071,6 @@ let big_map_ type_f path : unit result = let lst' = List.map (fun (x, y) -> e_int x, e_int y) lst in (e_typed_big_map lst' t_int t_int) in - let%bind () = - let make_input = fun n -> ez [(23, n) ; (42, 4)] in - let make_expected = e_int in - expect_eq_n program "gf" make_input make_expected - in let%bind () = let make_input = fun n -> let m = ez [(23 , 0) ; (42 , 0)] in @@ -2241,51 +2226,51 @@ let empty_case_religo () : unit result = in ok () -let tuple_type_mligo () : unit result = +let tuple_type_mligo () : unit result = let%bind program = mtype_file "./contracts/tuple_type.mligo" in - let%bind () = - let input _ = e_int 0 in + let%bind () = + let input _ = e_int 0 in let expected _ = e_int 8 in expect_eq_n program "test1" input expected in - let%bind () = - let input _ = e_int 0 in + let%bind () = + let input _ = e_int 0 in let expected _ = e_int 12 in expect_eq_n program "test2" input expected in ok () -let tuple_type_religo () : unit result = +let tuple_type_religo () : unit result = let%bind program = retype_file "./contracts/tuple_type.religo" in - let%bind () = - let input _ = e_int 0 in + let%bind () = + let input _ = e_int 0 in let expected _ = e_int 8 in expect_eq_n program "arguments_test" input expected in - let%bind () = - let input _ = e_int 0 in + let%bind () = + let input _ = e_int 0 in let expected _ = e_int 8 in expect_eq_n program "tuple_test" input expected in - let%bind () = - let input _ = e_int 0 in + let%bind () = + let input _ = e_int 0 in let expected _ = e_int 8 in expect_eq_n program "arguments_test_inline" input expected in - let%bind () = - let input _ = e_int 0 in + let%bind () = + let input _ = e_int 0 in let expected _ = e_int 8 in expect_eq_n program "tuple_test_inline" input expected in ok () -let no_semicolon_religo () : unit result = +let no_semicolon_religo () : unit result = let%bind program = retype_file "./contracts/no_semicolon.religo" in - let%bind () = - let input _ = e_int 2 in + let%bind () = + let input _ = e_int 2 in let expected _ = e_int 3 in expect_eq_n program "a" input expected - in + in ok () let loop_bugs_ligo () : unit result = From f62ea8e8fe6e382d13726b53ba0454f8e26f8dd1 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Thu, 27 Feb 2020 19:50:25 -0800 Subject: [PATCH 04/40] Make new intro page use less 'we' --- gitlab-pages/docs/intro/ligo-intro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab-pages/docs/intro/ligo-intro.md b/gitlab-pages/docs/intro/ligo-intro.md index c66b8b8eb..87a9bf7ba 100644 --- a/gitlab-pages/docs/intro/ligo-intro.md +++ b/gitlab-pages/docs/intro/ligo-intro.md @@ -5,7 +5,7 @@ title: Introduction To LIGO LIGO is a programming language for writing [Tezos](https://tezos.com/) smart contracts. -If we had to describe the philosophy of LIGO in a few sentences, it would be this: +The LIGO philosophy can be described in a few bullet points: 1. Design a clean, simple language with no extraneous parts or additions. @@ -19,7 +19,7 @@ easy to formally verify the compiled output using a project like [Mi-Cho-Coq](ht 4. Stop waking up in the morning to find that your smart contract lost all its money to some [stupid exploit](https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/). -We can elaborate on each: +Lets expand on each: * **Clean and simple** — Programming languages for making video games or websites tend to prioritize accumulating a vast number of features, they're big languages for From 8229d6a6af2e18419908e587b9590a04b83371d5 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Tue, 25 Feb 2020 12:25:15 -0600 Subject: [PATCH 05/40] Remove (unused) assignment from mini_c --- src/passes/7-self_mini_c/helpers.ml | 10 +- src/passes/7-self_mini_c/self_mini_c.ml | 96 +------------------ src/passes/7-self_mini_c/subst.ml | 10 -- src/passes/8-compiler/compiler_environment.ml | 23 ----- .../8-compiler/compiler_environment.mli | 1 - src/passes/8-compiler/compiler_program.ml | 36 ------- src/stages/mini_c/PP.ml | 2 - src/stages/mini_c/misc.ml | 2 - src/stages/mini_c/types.ml | 1 - 9 files changed, 5 insertions(+), 176 deletions(-) diff --git a/src/passes/7-self_mini_c/helpers.ml b/src/passes/7-self_mini_c/helpers.ml index 1c1116f4b..6b77cf2ee 100644 --- a/src/passes/7-self_mini_c/helpers.ml +++ b/src/passes/7-self_mini_c/helpers.ml @@ -80,10 +80,6 @@ let rec fold_expression : 'a folder -> 'a -> expression -> 'a result = fun f ini let%bind res = bind_fold_pair self init' ab in ok res ) - | E_assignment (_, _, exp) -> ( - let%bind res = self init' exp in - ok res - ) | E_record_update (r, _, e) -> ( let%bind res = self init' r in let%bind res = self res e in @@ -150,10 +146,6 @@ let rec map_expression : mapper -> expression -> expression result = fun f e -> let%bind ab' = bind_map_pair self ab in return @@ E_sequence ab' ) - | E_assignment (s, lrl, exp) -> ( - let%bind exp' = self exp in - return @@ E_assignment (s, lrl, exp') - ) | E_record_update (r, l, e) -> ( let%bind r = self r in let%bind e = self e in @@ -166,4 +158,4 @@ let map_sub_level_expression : mapper -> expression -> expression result = fun f let%bind body = map_expression f body in let content = E_closure {binder; body} in ok @@ { e with content } - | _ -> ok e \ No newline at end of file + | _ -> ok e diff --git a/src/passes/7-self_mini_c/self_mini_c.ml b/src/passes/7-self_mini_c/self_mini_c.ml index 9a334951a..66a0a06b8 100644 --- a/src/passes/7-self_mini_c/self_mini_c.ml +++ b/src/passes/7-self_mini_c/self_mini_c.ml @@ -79,10 +79,6 @@ let rec is_pure : expression -> bool = fun e -> is near... *) | E_while _ -> false - - (* definitely not pure *) - | E_assignment _ -> false - let occurs_in : expression_variable -> expression -> bool = fun x e -> let fvs = Free_variables.expression [] e in @@ -93,63 +89,6 @@ let occurs_count : expression_variable -> expression -> int = let fvs = Free_variables.expression [] e in Free_variables.mem_count x fvs -(* If `ignore_lambdas` is true, ignore assignments which occur inside - lambdas, which have no effect on the value of the variable outside - of the lambda. *) -let rec is_assigned : ignore_lambdas:bool -> expression_variable -> expression -> bool = - fun ~ignore_lambdas x e -> - let self = is_assigned ~ignore_lambdas x in - let selfs = List.exists self in - let it = Var.equal x in - let self_binder binder body = - if it binder - then false - else self body in - let self_binder2 binder1 binder2 body = - if it binder1 || it binder2 - then false - else self body in - match e.content with - | E_assignment (x, _, e) -> - it x || self e - | E_record_update (r, _, e) -> - self r || self e - | E_closure { binder; body } -> - if ignore_lambdas - then false - else self_binder binder body - | E_constant (c) -> - selfs c.arguments - | E_application (f, arg) -> - selfs [ f ; arg ] - | E_iterator (_, ((x, _), e1), e2) -> - self_binder x e1 || self e2 - | E_fold (((x, _), e1), e2, e3) -> - self_binder x e1 || selfs [ e2 ; e3 ] - | E_if_bool (e1, e2, e3) -> - selfs [ e1 ; e2 ; e3 ] - | E_if_none (e1, e2, ((x, _), e3)) -> - selfs [ e1 ; e2 ] || self_binder x e3 - | E_if_cons (e1, e2, (((hd, _), (tl, _)), e3)) -> - selfs [ e1 ; e2 ] || self_binder2 hd tl e3 - | E_if_left (e1, ((l, _), e2), ((r, _), e3)) -> - self e1 || self_binder l e2 || self_binder r e3 - | E_let_in ((x, _), _, e1, e2) -> - self e1 || self_binder x e2 - | E_sequence (e1, e2) -> - selfs [ e1 ; e2 ] - | E_while (e1, e2) -> - selfs [ e1 ; e2 ] - | E_literal _ - | E_skip - | E_variable _ - | E_make_empty_map _ - | E_make_empty_big_map _ - | E_make_empty_list _ - | E_make_empty_set _ - | E_make_none _ -> - false - (* Let "inlining" mean transforming the code: let x = e1 in e2 @@ -163,25 +102,11 @@ let rec is_assigned : ignore_lambdas:bool -> expression_variable -> expression - Things which can go wrong for inlining: - If `e1` is not pure, inlining may fail to preserve semantics. - - If assignments to `x` occur in e2, inlining does not make sense. - - Free variables of `e1` may be assigned in e2, before usages of `x`. - Free variables of `e1` may be shadowed in e2, at usages of `x`. This is not a problem if the substitution is capture-avoiding. - ? *) -let can_inline : expression_variable -> expression -> expression -> bool = - fun x e1 e2 -> - is_pure e1 && - (* if x does not occur in e2, there can be no other problems: - substitution will be a noop up to alpha-equivalence *) - (not (occurs_in x e2) || - (* else, must worry about assignment *) - (not (is_assigned ~ignore_lambdas:false x e2) && - List.for_all - (fun y -> not (is_assigned ~ignore_lambdas:true y e2)) - (Free_variables.expression [] e2))) - let should_inline : expression_variable -> expression -> bool = fun x e -> occurs_count x e <= 1 @@ -190,10 +115,8 @@ let inline_let : bool ref -> expression -> expression = fun changed e -> match e.content with | E_let_in ((x, _a), should_inline_here, e1, e2) -> - if can_inline x e1 e2 && (should_inline_here || should_inline x e2) + if is_pure e1 && (should_inline_here || should_inline x e2) then - (* can raise Subst.Bad_argument, but should not happen, due to - can_inline *) let e2' = Subst.subst_expression ~body:e2 ~x:x ~expr:e1 in (changed := true ; e2') else @@ -215,26 +138,15 @@ let inline_lets : bool ref -> expression -> expression = Things which can go wrong for beta reduction: - - If e1 contains (meaningful) assignments to free variables, semantics - will not be preserved. - - ? + - Nothing? *) -let can_beta : anon_function -> bool = - fun lam -> - List.for_all - (fun x -> not (is_assigned ~ignore_lambdas:true x lam.body)) - (Free_variables.lambda [] lam) - let beta : bool ref -> expression -> expression = fun changed e -> match e.content with | E_application ({ content = E_closure { binder = x ; body = e1 } ; type_value = T_function (xtv, tv) }, e2) -> - if can_beta { binder = x ; body = e1 } - then - (changed := true ; - Expression.make (E_let_in ((x, xtv), false, e2, e1)) tv) - else e + (changed := true ; + Expression.make (E_let_in ((x, xtv), false, e2, e1)) tv) (* also do CAR (PAIR x y) ↦ x, or CDR (PAIR x y) ↦ y, only if x and y are pure *) | E_constant {cons_name = C_CAR| C_CDR as const; arguments = [ { content = E_constant {cons_name = C_PAIR; arguments = [ e1 ; e2 ]} ; type_value = _ } ]} -> diff --git a/src/passes/7-self_mini_c/subst.ml b/src/passes/7-self_mini_c/subst.ml index 0dd1b4f64..c2103c9f5 100644 --- a/src/passes/7-self_mini_c/subst.ml +++ b/src/passes/7-self_mini_c/subst.ml @@ -90,10 +90,6 @@ let rec replace : expression -> var_name -> var_name -> expression = let e1 = replace e1 in let e2 = replace e2 in return @@ E_sequence (e1, e2) - | E_assignment (v, path, e) -> - let v = replace_var v in - let e = replace e in - return @@ E_assignment (v, path, e) | E_record_update (r, p, e) -> let r = replace r in let e = replace e in @@ -107,7 +103,6 @@ let rec replace : expression -> var_name -> var_name -> expression = Computes `body[x := expr]`. This raises Bad_argument in the case of assignments with a name clash. (`x <- 42[x := 23]` makes no sense.) **) -exception Bad_argument let rec subst_expression : body:expression -> x:var_name -> expr:expression -> expression = fun ~body ~x ~expr -> let self body = subst_expression ~body ~x ~expr in @@ -204,11 +199,6 @@ let rec subst_expression : body:expression -> x:var_name -> expr:expression -> e let ab' = Tuple.map2 self ab in return @@ E_sequence ab' ) - | E_assignment (s, lrl, exp) -> ( - let exp' = self exp in - if Var.equal s x then raise Bad_argument ; - return @@ E_assignment (s, lrl, exp') - ) | E_record_update (r, p, e) -> ( let r' = self r in let e' = self e in diff --git a/src/passes/8-compiler/compiler_environment.ml b/src/passes/8-compiler/compiler_environment.ml index 06cc467de..0736593ee 100644 --- a/src/passes/8-compiler/compiler_environment.ml +++ b/src/passes/8-compiler/compiler_environment.ml @@ -35,29 +35,6 @@ let get : environment -> expression_variable -> michelson result = fun e s -> ok code -let set : environment -> expression_variable -> michelson result = fun e n -> - let%bind (_ , position) = - generic_try (simple_error "Environment.set") @@ - (fun () -> Environment.get_i n e) in - let rec aux_bubble = fun n -> - match n with - | 0 -> dip i_drop - | n -> seq [ - i_swap ; - dip (aux_bubble (n - 1)) ; - ] - in - let aux_dug = fun n -> seq [ - dipn (n + 1) i_drop ; - i_dug n ; - ] in - let code = - if position < 2 - then aux_bubble position - else aux_dug position in - - ok code - let pack_closure : environment -> selector -> michelson result = fun e lst -> let%bind () = Assert.assert_true (e <> []) in diff --git a/src/passes/8-compiler/compiler_environment.mli b/src/passes/8-compiler/compiler_environment.mli index 62bcf7b45..22801279d 100644 --- a/src/passes/8-compiler/compiler_environment.mli +++ b/src/passes/8-compiler/compiler_environment.mli @@ -8,7 +8,6 @@ module Stack = Meta_michelson.Stack *) val empty: environment val get : environment -> expression_variable -> michelson result -val set : environment -> expression_variable -> michelson result val pack_closure : environment -> selector -> michelson result val unpack_closure : environment -> michelson result diff --git a/src/passes/8-compiler/compiler_program.ml b/src/passes/8-compiler/compiler_program.ml index a93b58299..74b3599c2 100644 --- a/src/passes/8-compiler/compiler_program.ml +++ b/src/passes/8-compiler/compiler_program.ml @@ -386,42 +386,6 @@ and translate_expression (expr:expression) (env:environment) : michelson result ] in ok code ) - | E_assignment (name , lrs , expr) -> ( - let%bind expr' = translate_expression expr env in - let%bind get_code = Compiler_environment.get env name in - let modify_code = - let aux acc step = match step with - | `Left -> seq [dip i_unpair ; acc ; i_pair] - | `Right -> seq [dip i_unpiar ; acc ; i_piar] - in - let init = dip i_drop in - List.fold_right' aux init lrs - in - let%bind set_code = Compiler_environment.set env name in - let error = - let title () = "michelson type-checking patch" in - let content () = - let aux ppf = function - | `Left -> Format.fprintf ppf "left" - | `Right -> Format.fprintf ppf "right" in - Format.asprintf "Sub path: %a\n" - PP_helpers.(list_sep aux (const " , ")) lrs - in - error title content in - trace error @@ - return @@ seq [ - i_comment "assign: start # env" ; - expr' ; - i_comment "assign: compute rhs # rhs : env" ; - dip get_code ; - i_comment "assign: get name # rhs : name : env" ; - modify_code ; - i_comment "assign: modify code # name+rhs : env" ; - set_code ; - i_comment "assign: set new # new_env" ; - i_push_unit ; - ] - ) | E_record_update (record, path, expr) -> ( let%bind record' = translate_expression record env in diff --git a/src/stages/mini_c/PP.ml b/src/stages/mini_c/PP.ml index 0fde6061c..9be2e37c3 100644 --- a/src/stages/mini_c/PP.ml +++ b/src/stages/mini_c/PP.ml @@ -104,8 +104,6 @@ and expression' ppf (e:expression') = match e with | E_fold (((name , _) , body) , collection , initial) -> fprintf ppf "fold %a on %a with %a do ( %a )" expression collection expression initial Var.pp name expression body - | E_assignment (r , path , e) -> - fprintf ppf "%a.%a := %a" Var.pp r (list_sep lr (const ".")) path expression e | E_record_update (r, path,update) -> fprintf ppf "%a with { %a = %a }" expression r (list_sep lr (const ".")) path expression update | E_while (e , b) -> diff --git a/src/stages/mini_c/misc.ml b/src/stages/mini_c/misc.ml index 6671af26f..31c816178 100644 --- a/src/stages/mini_c/misc.ml +++ b/src/stages/mini_c/misc.ml @@ -79,8 +79,6 @@ module Free_variables = struct expression (union (singleton v) b) body ; ] | E_sequence (x, y) -> union (self x) (self y) - (* NB different from ast_typed... *) - | E_assignment (v, _, e) -> unions [ var_name b v ; self e ] | E_record_update (r, _,e) -> union (self r) (self e) | E_while (cond , body) -> union (self cond) (self body) diff --git a/src/stages/mini_c/types.ml b/src/stages/mini_c/types.ml index f8d65759d..b1e419b8b 100644 --- a/src/stages/mini_c/types.ml +++ b/src/stages/mini_c/types.ml @@ -72,7 +72,6 @@ and expression' = | E_if_left of expression * ((var_name * type_value) * expression) * ((var_name * type_value) * expression) | E_let_in of ((var_name * type_value) * inline * expression * expression) | E_sequence of (expression * expression) - | E_assignment of (expression_variable * [`Left | `Right] list * expression) | E_record_update of (expression * [`Left | `Right] list * expression) | E_while of (expression * expression) From 00e6959503c2f1069df3a4659aa8db427ddc3665 Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Mon, 2 Mar 2020 18:01:56 +0100 Subject: [PATCH 06/40] Refactoring of the test contracts. --- src/bin/expect_tests/contract_tests.ml | 106 ++++----- src/passes/operators/operators.ml | 4 +- src/test/contracts/address.mligo | 4 +- src/test/contracts/address.religo | 4 +- src/test/contracts/amount.ligo | 2 +- src/test/contracts/amount.mligo | 2 +- src/test/contracts/amount.religo | 9 +- src/test/contracts/arithmetic.ligo | 2 - src/test/contracts/arithmetic.mligo | 19 +- src/test/contracts/arithmetic.religo | 30 +-- src/test/contracts/assert.religo | 6 +- src/test/contracts/attributes.mligo | 3 - src/test/contracts/attributes.religo | 8 +- src/test/contracts/bad_address_format.religo | 5 +- src/test/contracts/balance_constant.mligo | 6 +- src/test/contracts/balance_constant.religo | 5 +- src/test/contracts/big_map.mligo | 3 - src/test/contracts/big_map.religo | 22 +- src/test/contracts/bitwise_arithmetic.mligo | 6 +- src/test/contracts/boolean_operators.mligo | 12 +- src/test/contracts/boolean_operators.religo | 14 +- src/test/contracts/bytes_arithmetic.mligo | 4 +- src/test/contracts/bytes_unpack.religo | 18 +- src/test/contracts/check_signature.religo | 4 +- src/test/contracts/closure.mligo | 2 +- src/test/contracts/closure.religo | 10 +- src/test/contracts/condition-annot.religo | 8 +- src/test/contracts/condition-shadowing.mligo | 7 +- src/test/contracts/condition.religo | 7 +- src/test/contracts/counter.mligo | 3 +- src/test/contracts/counter.religo | 7 +- src/test/contracts/crypto.religo | 4 +- src/test/contracts/curry.mligo | 4 - src/test/contracts/empty_case.religo | 10 +- src/test/contracts/eq_bool.religo | 8 +- src/test/contracts/failwith.religo | 6 +- src/test/contracts/fibo.mligo | 2 +- src/test/contracts/fibo3.mligo | 2 +- src/test/contracts/fibo4.mligo | 6 +- src/test/contracts/function-shared.mligo | 2 - src/test/contracts/function-shared.religo | 8 +- src/test/contracts/guess_string.mligo | 10 +- src/test/contracts/hashlock.mligo | 85 ++++--- src/test/contracts/high-order.mligo | 40 ++-- src/test/contracts/high-order.religo | 52 ++--- src/test/contracts/id.mligo | 182 +++++++-------- src/test/contracts/implicit.mligo | 6 +- src/test/contracts/implicit_account.mligo | 2 +- src/test/contracts/implicit_account.religo | 3 +- src/test/contracts/incr_decr.mligo | 18 +- src/test/contracts/interpret_test.mligo | 218 +++++++++--------- src/test/contracts/isnat.mligo | 2 +- src/test/contracts/isnat.religo | 2 +- src/test/contracts/key_hash.mligo | 8 +- src/test/contracts/key_hash.religo | 11 +- src/test/contracts/lambda.mligo | 5 +- src/test/contracts/lambda.religo | 4 +- src/test/contracts/lambda2.mligo | 6 +- src/test/contracts/lambda2.religo | 6 +- src/test/contracts/let_in_multi_bind.mligo | 4 +- src/test/contracts/let_multiple.mligo | 24 +- src/test/contracts/let_multiple.religo | 15 +- src/test/contracts/letin.mligo | 2 +- src/test/contracts/letin.religo | 12 +- src/test/contracts/list.mligo | 18 +- src/test/contracts/list.religo | 38 +-- src/test/contracts/loop.mligo | 38 +-- src/test/contracts/loop.religo | 55 ++--- src/test/contracts/map.mligo | 35 +-- src/test/contracts/map.religo | 51 ++-- src/test/contracts/match.mligo | 26 ++- src/test/contracts/match.religo | 25 +- src/test/contracts/match_bis.mligo | 22 +- src/test/contracts/match_bis.religo | 27 +-- src/test/contracts/multiple-parameters.mligo | 2 +- src/test/contracts/multiple-parameters.religo | 7 +- src/test/contracts/multisig.mligo | 88 ++++--- src/test/contracts/multisig.religo | 89 ++++--- .../contracts/negative/self_in_lambda.mligo | 4 +- src/test/contracts/option.religo | 6 +- src/test/contracts/record.mligo | 51 ++-- src/test/contracts/record.religo | 45 ++-- src/test/contracts/self_address.ligo | 2 +- src/test/contracts/self_address.mligo | 2 +- src/test/contracts/self_address.religo | 2 +- src/test/contracts/set_arithmetic-1.mligo | 3 +- src/test/contracts/set_arithmetic.mligo | 6 +- src/test/contracts/set_arithmetic.religo | 27 +-- src/test/contracts/set_delegate.mligo | 6 +- src/test/contracts/set_delegate.religo | 6 +- src/test/contracts/string_arithmetic.mligo | 8 +- src/test/contracts/string_arithmetic.religo | 6 +- src/test/contracts/subtle_nontail_fail.mligo | 2 +- src/test/contracts/super-counter.mligo | 22 +- src/test/contracts/super-counter.religo | 22 +- src/test/contracts/tez.mligo | 9 +- src/test/contracts/timelock_repeat.mligo | 32 +-- src/test/contracts/tuple.mligo | 2 +- src/test/contracts/tuple_type.mligo | 15 +- src/test/contracts/tuple_type.religo | 46 ++-- .../tuples_sequences_functions.religo | 4 +- src/test/contracts/type_tuple_destruct.mligo | 6 +- src/test/contracts/variant.mligo | 2 - src/test/contracts/variant.religo | 14 +- src/test/contracts/vote.mligo | 89 ++++--- src/test/contracts/website2.mligo | 6 +- src/test/contracts/website2.religo | 16 +- src/test/hash_lock_tests.ml | 10 +- src/test/time_lock_repeat_tests.ml | 4 +- src/test/vote_tests.ml | 39 ++-- 110 files changed, 999 insertions(+), 1147 deletions(-) diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index 317c8a87a..1f6ff779a 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -16,7 +16,7 @@ let%expect_test _ = [%expect {| 3231 bytes |}] ; run_ligo_good [ "measure-contract" ; contract "vote.mligo" ; "main" ] ; - [%expect {| 642 bytes |}] ; + [%expect {| 589 bytes |}] ; run_ligo_good [ "compile-parameter" ; contract "coase.ligo" ; "main" ; "Buy_single (record card_to_buy = 1n end)" ] ; [%expect {| (Left (Left 1)) |}] ; @@ -948,40 +948,27 @@ let%expect_test _ = run_ligo_good [ "compile-contract" ; contract "vote.mligo" ; "main" ] ; [%expect {| { parameter - (or (pair %init - (pair (timestamp %beginning_time) (timestamp %finish_time)) - (string %title)) - (string %vote)) ; + (or (pair %reset (pair (timestamp %finish_time) (timestamp %start_time)) (string %title)) + (or %vote (unit %nay) (unit %yea))) ; storage - (pair (pair (pair (timestamp %beginning_time) (map %candidates string int)) - (pair (timestamp %finish_time) (string %title))) - (set %voters address)) ; + (pair (pair (pair (timestamp %finish_time) (nat %nay)) + (pair (timestamp %start_time) (string %title))) + (pair (set %voters address) (nat %yea))) ; code { DUP ; + DUP ; CAR ; IF_LEFT { DUP ; - DIP { DIP { DUP } ; SWAP ; CDR } ; - PAIR ; DUP ; CAR ; CAR ; - CAR ; - DIP { PUSH int 0 ; - SOME ; - DIP { PUSH int 0 ; - SOME ; - EMPTY_MAP string int ; - SWAP ; - PUSH string "Yes" ; - UPDATE } ; - PUSH string "No" ; - UPDATE } ; - PAIR ; - DIP { DUP ; CAR ; CAR ; CDR ; DIP { DUP ; CAR ; CDR } ; PAIR } ; - PAIR ; - EMPTY_SET address ; + PUSH nat 0 ; SWAP ; PAIR ; + DIP { DUP ; CAR ; CDR ; DIP { DUP ; CDR } ; PAIR } ; + PAIR ; + DIP { PUSH nat 0 ; EMPTY_SET address ; PAIR } ; + PAIR ; NIL operation ; PAIR ; DIP { DROP 2 } } @@ -989,41 +976,56 @@ let%expect_test _ = DIP { DIP { DUP } ; SWAP ; CDR } ; PAIR ; DUP ; + CDR ; + DIP { DUP } ; + SWAP ; CAR ; - DIP { DUP ; CDR ; CAR ; CAR ; CDR } ; - GET ; - IF_NONE { PUSH string "MAP FIND" ; FAILWITH } {} ; + IF_LEFT + { DIP { DUP } ; + SWAP ; + DIP 2 { DUP } ; + DIG 2 ; + CAR ; + CAR ; + CDR ; + PUSH nat 1 ; + ADD ; + DIP { DUP ; CDR ; SWAP ; CAR ; DUP ; CDR ; SWAP ; CAR ; CAR } ; + SWAP ; + PAIR ; + PAIR ; + PAIR ; + DIP { DROP } } + { DIP { DUP } ; + SWAP ; + DIP 2 { DUP } ; + DIG 2 ; + CDR ; + CDR ; + PUSH nat 1 ; + ADD ; + DIP { DUP ; CAR ; SWAP ; CDR ; CAR } ; + SWAP ; + PAIR ; + SWAP ; + PAIR ; + DIP { DROP } } ; + DUP ; DIP { DUP } ; SWAP ; CDR ; CAR ; - CAR ; - CAR ; - DIP { DIP { DUP } ; - SWAP ; - CAR ; - DIP { DUP ; - PUSH int 1 ; - ADD ; - SOME ; - DIP { DIP { DUP } ; SWAP ; CDR ; CAR ; CAR ; CDR } } ; - UPDATE } ; + PUSH bool True ; + SENDER ; + UPDATE ; + DIP { DUP ; CAR ; SWAP ; CDR ; CDR } ; PAIR ; - DIP { DIP { DUP } ; - SWAP ; - CDR ; - CAR ; - CDR ; - CAR ; - DIP { DIP { DUP } ; SWAP ; CDR ; CAR ; CDR ; CDR } ; - PAIR } ; - PAIR ; - DIP { DIP { DUP } ; SWAP ; CDR ; CDR ; PUSH bool True ; SENDER ; UPDATE } ; + SWAP ; PAIR ; NIL operation ; PAIR ; - DIP { DROP 3 } } ; - DIP { DROP } } } |}] + DIP { DROP 4 } } ; + DIP { DROP 2 } } } |}] let%expect_test _ = run_ligo_good [ "compile-contract" ; contract "implicit.mligo" ; "main" ] ; @@ -1064,7 +1066,7 @@ let%expect_test _ = let%expect_test _ = run_ligo_bad [ "compile-contract" ; contract "bad_address_format.religo" ; "main" ] ; [%expect {| - ligo: in file "bad_address_format.religo", line 2, characters 25-47. Badly formatted literal: @"KT1badaddr" {"location":"in file \"bad_address_format.religo\", line 2, characters 25-47"} + ligo: in file "bad_address_format.religo", line 2, characters 26-48. Badly formatted literal: @"KT1badaddr" {"location":"in file \"bad_address_format.religo\", line 2, characters 26-48"} If you're not sure how to fix this error, you can diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index 4c72934b2..bdab8d765 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -325,9 +325,9 @@ module Simplify = struct | "Bytes.pack" -> ok C_BYTES_PACK | "Bytes.unpack" -> ok C_BYTES_UNPACK | "Bytes.length" -> ok C_SIZE - | "Bytes.size" -> ok C_SIZE + | "Bytes.size" -> ok C_SIZE (* Deprecated *) | "Bytes.concat" -> ok C_CONCAT - | "Bytes.slice" -> ok C_SLICE + | "Bytes.slice" -> ok C_SLICE (* Deprecated *) | "Bytes.sub" -> ok C_SLICE (* List module *) diff --git a/src/test/contracts/address.mligo b/src/test/contracts/address.mligo index 2b24b7d08..e4d873bbe 100644 --- a/src/test/contracts/address.mligo +++ b/src/test/contracts/address.mligo @@ -1,3 +1,3 @@ let main (p : key_hash) = - let c : unit contract = Current.implicit_account p - in Current.address c + let c : unit contract = Tezos.implicit_account p + in Tezos.address c diff --git a/src/test/contracts/address.religo b/src/test/contracts/address.religo index df1742ce1..7a5222e04 100644 --- a/src/test/contracts/address.religo +++ b/src/test/contracts/address.religo @@ -1,4 +1,4 @@ let main = (p : key_hash) : address => { - let c : contract(unit) = Current.implicit_account(p) ; - Current.address(c) ; + let c : contract (unit) = Tezos.implicit_account (p); + Tezos.address(c); }; diff --git a/src/test/contracts/amount.ligo b/src/test/contracts/amount.ligo index c7816fae3..0bad23a72 100644 --- a/src/test/contracts/amount.ligo +++ b/src/test/contracts/amount.ligo @@ -1,5 +1,5 @@ function check (const p : unit) : int is block { var result : int := 0; - if amount = 100tz then result := 42 else result := 0 + if amount = 100tez then result := 42 else result := 0 } with result diff --git a/src/test/contracts/amount.mligo b/src/test/contracts/amount.mligo index c14228fc4..483436507 100644 --- a/src/test/contracts/amount.mligo +++ b/src/test/contracts/amount.mligo @@ -1 +1 @@ -let check_ (p : unit) : int = if Tezos.amount = 100tz then 42 else 0 +let check_ (p : unit) : int = if Tezos.amount = 100tez then 42 else 0 diff --git a/src/test/contracts/amount.religo b/src/test/contracts/amount.religo index 9d19491b8..f33527daa 100644 --- a/src/test/contracts/amount.religo +++ b/src/test/contracts/amount.religo @@ -1,7 +1,2 @@ -let check_ = (p: unit) : int => - if (Current.amount == 100tz) { - 42; - } - else { - 0; - }; +let check_ = (p : unit) : int => + if (Tezos.amount == 100tez) { 42; } else { 0; }; diff --git a/src/test/contracts/arithmetic.ligo b/src/test/contracts/arithmetic.ligo index a4a6c51cb..b9bfca273 100644 --- a/src/test/contracts/arithmetic.ligo +++ b/src/test/contracts/arithmetic.ligo @@ -1,5 +1,3 @@ -// Test PascaLIGO arithmetic operators - function mod_op (const n : int) : nat is n mod 42 function plus_op (const n : int) : int is n + 42 function minus_op (const n : int) : int is n - 42 diff --git a/src/test/contracts/arithmetic.mligo b/src/test/contracts/arithmetic.mligo index 66c241f86..3225027ab 100644 --- a/src/test/contracts/arithmetic.mligo +++ b/src/test/contracts/arithmetic.mligo @@ -1,17 +1,8 @@ -// Test CameLIGO arithmetic operators - -let mod_op (n : int) : nat = n mod 42 - -let plus_op (n : int) : int = n + 42 - +let mod_op (n : int) : nat = n mod 42 +let plus_op (n : int) : int = n + 42 let minus_op (n : int) : int = n - 42 - let times_op (n : int) : int = n * 42 - -let div_op (n : int) : int = n / 2 - -let neg_op (n : int) : int = -n - -let foo (n : int) : int = n + 10 - +let div_op (n : int) : int = n / 2 +let neg_op (n : int) : int = -n +let foo (n : int) : int = n + 10 let neg_op_2 (b : int) : int = -(foo b) diff --git a/src/test/contracts/arithmetic.religo b/src/test/contracts/arithmetic.religo index 6d7fc5d29..c598e125d 100644 --- a/src/test/contracts/arithmetic.religo +++ b/src/test/contracts/arithmetic.religo @@ -1,24 +1,10 @@ /* Test ReasonLIGO arithmetic operators */ -let mod_op = (n: int): nat => n mod 42; - -let plus_op = (n: int): int => n + 42; - -let minus_op = (n: int): int => n - 42; - -let times_op = (n: int): int => n * 42; - -let div_op = (n: int): int => n / 2; - -/* TODO (?): Support conversion from nat to int and back - - let int_op (n : nat) : int = - Int n - - */ - -let neg_op = (n: int): int => - n; - -let foo = (n: int): int => n + 10; - -let neg_op_2 = (b: int): int => - foo(b); +let mod_op = (n : int) : nat => n mod 42; +let plus_op = (n : int) : int => n + 42; +let minus_op = (n : int) : int => n - 42; +let times_op = (n : int) : int => n * 42; +let div_op = (n : int) : int => n / 2; +let neg_op = (n : int): int => - n; +let foo = (n : int): int => n + 10; +let neg_op_2 = (b : int): int => -foo(b); diff --git a/src/test/contracts/assert.religo b/src/test/contracts/assert.religo index 26b9f0775..d35ee11e2 100644 --- a/src/test/contracts/assert.religo +++ b/src/test/contracts/assert.religo @@ -1,4 +1,4 @@ -let main = (p: bool, s: unit) => { - let u: unit = assert(p); - ([]: list(operation), s); +let main = (p, s : bool, unit) => { + let u : unit = assert (p); + ([]: list (operation), s); }; diff --git a/src/test/contracts/attributes.mligo b/src/test/contracts/attributes.mligo index a96d63710..d87f4e8e7 100644 --- a/src/test/contracts/attributes.mligo +++ b/src/test/contracts/attributes.mligo @@ -1,10 +1,7 @@ let x = 1 [@@inline] - let foo (a : int): int = (let test = 2 + a [@@inline] in test) [@@inline] - let y = 1 [@@inline][@@other] - let bar (b : int): int = let test = fun (z : int) -> 2 + b + z [@@inline][@@foo][@@bar] in test b diff --git a/src/test/contracts/attributes.religo b/src/test/contracts/attributes.religo index 33062220f..d79928769 100644 --- a/src/test/contracts/attributes.religo +++ b/src/test/contracts/attributes.religo @@ -2,7 +2,7 @@ let x = 1; [@inline] -let foo = (a: int): int => { +let foo = (a : int) : int => { [@inline] let test = 2 + a; test; @@ -11,8 +11,8 @@ let foo = (a: int): int => { [@inline][@other] let y = 1; -let bar = (b: int): int => { +let bar = (b : int) : int => { [@inline][@foo][@bar] - let test = (z: int) => 2 + b + z; - test(b); + let test = (z : int) => 2 + b + z; + test (b); }; diff --git a/src/test/contracts/bad_address_format.religo b/src/test/contracts/bad_address_format.religo index c8668bc45..81f4739b7 100644 --- a/src/test/contracts/bad_address_format.religo +++ b/src/test/contracts/bad_address_format.religo @@ -1,3 +1,2 @@ -let main = (parameter: int, storage: address) => { - ([]:list(operation), "KT1badaddr" : address); -}; +let main = (parameter : int, storage : address) => + ([] : list (operation), "KT1badaddr" : address); diff --git a/src/test/contracts/balance_constant.mligo b/src/test/contracts/balance_constant.mligo index b73319f8f..53cba0c29 100644 --- a/src/test/contracts/balance_constant.mligo +++ b/src/test/contracts/balance_constant.mligo @@ -10,7 +10,9 @@ generated. unrecognized constant: {"constant":"BALANCE","location":"generated"} *) +type parameter = unit type storage = tez +type return = operation list * storage -let main (p, s : unit * storage) = - ([] : operation list), balance +let main (p, s : parameter * storage) : return = + ([] : operation list), Tezos.balance diff --git a/src/test/contracts/balance_constant.religo b/src/test/contracts/balance_constant.religo index efa80fc48..1d136052b 100644 --- a/src/test/contracts/balance_constant.religo +++ b/src/test/contracts/balance_constant.religo @@ -12,6 +12,7 @@ generated. unrecognized constant: {"constant":"BALANCE","location":"generated"} type storage = tez; -let main2 = (p: unit, storage) => ([]: list(operation), balance); +let main2 = (p : unit, storage) => + ([]: list (operation), Tezos.balance); -let main = (x: (unit, storage)) => main2(x[0],x[1]); +let main = (x : (unit, storage)) => main2 (x[0], x[1]); diff --git a/src/test/contracts/big_map.mligo b/src/test/contracts/big_map.mligo index 434878013..270826e51 100644 --- a/src/test/contracts/big_map.mligo +++ b/src/test/contracts/big_map.mligo @@ -1,11 +1,9 @@ type foo = (int, int) big_map let set_ (n, m: int * foo) : foo = Big_map.update 23 (Some n) m - let add (n, m : int * foo) : foo = Big_map.add 23 n m let rm (m : foo) : foo = Big_map.remove 42 m - let gf (m : foo) : int = Big_map.find 23 m let get (m : foo): int option = Big_map.find_opt 42 m @@ -13,7 +11,6 @@ let get (m : foo): int option = Big_map.find_opt 42 m let empty_map : foo = Big_map.empty let map1 : foo = Big_map.literal [(23,0); (42,0)] - let map1 : foo = Big_map.literal [(23,0); (42,0)] let mutimaps (m : foo) (n : foo) : foo = diff --git a/src/test/contracts/big_map.religo b/src/test/contracts/big_map.religo index 92f5431c8..44d64c92e 100644 --- a/src/test/contracts/big_map.religo +++ b/src/test/contracts/big_map.religo @@ -1,24 +1,22 @@ type foo = big_map(int, int); -let set2 = (n: int, m: foo): foo => Big_map.update(23, Some(n), m); +let set2 = (n : int, m : foo) : foo => Big_map.update (23, Some (n), m); -let set_ = (x: (int, foo)): foo => set2(x[0], x[1]); +let set_ = (x : (int, foo)) : foo => set2 (x[0], x[1]); -let add = ((n,m): (int, foo)): foo => Big_map.add(23, n, m); +let add = ((n,m) : (int, foo)) : foo => Big_map.add (23, n, m); -let rm = (m: foo): foo => Big_map.remove(42, m); +let rm = (m : foo) : foo => Big_map.remove (42, m); -let gf = (m: foo): int => Big_map.find(23, m); +let gf = (m : foo) : int => Big_map.find (23, m); -let get = (m: foo): option(int) => Big_map.find_opt(42, m); +let get = (m : foo) : option (int) => Big_map.find_opt (42, m); -let empty_map: foo = Big_map.empty; +let empty_map : foo = Big_map.empty; -let map1: foo = Big_map.literal([(23, 0), (42, 0)]); - -let map1: foo = Big_map.literal([(23, 0), (42, 0)]); +let map1 : foo = Big_map.literal ([(23,0), (42,0)]); let mutimaps = (m: foo, n: foo): foo => { - let bar: foo = Big_map.update(42, Some(0), m); - Big_map.update(42, get(bar), n); + let bar : foo = Big_map.update (42, Some (0), m); + Big_map.update (42, get (bar), n); }; diff --git a/src/test/contracts/bitwise_arithmetic.mligo b/src/test/contracts/bitwise_arithmetic.mligo index 5675df1b8..7cb38f439 100644 --- a/src/test/contracts/bitwise_arithmetic.mligo +++ b/src/test/contracts/bitwise_arithmetic.mligo @@ -1,7 +1,7 @@ (* Test CameLIGO bitwise operators *) -let or_op (n : nat) : nat = Bitwise.lor n 4n -let and_op (n : nat) : nat = Bitwise.land n 7n -let xor_op (n : nat) : nat = Bitwise.lxor n 7n +let or_op (n : nat) : nat = Bitwise.or n 4n +let and_op (n : nat) : nat = Bitwise.and n 7n +let xor_op (n : nat) : nat = Bitwise.xor n 7n let lsl_op (n : nat) : nat = Bitwise.shift_left n 7n let lsr_op (n : nat) : nat = Bitwise.shift_right n 7n diff --git a/src/test/contracts/boolean_operators.mligo b/src/test/contracts/boolean_operators.mligo index 63091dbf8..1c5b46a00 100644 --- a/src/test/contracts/boolean_operators.mligo +++ b/src/test/contracts/boolean_operators.mligo @@ -1,11 +1,7 @@ // Test CameLIGO boolean operators -let or_true (b : bool) : bool = b || true - -let or_false (b : bool) : bool = b || false - -let and_true (b : bool) : bool = b && true - +let or_true (b : bool) : bool = b || true +let or_false (b : bool) : bool = b || false +let and_true (b : bool) : bool = b && true let and_false (b : bool) : bool = b && false - -let not_bool (b : bool) : bool = not b +let not_bool (b : bool) : bool = not b diff --git a/src/test/contracts/boolean_operators.religo b/src/test/contracts/boolean_operators.religo index 8603380a7..acacfb198 100644 --- a/src/test/contracts/boolean_operators.religo +++ b/src/test/contracts/boolean_operators.religo @@ -1,11 +1,7 @@ // Test ReasonLIGO boolean operators -let or_true = (b: bool): bool => b || true; - -let or_false = (b: bool): bool => b || false; - -let and_true = (b: bool): bool => b && true; - -let and_false = (b: bool): bool => b && false; - -let not_bool = (b: bool): bool => !b; +let or_true = (b : bool) : bool => b || true; +let or_false = (b : bool) : bool => b || false; +let and_true = (b : bool) : bool => b && true; +let and_false = (b : bool) : bool => b && false; +let not_bool = (b : bool) : bool => !b; diff --git a/src/test/contracts/bytes_arithmetic.mligo b/src/test/contracts/bytes_arithmetic.mligo index 44d89cb36..dbdc2a147 100644 --- a/src/test/contracts/bytes_arithmetic.mligo +++ b/src/test/contracts/bytes_arithmetic.mligo @@ -1,5 +1,3 @@ let concat_op (s : bytes) : bytes = Bytes.concat s 0x7070 - -let slice_op (s : bytes) : bytes = Bytes.slice 1n 2n s - +let slice_op (s : bytes) : bytes = Bytes.sub 1n 2n s let hasherman (s : bytes) : bytes = Crypto.sha256 s diff --git a/src/test/contracts/bytes_unpack.religo b/src/test/contracts/bytes_unpack.religo index 86b291ecc..f8119e564 100644 --- a/src/test/contracts/bytes_unpack.religo +++ b/src/test/contracts/bytes_unpack.religo @@ -1,14 +1,14 @@ -let id_string = (p: string) : option(string) => { - let packed : bytes = Bytes.pack(p); - ((Bytes.unpack(packed)): option(string)); +let id_string = (p : string) : option(string) => { + let packed : bytes = Bytes.pack (p); + ((Bytes.unpack (packed)) : option (string)); }; -let id_int = (p: int) : option(int) => { - let packed: bytes = Bytes.pack(p); - ((Bytes.unpack(packed)): option(int)); +let id_int = (p : int) : option (int) => { + let packed : bytes = Bytes.pack (p); + ((Bytes.unpack (packed)) : option (int)); }; -let id_address = (p: address) : option(address) => { - let packed: bytes = Bytes.pack(p); - ((Bytes.unpack(packed)): option(address)); +let id_address = (p : address) : option (address) => { + let packed : bytes = Bytes.pack (p); + ((Bytes.unpack (packed)) : option (address)); }; diff --git a/src/test/contracts/check_signature.religo b/src/test/contracts/check_signature.religo index 9d2f266ce..992e693fd 100644 --- a/src/test/contracts/check_signature.religo +++ b/src/test/contracts/check_signature.religo @@ -1,4 +1,4 @@ -let check_signature = (param: (key, signature, bytes)) : bool => { +let check_signature = (param : (key, signature, bytes)) : bool => { let pk, signed, msg = param; - Crypto.check(pk, signed, msg); + Crypto.check (pk, signed, msg); }; diff --git a/src/test/contracts/closure.mligo b/src/test/contracts/closure.mligo index ddd866df7..d849db1f0 100644 --- a/src/test/contracts/closure.mligo +++ b/src/test/contracts/closure.mligo @@ -1,4 +1,4 @@ -(* Test whether closures retain values in CameLIGO *) +(* Test whether closures capture variables in CameLIGO *) let test (k : int) : int = let j : int = k + 5 in diff --git a/src/test/contracts/closure.religo b/src/test/contracts/closure.religo index a17ddb728..72eaac5da 100644 --- a/src/test/contracts/closure.religo +++ b/src/test/contracts/closure.religo @@ -1,9 +1,9 @@ /* Test whether closures retain values in ReasonLIGO */ -let test = (k: int): int => { - let j: int = k + 5; - let close: (int => int) = (i: int) => i + j; +let test = (k : int) : int => { + let j : int = k + 5; + let close : (int => int) = (i : int) => i + j; - let j: int = 20; /* Shadow original variable to see if value close'd */ - close(20); + let j : int = 20; /* Shadow original variable */ + close (20); }; diff --git a/src/test/contracts/condition-annot.religo b/src/test/contracts/condition-annot.religo index 97e14f489..792090326 100644 --- a/src/test/contracts/condition-annot.religo +++ b/src/test/contracts/condition-annot.religo @@ -1,6 +1,2 @@ -let main = (i: int) => - if (((i == 2): bool)) { - (42: int); - } else { - (0: int); - }; +let main = (i : int) => + if (((i == 2) : bool)) { (42 : int); } else { (0 : int); }; diff --git a/src/test/contracts/condition-shadowing.mligo b/src/test/contracts/condition-shadowing.mligo index 64f1ff42f..577d3f4b5 100644 --- a/src/test/contracts/condition-shadowing.mligo +++ b/src/test/contracts/condition-shadowing.mligo @@ -1,6 +1,5 @@ let main (i : int) = let result = 0 in - if i = 2 then - let result = 42 in result - else - let result = 0 in result + if i = 2 + then let result = 42 in result + else let result = 0 in result diff --git a/src/test/contracts/condition.religo b/src/test/contracts/condition.religo index e44e93d7f..231fbe3fe 100644 --- a/src/test/contracts/condition.religo +++ b/src/test/contracts/condition.religo @@ -1,8 +1,3 @@ /* Test conditional in ReasonLIGO */ -let main = (i: int) => - if (i == 2) { - 42; - } else { - 0; - }; +let main = (i : int) => if (i == 2) { 42; } else { 0; }; diff --git a/src/test/contracts/counter.mligo b/src/test/contracts/counter.mligo index 548a1e07e..c16620367 100644 --- a/src/test/contracts/counter.mligo +++ b/src/test/contracts/counter.mligo @@ -1,4 +1,3 @@ type storage = int -let main (ps : int * storage) = - ([] : operation list), ps.0 + ps.1 +let main (p, s : int * storage) = ([] : operation list), p + s diff --git a/src/test/contracts/counter.religo b/src/test/contracts/counter.religo index 8ed3f201f..a2c27966f 100644 --- a/src/test/contracts/counter.religo +++ b/src/test/contracts/counter.religo @@ -1,7 +1,4 @@ - type storage = int; -let main2 = (p: int, storage): string => ([]: list(operation), p + storage); - -let main = (x: (int, storage)) : string => main2(x[0],x[1]); - +let main = ((p, s) : (int, storage)) : (list (operation), storage) => + ([] : list (operation), p + s); diff --git a/src/test/contracts/crypto.religo b/src/test/contracts/crypto.religo index c5b17ce8e..befe63391 100644 --- a/src/test/contracts/crypto.religo +++ b/src/test/contracts/crypto.religo @@ -1,2 +1,2 @@ -let hasherman512 = (s: bytes) => Crypto.sha512(s); -let hasherman_blake = (s: bytes) => Crypto.blake2b(s); +let hasherman512 = (s : bytes) => Crypto.sha512 (s); +let hasherman_blake = (s : bytes) => Crypto.blake2b (s); diff --git a/src/test/contracts/curry.mligo b/src/test/contracts/curry.mligo index ffcaafe15..9584cf7b1 100644 --- a/src/test/contracts/curry.mligo +++ b/src/test/contracts/curry.mligo @@ -1,9 +1,5 @@ let conv_test (j : int) (k : int) = j + k - let main (i : int) : int = conv_test i 10 - let partial (a : int) (b : int) : int = a + b - let mk_partial (j : int) : int -> int = partial j - let partial_apply (i : int) : int = mk_partial 10 i diff --git a/src/test/contracts/empty_case.religo b/src/test/contracts/empty_case.religo index c5d6bdc5a..68d179140 100644 --- a/src/test/contracts/empty_case.religo +++ b/src/test/contracts/empty_case.religo @@ -1,9 +1,9 @@ type foo = - | Bar(int) - | Baz; +| Bar (int) +| Baz; -let main = (f: foo): int => +let main = (f : foo) : int => switch (f) { - | Bar(i) => i - | Baz => (-1) + | Bar (i) => i + | Baz => (-1) }; diff --git a/src/test/contracts/eq_bool.religo b/src/test/contracts/eq_bool.religo index 5674d49b5..85e52ae7c 100644 --- a/src/test/contracts/eq_bool.religo +++ b/src/test/contracts/eq_bool.religo @@ -1,8 +1,4 @@ /* Test boolean comparison in ReasonLIGO */ -let main = ((a , b) : (bool , bool)) => - if (a == b) { - 999; - } else { - 1; - }; +let main = ((a, b) : (bool, bool)) => + if (a == b) { 999; } else { 1; }; diff --git a/src/test/contracts/failwith.religo b/src/test/contracts/failwith.religo index c7b028c3e..24317a106 100644 --- a/src/test/contracts/failwith.religo +++ b/src/test/contracts/failwith.religo @@ -1,8 +1,4 @@ type storage = unit; let main = (p: unit, storage) => - if (true) { - failwith("This contract always fails"); - } else { - (); - }; + if (true) { failwith("This contract always fails"); }; diff --git a/src/test/contracts/fibo.mligo b/src/test/contracts/fibo.mligo index 3d2e3a687..73886ccce 100644 --- a/src/test/contracts/fibo.mligo +++ b/src/test/contracts/fibo.mligo @@ -1,6 +1,6 @@ type storage = unit -let main (p : unit; store : storage) : operation list * storage = +let main (p, store : unit * storage) : operation list * storage = let n = (fun (f : int * int -> int) (x : int) (y : int) -> f (y,x)) (fun (x : int) (y : int) -> x + y) diff --git a/src/test/contracts/fibo3.mligo b/src/test/contracts/fibo3.mligo index 836f24517..bfa5a5dd3 100644 --- a/src/test/contracts/fibo3.mligo +++ b/src/test/contracts/fibo3.mligo @@ -1,6 +1,6 @@ type storage = unit -let main (p : unit; store : storage) : operation list * storage = +let main (p, s : unit * storage) : operation list * storage = let n = (fun (f : int -> int -> int) (x : int) (y : int) -> f y (x+y)) (fun (x : int) (y : int) -> x + y) diff --git a/src/test/contracts/fibo4.mligo b/src/test/contracts/fibo4.mligo index ccb3e5451..9806eabee 100644 --- a/src/test/contracts/fibo4.mligo +++ b/src/test/contracts/fibo4.mligo @@ -1,6 +1,6 @@ type storage = unit -let main (p: unit) storage = - (fun (f: int -> int) (x: int) -> f x) - (fun (x: int) -> x) +let main (p, s : unit * storage) = + (fun (f : int -> int) (x : int) -> f x) + (fun (x : int) -> x) 1 diff --git a/src/test/contracts/function-shared.mligo b/src/test/contracts/function-shared.mligo index e8f70f6bd..044af0d32 100644 --- a/src/test/contracts/function-shared.mligo +++ b/src/test/contracts/function-shared.mligo @@ -1,7 +1,5 @@ (* Test use of multiple subroutines in a CameLIGO function *) let foo (i : int) : int = i + 20 - let bar (i : int) : int = i + 50 - let foobar (i : int) : int = foo i + bar i diff --git a/src/test/contracts/function-shared.religo b/src/test/contracts/function-shared.religo index 94cc6b337..0e6c9dc47 100644 --- a/src/test/contracts/function-shared.religo +++ b/src/test/contracts/function-shared.religo @@ -1,7 +1,5 @@ /* Test use of multiple subroutines in a ReasonLIGO function */ -let foo = (i: int): int => i + 20; - -let bar = (i: int): int => i + 50; - -let foobar = (i: int): int => foo(i) + bar(i); +let foo = (i : int) : int => i + 20; +let bar = (i : int) : int => i + 50; +let foobar = (i : int) : int => foo (i) + bar (i); diff --git a/src/test/contracts/guess_string.mligo b/src/test/contracts/guess_string.mligo index adde5b642..0b2395180 100644 --- a/src/test/contracts/guess_string.mligo +++ b/src/test/contracts/guess_string.mligo @@ -9,10 +9,14 @@ type param = { type return = operation list * storage -let attempt (p: param; store : storage) : return = +let attempt (p, store : param * storage) : return = (* if p.attempt <> store.challenge then failwith "Failed challenge" else *) - let contract : unit contract = Operation.get_contract sender in + let contract : unit contract = + match (Tezos.get_contract_opt Tezos.sender : unit contract option) with + Some contract -> contract + | None -> (failwith "No contract" : unit contract) + in let transfer : operation = - Operation.transaction (unit, contract, 10.00tez) in + Tezos.transaction (unit, contract, 10.00tez) in let store : storage = {challenge = p.new_challenge} in ([] : operation list), store diff --git a/src/test/contracts/hashlock.mligo b/src/test/contracts/hashlock.mligo index 1f6fa02a1..c354bdfc2 100644 --- a/src/test/contracts/hashlock.mligo +++ b/src/test/contracts/hashlock.mligo @@ -1,56 +1,67 @@ type commit = { - date: timestamp; - salted_hash: bytes; + date : timestamp; + salted_hash : bytes; } type commit_set = (address, commit) big_map type storage = { - hashed: bytes; - unused: bool; - commits: commit_set; + hashed : bytes; + unused : bool; + commits : commit_set } type reveal = { - hashable: bytes; - message: unit -> operation list; + hashable : bytes; + message : unit -> operation list } type parameter = -| Commit of bytes + Commit of bytes | Reveal of reveal -(* We use hash-commit so that a baker can't steal *) -let commit ((p,s): bytes * storage) : operation list * storage = - let commit: commit = {date = Current.time + 86400; salted_hash = p;} in - let updated_map: commit_set = Big_map.update sender (Some commit) s.commits in - let s = {hashed = s.hashed; unused = s.unused; commits = updated_map} in - (([]: operation list), s) +type return = operation list * storage -let reveal ((p,s): reveal * storage) : operation list * storage = +(* We use hash-commit so that a baker can not steal *) + +let commit (p, s : bytes * storage) : return = + let commit : commit = + {date = Tezos.now + 86_400; salted_hash = p} in + let updated_map: commit_set = + Big_map.update Tezos.sender (Some commit) s.commits in + let s = {s with commits = updated_map} + in ([] : operation list), s + +let reveal (p, s : reveal * storage) : return = if not s.unused - then (failwith "This contract has already been used.": operation list * storage) - else - let commit: commit = - match (Big_map.find_opt sender s.commits) with - | Some c -> c - | None -> (failwith "You haven't made a commitment to hash against yet.": commit) - in - if Current.time < commit.date - then (failwith "It hasn't been 24 hours since your commit yet.": operation list * storage) - else - let salted = Crypto.sha256 (Bytes.concat p.hashable (Bytes.pack sender)) in - if (salted <> commit.salted_hash) - then (failwith "This reveal doesn't match your commitment.": operation list * storage) - else - if (s.hashed = Crypto.sha256 p.hashable) then - let s: storage = {hashed = s.hashed; unused = false; commits = s.commits} in - ((p.message ()), s) - else (failwith "Your commitment did not match the storage hash.": - operation list * storage) + (failwith "This contract has already been used." : return) + else + let commit : commit = + match Big_map.find_opt sender s.commits with + | Some c -> c + | None -> + (failwith "You have not made a commitment to hash against yet." + : commit) + in + if Tezos.now < commit.date + then + (failwith "It has not been 24 hours since your commit yet.": return) + else + let salted = + Crypto.sha256 (Bytes.concat p.hashable (Bytes.pack sender)) in + if salted <> commit.salted_hash + then + (failwith "This reveal does not match your commitment.": return) + else + if s.hashed = Crypto.sha256 p.hashable + then + let s : storage = {s with unused = false} + in p.message (), s + else (failwith "Your commitment did not match the storage hash." + : return) -let main ((p,s): parameter * storage) : operation list * storage = +let main (p, s : parameter * storage) : return = match p with - | Commit c -> commit (c, s) - | Reveal r -> reveal (r, s) + | Commit c -> commit (c,s) + | Reveal r -> reveal (r,s) diff --git a/src/test/contracts/high-order.mligo b/src/test/contracts/high-order.mligo index 4bba30eb3..41d50f67a 100644 --- a/src/test/contracts/high-order.mligo +++ b/src/test/contracts/high-order.mligo @@ -1,30 +1,24 @@ (* Test a function which takes another function as an argument *) + let foobar (i : int) : int = - let foo: (int -> int) = - fun (i : int) -> i - in - let bar: ((int -> int) -> int) = - fun (f : int -> int) -> f i - in - bar foo + let foo: (int -> int) = fun (i : int) -> i in + let bar: ((int -> int) -> int) = fun (f : int -> int) -> f i + in bar foo (* higher order function with more than one argument *) -let higher2 (i: int) (f: int -> int): int = + +let higher2 (i : int) (f : int -> int): int = let ii: int = f i in ii let foobar2 (i : int) : int = - let foo2: (int -> int) = - fun (i : int) -> i - in - higher2 i foo2 + let foo2 : (int -> int) = fun (i : int) -> i + in higher2 i foo2 let a : int = 0 let foobar3 (i : int) : int = - let foo2: (int -> int) = - fun (i : int) -> a + i - in - higher2 i foo2 + let foo2 : (int -> int) = fun (i : int) -> a + i + in higher2 i foo2 let f (i : int) : int = i @@ -32,15 +26,11 @@ let g (i : int) : int = f i let foobar4 (i : int) : int = g (g i) -let higher3 (i: int) (f: int -> int) (g: int -> int) : int = - let ii: int = f (g i) in ii +let higher3 (i : int) (f : int -> int) (g : int -> int) : int = + let ii : int = f (g i) in ii let foobar5 (i : int) : int = let a : int = 0 in - let foo: (int -> int) = - fun (i : int) -> a + i - in - let goo: (int -> int) = - fun (i : int) -> foo i - in - higher3 i foo goo + let foo : (int -> int) = fun (i : int) -> a + i in + let goo : (int -> int) = fun (i : int) -> foo i + in higher3 i foo goo diff --git a/src/test/contracts/high-order.religo b/src/test/contracts/high-order.religo index 9e8e5cd17..0ec28a689 100644 --- a/src/test/contracts/high-order.religo +++ b/src/test/contracts/high-order.religo @@ -1,48 +1,44 @@ /* Test a function which takes another function as an argument */ -let foobar = (i: int): int => { + +let foobar = (i : int): int => { let foo: int => int = (i: int) => i; - - let bar: ((int => int) => int) = (f: (int => int)) => f(i); - - bar(foo); + let bar: ((int => int) => int) = (f : (int => int)) => f (i); + bar (foo); }; /* higher order function with more than one argument */ -let higher2 = (i: int, f: (int => int)): int => { - let ii: int = f(i); + +let higher2 = (i : int, f : (int => int)) : int => { + let ii : int = f (i); ii; }; -let foobar2 = (i: int): int => { - let foo2: int => int = (i: int) => i; - - higher2(i, foo2); +let foobar2 = (i : int) : int => { + let foo2 : int => int = (i : int) => i; + higher2 (i, foo2); }; -let a: int = 0; +let a : int = 0; -let foobar3 = (i: int): int => { - let foo2: int => int = (i: int) => a + i; - - higher2(i, foo2); +let foobar3 = (i : int) : int => { + let foo2: int => int = (i : int) => a + i; + higher2 (i, foo2); }; -let f = (i: int): int => i; +let f = (i : int) : int => i; -let g = (i: int): int => f(i); +let g = (i : int) : int => f (i); -let foobar4 = (i: int): int => g(g(i)); +let foobar4 = (i : int) : int => g (g (i)); -let higher3 = (i: int, f: (int => int), g: (int => int)): int => { - let ii: int = f(g(i)); +let higher3 = (i : int, f : (int => int), g : (int => int)) : int => { + let ii : int = f (g (i)); ii; }; -let foobar5 = (i: int): int => { - let a: int = 0; - let foo: int => int = (i: int) => a + i; - - let goo: int => int = (i: int) => foo(i); - - higher3(i, foo, goo); +let foobar5 = (i : int) : int => { + let a : int = 0; + let foo : int => int = (i : int) => a + i; + let goo : int => int = (i : int) => foo (i); + higher3 (i, foo, goo); }; diff --git a/src/test/contracts/id.mligo b/src/test/contracts/id.mligo index fd7b7c424..e23f8d841 100644 --- a/src/test/contracts/id.mligo +++ b/src/test/contracts/id.mligo @@ -3,7 +3,7 @@ type id = int type id_details = { owner: address; controller: address; - profile: bytes; + profile: bytes } type buy = bytes * address option @@ -14,126 +14,118 @@ type action = | Buy of buy | Update_owner of update_owner | Update_details of update_details -| Skip of unit +| Skip + +(* The prices kept in storage can be changed by bakers, though they + should only be adjusted down over time, not up. *) -(* The prices kept in storage can be changed by bakers, though they should only be - adjusted down over time, not up. *) type storage = (id, id_details) big_map * int * (tez * tez) -(** Preliminary thoughts on ids: +type return = operation list * storage -I very much like the simplicity of http://gurno.com/adam/mne/. -5 three letter words means you have a 15 character identity, not actually more -annoying than an IP address and a lot more memorable than the raw digits. This -can be stored as a single integer which is then translated into the corresponding -series of 5 words. +(* Preliminary thoughts on ids: -I in general like the idea of having a 'skip' mechanism, but it does need to cost -something so people don't eat up the address space. 256 ^ 5 means you have a lot -of address space, but if people troll by skipping a lot that could be eaten up. -Should probably do some napkin calculations for how expensive skipping needs to -be to deter people from doing it just to chew up address space. -*) +I very much like the simplicity of http://gurno.com/adam/mne/. 5 three +letter words means you have a 15 character identity, not actually more +annoying than an IP address and a lot more memorable than the raw +digits. This can be stored as a single integer which is then +translated into the corresponding series of 5 words. + +I in general like the idea of having a 'skip' mechanism, but it does +need to cost something so people don't eat up the address space. 256^5 +means you have a lot of address space, but if people troll by skipping +a lot that could be eaten up. Should probably do some napkin +calculations for how expensive skipping needs to be to deter people +from doing it just to chew up address space. *) let buy (parameter, storage: (bytes * address option) * storage) = - let void: unit = - if amount = storage.2.0 - then () - else (failwith "Incorrect amount paid.": unit) - in + let void : unit = + if Tezos.amount <> storage.2.0 + then (failwith "Incorrect amount paid.": unit) in let profile, initial_controller = parameter in let identities, new_id, prices = storage in - let controller: address = + let controller : address = match initial_controller with | Some addr -> addr - | None -> sender - in + | None -> sender in let new_id_details: id_details = { - owner = sender ; - controller = controller ; - profile = profile ; - } - in - let updated_identities: (id, id_details) big_map = + owner = sender; + controller = controller; + profile = profile} in + let updated_identities : (id, id_details) big_map = Big_map.update new_id (Some new_id_details) identities - in - ([]: operation list), (updated_identities, new_id + 1, prices) + in ([]: operation list), (updated_identities, new_id + 1, prices) -let update_owner (parameter, storage: (id * address) * storage) = - if (amount <> 0mutez) - then (failwith "Updating owner doesn't cost anything.": (operation list) * storage) +let update_owner (parameter, storage : (id * address) * storage) = + if amount <> 0tez + then (failwith "Updating owner doesn't cost anything.": return) else - let id, new_owner = parameter in - let identities, last_id, prices = storage in - let current_id_details: id_details = - match Big_map.find_opt id identities with - | Some id_details -> id_details - | None -> (failwith "This ID does not exist.": id_details) - in - let is_allowed: bool = - if sender = current_id_details.owner - then true - else (failwith "You are not the owner of this ID.": bool) - in - let updated_id_details: id_details = { + let id, new_owner = parameter in + let identities, last_id, prices = storage in + let current_id_details : id_details = + match Big_map.find_opt id identities with + | Some id_details -> id_details + | None -> (failwith "This ID does not exist." : id_details) in + let is_allowed : bool = + if Tezos.sender = current_id_details.owner + then true + else (failwith "You are not the owner of this ID." : bool) in + let updated_id_details : id_details = { owner = new_owner; controller = current_id_details.controller; - profile = current_id_details.profile; - } - in - let updated_identities = Big_map.update id (Some updated_id_details) identities in - ([]: operation list), (updated_identities, last_id, prices) + profile = current_id_details.profile} in + let updated_identities = + Big_map.update id (Some updated_id_details) identities + in ([]: operation list), (updated_identities, last_id, prices) let update_details (parameter, storage: (id * bytes option * address option) * storage) = - if (amount <> 0mutez) - then (failwith "Updating details doesn't cost anything.": (operation list) * storage) + if Tezos.amount <> 0tez + then + (failwith "Updating details doesn't cost anything." : return) else - let id, new_profile, new_controller = parameter in - let identities, last_id, prices = storage in - let current_id_details: id_details = - match Big_map.find_opt id identities with - | Some id_details -> id_details - | None -> (failwith "This ID does not exist.": id_details) - in - let is_allowed: bool = - if (sender = current_id_details.controller) || (sender = current_id_details.owner) - then true - else (failwith ("You are not the owner or controller of this ID."): bool) - in - let owner: address = current_id_details.owner in - let profile: bytes = - match new_profile with - | None -> (* Default *) current_id_details.profile - | Some new_profile -> new_profile - in - let controller: address = - match new_controller with - | None -> (* Default *) current_id_details.controller - | Some new_controller -> new_controller - in - let updated_id_details: id_details = { - owner = owner; - controller = controller; - profile = profile; - } - in + let id, new_profile, new_controller = parameter in + let identities, last_id, prices = storage in + let current_id_details: id_details = + match Big_map.find_opt id identities with + | Some id_details -> id_details + | None -> (failwith "This ID does not exist.": id_details) in + let is_allowed : bool = + if Tezos.sender = current_id_details.controller + || Tezos.sender = current_id_details.owner + then true + else + (failwith ("You are not the owner or controller of this ID.") + : bool) in + let owner : address = current_id_details.owner in + let profile : bytes = + match new_profile with + | None -> (* Default *) current_id_details.profile + | Some new_profile -> new_profile in + let controller : address = + match new_controller with + | None -> (* Default *) current_id_details.controller + | Some new_controller -> new_controller in + let updated_id_details: id_details = { + owner = owner; + controller = controller; + profile = profile} in let updated_identities: (id, id_details) big_map = - Big_map.update id (Some updated_id_details) identities in - ([]: operation list), (updated_identities, last_id, prices) + Big_map.update id (Some updated_id_details) identities + in ([]: operation list), (updated_identities, last_id, prices) -(* Let someone skip the next identity so nobody has to take one that's undesirable *) -let skip (p,storage: unit * storage) = - let void: unit = - if amount = storage.2.1 - then () - else (failwith "Incorrect amount paid.": unit) - in +(* Let someone skip the next identity so nobody has to take one that's +undesirable *) + +let skip (p, storage: unit * storage) = + let void : unit = + if Tezos.amount <> storage.2.1 + then (failwith "Incorrect amount paid." : unit) in let identities, last_id, prices = storage in ([]: operation list), (identities, last_id + 1, prices) -let main (action, storage: action * storage) : operation list * storage = +let main (action, storage : action * storage) : return = match action with | Buy b -> buy (b, storage) | Update_owner uo -> update_owner (uo, storage) | Update_details ud -> update_details (ud, storage) - | Skip s -> skip ((), storage) + | Skip -> skip ((), storage) diff --git a/src/test/contracts/implicit.mligo b/src/test/contracts/implicit.mligo index 443ef8710..9b4ba9068 100644 --- a/src/test/contracts/implicit.mligo +++ b/src/test/contracts/implicit.mligo @@ -1,5 +1,5 @@ let main2 (p : key_hash) (s : unit) = - let c : unit contract = Current.implicit_account p in - (([] : operation list), unit) + let c : unit contract = Tezos.implicit_account p + in ([] : operation list), unit -let main (t: key_hash * unit) = main2 t.0 t.1 +let main (p,s : key_hash * unit) = main2 p s diff --git a/src/test/contracts/implicit_account.mligo b/src/test/contracts/implicit_account.mligo index bf3c89dcc..0b52bf0b8 100644 --- a/src/test/contracts/implicit_account.mligo +++ b/src/test/contracts/implicit_account.mligo @@ -1 +1 @@ -let main (kh: key_hash) : unit contract = Current.implicit_account kh +let main (kh : key_hash) : unit contract = Tezos.implicit_account kh diff --git a/src/test/contracts/implicit_account.religo b/src/test/contracts/implicit_account.religo index dba1656ec..1c22b5e0e 100644 --- a/src/test/contracts/implicit_account.religo +++ b/src/test/contracts/implicit_account.religo @@ -1 +1,2 @@ -let main = (kh: key_hash): contract(unit) => Current.implicit_account(kh); +let main = (kh : key_hash) : contract (unit) => + Tezos.implicit_account (kh); diff --git a/src/test/contracts/incr_decr.mligo b/src/test/contracts/incr_decr.mligo index bceb88af3..f7f3e3e83 100644 --- a/src/test/contracts/incr_decr.mligo +++ b/src/test/contracts/incr_decr.mligo @@ -1,19 +1,17 @@ type storage = int -(* variant defining pseudo multi-entrypoint actions *) - -type action = +type parameter = Increment of int | Decrement of int -let add (a: int) (b: int) : int = a + b -let sub (a: int) (b: int) : int = a - b +type return = operation list * storage -(* real entrypoint that re-routes the flow based on the action provided *) +let add (a : int) (b : int) : int = a + b +let sub (a : int) (b : int) : int = a - b -let main (p: action) storage = - let storage = - match p with +let main (action, store : parameter * storage) : return = + let store = + match action with Increment n -> add s n | Decrement n -> sub s n - in ([] : operation list), storage + in ([] : operation list), store diff --git a/src/test/contracts/interpret_test.mligo b/src/test/contracts/interpret_test.mligo index 90fe2bcbf..c06113589 100644 --- a/src/test/contracts/interpret_test.mligo +++ b/src/test/contracts/interpret_test.mligo @@ -1,87 +1,87 @@ let lambda_call = let a = 3 in - let foo = fun (i : int) -> i * i in - foo (a + 1) + let foo = fun (i : int) -> i * i + in foo (a + 1) let higher_order1 = let a = 2 in - let foo = fun (i:int) (j:int) (k:int) -> - a + i + j + 0 in - let bar = (foo 1 2) in - bar 3 + let foo = fun (i : int) (j : int) (k : int) -> a + i + j + 0 in + let bar = (foo 1 2) + in bar 3 let higher_order2 = let a = 2 in - let foo = fun (i:int) -> - let b = 2 in - let bar = fun (i:int) -> i + a + b - in bar i + let foo = fun (i : int) -> + let b = 2 in + let bar = fun (i : int) -> i + a + b + in bar i in foo 1 let higher_order3 = - let foo = fun (i:int) -> i + 1 in - let bar = fun (f:int->int) (i:int) -> (f i) + 1 in - let baz : (int -> int ) = bar foo in - baz 3 + let foo = fun (i : int) -> i + 1 in + let bar = fun (f : int -> int) (i : int) -> f i + 1 in + let baz : int -> int = bar foo + in baz 3 let higher_order4 = let a = 3 in let foo = fun (i : int) -> a + i in - let bar: (int -> int) = fun (i : int) -> foo i in - bar 2 - -let concats = - 0x70 ^ 0x70 + let bar : int -> int = fun (i : int) -> foo i + in bar 2 + +let concats = 0x70 ^ 0x70 type foo_record = { - a : string ; - b : string ; + a : string; + b : string } + let record_concat = - let ab : foo_record = { a = "a" ; b = "b" } in - ab.a ^ ab.b + let ab : foo_record = {a="a"; b="b"} + in ab.a ^ ab.b let record_patch = - let ab : foo_record = { a = "a" ; b = "b" } in - {ab with b = "c"} + let ab : foo_record = {a="a"; b="b"} + in {ab with b = "c"} type bar_record = { - f : int -> int ; - arg : int ; + f : int -> int; + arg : int } + let record_lambda = let a = 1 in - let foo : (int -> int) = fun (i:int) -> a+(i*2) in - let farg : bar_record = { f = foo ; arg = 2 } in - farg.f farg.arg + let foo : int -> int = fun (i : int) -> a + i*2 in + let farg : bar_record = {f = foo; arg = 2} + in farg.f farg.arg type foo_variant = | Foo | Bar of int | Baz of string -let variant_exp = - (Foo, Bar 1, Baz "b") +let variant_exp = Foo, Bar 1, Baz "b" let variant_match = let a = Bar 1 in match a with - | Foo -> 1 - | Bar(i) -> 2 - | Baz(s) -> 3 + | Foo -> 1 + | Bar i -> 2 + | Baz s -> 3 -/* UNSUPPORTED +(* UNSUPPORTED: No deep patterns yet. type bar_variant = | Baz | Buz of int * int | Biz of int * int * string + let long_variant_match = let a = Biz (1,2,"Biz") in match a with | Baz -> "Baz" - | Buz(a,b) -> "Buz" - | Biz(a,b,c) -> c -*/ + | Buz (a,b) -> "Buz" + | Biz (a,b,c) -> c + *) let bool_match = let b = true in @@ -90,149 +90,145 @@ let bool_match = | false -> 2 let list_match = - let a = [ 1 ; 2 ; 3 ; 4 ] in + let a = [1; 2; 3; 4] in match a with - | hd :: tl -> hd::a + | hd::tl -> hd::a | [] -> a let tuple_proj = - let (a,b) = (true,false) in - a or b + let a, b = true, false + in a or b let list_const = - let a = [1 ; 2 ; 3 ; 4] in - 0 :: a + let a = [1; 2; 3; 4] + in 0::a type foobar = int option let options_match_some = let a = Some 0 in match a with - | Some(i) -> i + | Some i -> i | None -> 1 let options_match_none = let a : foobar = None in match a with - | Some(i) -> i + | Some i -> i | None -> 0 let is_nat_nat = let i : int = 1 in - let j : int = -1 in - (Michelson.is_nat i, Michelson.is_nat j) + let j : int = -1 + in is_nat i, is_nat j let abs_int = abs (-5) -let nat_int = int (5n) +let nat_int = int 5n let map_list = - let a = [1 ; 2 ; 3 ; 4] in - let add_one: (int -> int) = fun (i : int) -> i + 1 in - List.map add_one a + let a = [1; 2; 3; 4] in + let add_one : (int -> int) = fun (i : int) -> i + 1 + in List.map add_one a let fail_alone = failwith "you failed" let iter_list_fail = - let a = [1 ; 2 ; 3 ; 4] in - let check_something: (int -> unit) = fun (i : int) -> - if i = 2 then failwith "you failed" - else () - in - List.iter check_something a + let a = [1; 2; 3; 4] in + let check_something : int -> unit = + fun (i : int) -> + if i = 2 then failwith "you failed" + in List.iter check_something a let fold_list = - let a = [1 ; 2 ; 3 ; 4] in - let acc : (int * int -> int) = - fun (prev, el : int * int) -> prev + el in - List.fold acc a 0 + let a = [1; 2; 3; 4] in + let acc : int * int -> int = + fun (prev, el : int * int) -> prev + el + in List.fold acc a 0 -let comparison_int = - (1 > 2, 2 > 1, 1 >=2 , 2 >= 1) +let comparison_int = 1 > 2, 2 > 1, 1 >=2, 2 >= 1 -let comparison_string = - ("foo" = "bar", "baz" = "baz") +let comparison_string = "foo"="bar", "baz"="baz" -let divs : (int * nat * tez * nat) = - (1/2 , 1n/2n , 1tz/2n , 1tz/2tz) +let divs : int * nat * tez * nat = 1/2, 1n/2n, 1tez/2n, 1tez/2tez let var_neg = - let a = 2 in - -a + let a = 2 in -a let sizes = - let a = [ 1 ; 2 ; 3 ; 4 ; 5 ] in + let a = [1; 2; 3; 4; 5] in let b = "12345" in - let c = Set.literal [ 1 ; 2 ; 3 ; 4 ; 5 ] in - let d = Map.literal [ (1,1) ; (2,2) ; (3,3) ] in + let c = Set.literal [1; 2; 3; 4; 5] in + let d = Map.literal [(1,1); (2,2); (3,3)] in let e = 0xFFFF in - (List.size a, String.size b, Set.size c, Map.size d, Bytes.size e) + List.length a, + String.length b, + Set.cardinal c, + Map.size d, + Bytes.length e let modi = 3 mod 2 let fold_while = - let aux : int -> bool * int = fun (i:int) -> - if i < 10 then continue (i + 1) else stop i in - (Loop.fold_while aux 20, Loop.fold_while aux 0) + let aux : int -> bool * int = + fun (i : int) -> + if i < 10 then Loop.resume (i + 1) else Loop.stop i + in (Loop.fold_while aux 20, Loop.fold_while aux 0) -let assertion_pass = - assert (1=1) +let assertion_pass = assert (1=1) -let assertion_fail = - assert (1=2) +let assertion_fail = assert (1=2) let lit_address = ("KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq" : address) let map_finds = - let m = Map.literal [ ("one" , 1) ; ("two" , 2) ; ("three" , 3) ] in - Map.find_opt "two" m + let m = Map.literal [("one", 1); ("two", 2); ("three", 3)] + in Map.find_opt "two" m let map_finds_fail = - let m = Map.literal [ ("one" , 1) ; ("two" , 2) ; ("three" , 3) ] in - Map.find "four" m + let m = Map.literal [("one", 1); ("two", 2); ("three", 3)] + in Map.find "four" m let map_empty = - ((Map.empty : (int,int) map) , (Map.literal [] : (int,int) map)) + ((Map.empty : (int, int) map), (Map.literal [] : (int, int) map)) -let m = Map.literal [ ("one" , 1) ; ("two" , 2) ; ("three" , 3) ] +let m = Map.literal [("one", 1); ("two", 2); ("three", 3)] let map_fold = - let aux = fun (i: int * (string * int)) -> i.0 + i.1.1 in - Map.fold aux m (-2) + let aux = fun (i : int * (string * int)) -> i.0 + i.1.1 + in Map.fold aux m (-2) let map_iter = - let aux = fun (i: string * int) -> if (i.1=12) then failwith "never" else () in - Map.iter aux m + let aux = + fun (i : string * int) -> if i.1 = 12 then failwith "never" + in Map.iter aux m let map_map = - let aux = fun (i: string * int) -> i.1 + (String.size i.0) in - Map.map aux m + let aux = fun (i : string * int) -> i.1 + String.length i.0 + in Map.map aux m -let map_mem = (Map.mem "one" m , Map.mem "four" m) +let map_mem = Map.mem "one" m, Map.mem "four" m -let map_remove = (Map.remove "one" m, Map.remove "four" m) +let map_remove = Map.remove "one" m, Map.remove "four" m -let map_update = ( - Map.update "one" (Some(1)) (Map.literal [ "one", 2 ]), - Map.update "one" (None : int option) (Map.literal [ "one", 1]), - Map.update "one" (None : int option) (Map.literal []:(string,int) map), - Map.update "one" (Some(1)) (Map.literal []:(string,int) map) -) +let map_update = + Map.update "one" (Some 1) (Map.literal ["one", 2]), + Map.update "one" (None : int option) (Map.literal ["one", 1]), + Map.update "one" (None : int option) (Map.empty : (string, int) map), + Map.update "one" (Some 1) (Map.literal [] : (string, int) map) -let s = Set.literal [ 1 ; 2 ; 3 ] +let s = Set.literal [1; 2; 3] -let set_add = ( +let set_add = Set.add 1 s, Set.add 4 s, - Set.add 1 (Set.literal [] : int set) -) + Set.add 1 (Set.empty : int set) let set_iter_fail = - let aux = fun (i:int) -> if i = 1 then failwith "set_iter_fail" else () in - Set.iter aux (Set.literal [1 ; 2 ; 3]) + let aux = fun (i : int) -> if i = 1 then failwith "set_iter_fail" + in Set.iter aux (Set.literal [1; 2; 3]) -let set_mem = ( +let set_mem = Set.mem 1 s, Set.mem 4 s, - Set.mem 1 (Set.literal [] : int set) -) + Set.mem 1 (Set.empty : int set) diff --git a/src/test/contracts/isnat.mligo b/src/test/contracts/isnat.mligo index c5bea0294..7440ea85e 100644 --- a/src/test/contracts/isnat.mligo +++ b/src/test/contracts/isnat.mligo @@ -1 +1 @@ -let main (i: int) : nat option = Michelson.is_nat i +let main (i : int) : nat option = is_nat i diff --git a/src/test/contracts/isnat.religo b/src/test/contracts/isnat.religo index b6b5921b7..be81913c0 100644 --- a/src/test/contracts/isnat.religo +++ b/src/test/contracts/isnat.religo @@ -1 +1 @@ -let main = (i: int): option(nat) => Michelson.is_nat(i); +let main = (i : int): option (nat) => is_nat (i); diff --git a/src/test/contracts/key_hash.mligo b/src/test/contracts/key_hash.mligo index 0eba14d9b..d42dcc8f1 100644 --- a/src/test/contracts/key_hash.mligo +++ b/src/test/contracts/key_hash.mligo @@ -1,5 +1,3 @@ -let check_hash_key (kh1, k2: key_hash * key) : bool * key_hash = - let kh2 : key_hash = Crypto.hash_key k2 in - if kh1 = kh2 - then (true, kh2) - else (false, kh2) +let check_hash_key (kh1, k2 : key_hash * key) : bool * key_hash = + let kh2 : key_hash = Crypto.hash_key k2 + in kh1 = kh2, kh2 diff --git a/src/test/contracts/key_hash.religo b/src/test/contracts/key_hash.religo index f3b8e8976..e434cfb50 100644 --- a/src/test/contracts/key_hash.religo +++ b/src/test/contracts/key_hash.religo @@ -1,10 +1,5 @@ -let check_hash_key = (kh1_k2: (key_hash, key)) : (bool, key_hash) => { +let check_hash_key = (kh1_k2 : (key_hash, key)) : (bool, key_hash) => { let kh1, k2 = kh1_k2; - let kh2 : key_hash = Crypto.hash_key(k2); - if (kh1 == kh2) { - (true, kh2); - } - else { - (false, kh2); - } + let kh2 : key_hash = Crypto.hash_key (k2); + ((kh1 == kh2), kh2) }; diff --git a/src/test/contracts/lambda.mligo b/src/test/contracts/lambda.mligo index fc32e0334..f7d21eeb1 100644 --- a/src/test/contracts/lambda.mligo +++ b/src/test/contracts/lambda.mligo @@ -1,8 +1,7 @@ type storage = unit (* not supported yet -let main (p:unit) storage = - (fun x -> ()) () +let main (p, s : unit * storage) = (fun x -> ()) () *) -let main (ps: unit * storage) = (fun (_: unit) -> ()) () +let main (p, s : unit * storage) = (fun (_ : unit) -> ()) () diff --git a/src/test/contracts/lambda.religo b/src/test/contracts/lambda.religo index 19d885228..8160a5d36 100644 --- a/src/test/contracts/lambda.religo +++ b/src/test/contracts/lambda.religo @@ -5,6 +5,4 @@ type storage = unit; (fun x -> ()) () */ -let main2 = ((p: unit), storage) => (((xxx: unit)) => ())(); - -let main = (x: (unit, storage)) => main2(x[0], x[1]); +let main = ((p,s) : (unit, storage)) => (((useless : unit)) => ()) (); diff --git a/src/test/contracts/lambda2.mligo b/src/test/contracts/lambda2.mligo index 840761bb2..6608f87e8 100644 --- a/src/test/contracts/lambda2.mligo +++ b/src/test/contracts/lambda2.mligo @@ -1,8 +1,8 @@ type storage = unit (* Not supported yet: -let main (p:unit) storage = (fun x -> ()) () +let main (a, s : unit * storage) = (fun x -> ()) () *) -let main (_: unit * storage) = - (fun (f: unit -> unit) -> f ()) (fun (_: unit) -> unit) +let main (a, s : unit * storage) = + (fun (f : unit -> unit) -> f ()) (fun (_ : unit) -> unit) diff --git a/src/test/contracts/lambda2.religo b/src/test/contracts/lambda2.religo index fd6a6bd27..8459101ee 100644 --- a/src/test/contracts/lambda2.religo +++ b/src/test/contracts/lambda2.religo @@ -4,7 +4,5 @@ type storage = unit; let main (p:unit) storage = (fun x -> ()) () */ -let main2 = (z: unit, storage) => - ((f: (unit => unit)) => f())((z: unit) => unit); - -let main = (x: (unit, storage)) => main2(x[0],x[1]); +let main = ((a, s) : (unit, storage)) : (operation (list), storage) => + ((f : (unit => unit)) => f ()) ((useless : unit) => unit); diff --git a/src/test/contracts/let_in_multi_bind.mligo b/src/test/contracts/let_in_multi_bind.mligo index e61dc14a7..e77d52990 100644 --- a/src/test/contracts/let_in_multi_bind.mligo +++ b/src/test/contracts/let_in_multi_bind.mligo @@ -1,5 +1,5 @@ -let sum (p: int * int) : int = +let sum (p : int * int) : int = let i, result = p in i + result -let sum2 (p: string * string * string * string) : int = +let sum2 (p : string * string * string * string) : int = let a, b, c, d = p in a ^ b ^ c ^ d diff --git a/src/test/contracts/let_multiple.mligo b/src/test/contracts/let_multiple.mligo index 08cb6dc3c..1ef5fbfa3 100644 --- a/src/test/contracts/let_multiple.mligo +++ b/src/test/contracts/let_multiple.mligo @@ -1,38 +1,36 @@ (* Simple test of binding multiple values *) -let (x: int), (y: int) = 1,2 +let (x : int), (y : int) = 1,2 -let main (p: unit) : int = x + y +let main (p : unit) : int = x + y -let ((x : int) , (y :int)) = 3,3 +let ((x : int) , (y : int)) = 3,3 -let main_paren (p: unit) : int = x + y +let main_paren (p : unit) : int = x + y let foobar : (int * int) = (23 , 42) let (foo : int) , (bar : int) = foobar (* Here to prevent a regression of https://gitlab.com/ligolang/ligo/issues/63#note_254106580 *) -let correct_values_bound (p: unit) : int * int = - foo, bar +let correct_values_bound (p : unit) : int * int = foo, bar -let non_tuple_rhs (p: unit) : int = - bar - foo +let non_tuple_rhs (p : unit) : int = bar - foo (* Here to prevent a regression of https://gitlab.com/ligolang/ligo/issues/63#note_254106580 *) -let big_tuple : (int * int * int * int * int) = (10, 20, 30, 40, 50) +let big_tuple : int * int * int * int * int = 10, 20, 30, 40, 50 let (a: int), (b: int), (c: int), (d: int), (e: int) = big_tuple -let correct_values_big_tuple (p: unit) : int * int * int * int * int = +let correct_values_big_tuple (p : unit) : int * int * int * int * int = a, b, c, d, e (* Here to prevent a regression of https://gitlab.com/ligolang/ligo/issues/63#note_254106580 *) -let different_types: (int * string) = 10, "hello" +let different_types : int * string = 10, "hello" -let (greet_num: int), (greeting: string) = different_types +let (greet_num : int), (greeting : string) = different_types -let correct_values_different_types (p: unit) : int * string = +let correct_values_different_types (p : unit) : int * string = greet_num, greeting diff --git a/src/test/contracts/let_multiple.religo b/src/test/contracts/let_multiple.religo index 0e5934027..b55df0d1d 100644 --- a/src/test/contracts/let_multiple.religo +++ b/src/test/contracts/let_multiple.religo @@ -1,14 +1,15 @@ /* Simple test of binding multiple values */ -let ((x: int), (y: int)) = (1, 2); +let ((x : int), (y : int)) = (1,2); -let main = (p: unit): int => x + y; +let main = (p : unit): int => x + y; -let ((x: int), (y: int)) = (3, 3); +let ((x : int), (y : int)) = (3,3); -let main_paren = (p: unit): int => x + y; +let main_paren = (p : unit): int => x + y; -let foobar: (int, int) = (23, 42); -let ((foo: int), (bar: int)) = foobar; +let foobar : (int, int) = (23, 42); -let non_tuple_rhs = (p: unit): int => foo + bar; +let ((foo : int), (bar : int)) = foobar; + +let non_tuple_rhs = (p : unit) : int => foo + bar; diff --git a/src/test/contracts/letin.mligo b/src/test/contracts/letin.mligo index 37b89aa3f..8ee8912c7 100644 --- a/src/test/contracts/letin.mligo +++ b/src/test/contracts/letin.mligo @@ -1,6 +1,6 @@ type storage = int * int -let main (n: int * storage) = +let main (n : int * storage) : operation list * storage = let x : int * int = let x : int = 7 in x + n.0, n.1.0 + n.1.1 diff --git a/src/test/contracts/letin.religo b/src/test/contracts/letin.religo index b370c0a59..8956133e3 100644 --- a/src/test/contracts/letin.religo +++ b/src/test/contracts/letin.religo @@ -1,11 +1,9 @@ type storage = (int, int); -let main2 = ((n : int), storage) => { - let x: (int, int) = { - let x: int = 7; - (x + n, storage[0] + storage[1]); +let main = (n : (int, storage)) : (list (operation), storage) => { + let x : (int, int) = { + let x : int = 7; + (x + n[0], n[1][0] + n[1][1]); }; - ([]: list(operation), x); + ([]: list (operation), x); }; - -let main = (x: (int, storage)) => main2(x[0],x[1]); diff --git a/src/test/contracts/list.mligo b/src/test/contracts/list.mligo index 06a914514..26383f27b 100644 --- a/src/test/contracts/list.mligo +++ b/src/test/contracts/list.mligo @@ -1,27 +1,29 @@ type storage = int * int list -type param = int list +type parameter = int list + +type return = operation list * storage let x : int list = [] let y : int list = [3; 4; 5] let z : int list = 2::y -let main (p, s: param * storage) = +let main (p, s: parameter * storage) : return = let storage = match p with [] -> s | hd::tl -> s.0 + hd, tl in ([] : operation list), storage -let size_ (s: int list) : nat = List.size s +let size_ (s : int list) : nat = List.length s -let fold_op (s: int list) : int = - let aggregate = fun (t: int * int) -> t.0 + t.1 +let fold_op (s : int list) : int = + let aggregate = fun (t : int * int) -> t.0 + t.1 in List.fold aggregate s 10 -let map_op (s: int list) : int list = - List.map (fun (cur: int) -> cur + 1) s +let map_op (s : int list) : int list = + List.map (fun (cur : int) -> cur + 1) s let iter_op (s : int list) : unit = - let do_nothing = fun (_: int) -> unit + let do_nothing = fun (_ : int) -> unit in List.iter do_nothing s diff --git a/src/test/contracts/list.religo b/src/test/contracts/list.religo index 9f9a2ec1c..013188d7b 100644 --- a/src/test/contracts/list.religo +++ b/src/test/contracts/list.religo @@ -1,33 +1,33 @@ -type storage = (int, list(int)); +type storage = (int, list (int)); -type param = list(int); +type parameter = list (int); -let x: list(int) = []; -let y: list(int) = [3, 4, 5]; -let z: list(int) = [2, ...y]; +type return = (list (operation), storage); -let main2 = (p: param, storage) => { +let x : list (int) = []; +let y : list (int) = [3, 4, 5]; +let z : list (int) = [2, ...y]; + +let main = ((p,s) : (parameter, storage)) : return => { let storage = switch (p) { - | [] => storage - | [hd, ...tl] => (storage[0] + hd, tl) + | [] => s + | [hd, ...tl] => (s[0] + hd, tl) }; ([]: list(operation), storage); }; -let main = (x: (param, storage)) => main2(x[0],x[1]); +let size_ = (s : list (int)) : nat => List.length (s); -let size_ = (s: list(int)): nat => List.size(s); - -let fold_op = (s: list(int)): int => { - let aggregate = (prec_cur: (int, int)) => prec_cur[0] + prec_cur[1]; - List.fold(aggregate, s, 10); +let fold_op = (s : list (int)) : int => { + let aggregate = (t: (int, int)) => t[0] + t[1]; + List.fold (aggregate, s, 10); }; -let map_op = (s: list(int)): list(int) => - List.map((cur: int) => cur + 1, s); +let map_op = (s : list (int)) : list (int) => + List.map ((cur : int) => cur + 1, s); -let iter_op = (s: list(int)): unit => { - let do_nothing = (z: int) => unit; - List.iter(do_nothing, s); +let iter_op = (s : list (int)) : unit => { + let do_nothing = (useless : int) => unit; + List.iter (do_nothing, s); }; diff --git a/src/test/contracts/loop.mligo b/src/test/contracts/loop.mligo index 215aa6c41..82da7268e 100644 --- a/src/test/contracts/loop.mligo +++ b/src/test/contracts/loop.mligo @@ -1,33 +1,37 @@ -(* Test loops in CameLIGO *) +(* Test functional iterators in CameLIGO *) -let aux_simple (i: int) : bool * int = - if i < 100 then continue (i + 1) else stop i +let aux_simple (i : int) : bool * int = + if i < 100 then Loop.resume (i + 1) else Loop.stop i -let counter_simple (n: int) : int = +let counter_simple (n : int) : int = Loop.fold_while aux_simple n type sum_aggregator = { - counter : int ; - sum : int ; + counter : int; + sum : int } let counter (n : int) : int = - let initial : sum_aggregator = { counter = 0 ; sum = 0 } in - let out : sum_aggregator = Loop.fold_while (fun (prev: sum_aggregator) -> + let initial : sum_aggregator = {counter=0; sum=0} in + let aggregate = fun (prev : sum_aggregator) -> if prev.counter <= n then - continue ({ counter = prev.counter + 1 ; sum = prev.counter + prev.sum }) + Loop.resume {counter = prev.counter + 1; + sum = prev.counter + prev.sum} else - stop ({ counter = prev.counter ; sum = prev.sum }) ) - initial in out.sum + Loop.stop {counter = prev.counter; sum = prev.sum} in + let out : sum_aggregator = + Loop.fold_while aggregate initial + in out.sum -let aux_nest (prev: sum_aggregator) : bool * sum_aggregator = +let aux_nest (prev : sum_aggregator) : bool * sum_aggregator = if prev.counter < 100 then - continue ({ counter = prev.counter + 1 ; - sum = prev.sum + Loop.fold_while aux_simple prev.counter}) + let sum : int = + prev.sum + Loop.fold_while aux_simple prev.counter + in Loop.resume {counter = prev.counter + 1; sum = sum} else - stop ({ counter = prev.counter ; sum = prev.sum }) + Loop.stop {counter = prev.counter; sum = prev.sum} -let counter_nest (n: int) : int = - let initial : sum_aggregator = { counter = 0 ; sum = 0 } in +let counter_nest (n : int) : int = + let initial : sum_aggregator = {counter=0; sum=0} in let out : sum_aggregator = Loop.fold_while aux_nest initial in out.sum diff --git a/src/test/contracts/loop.religo b/src/test/contracts/loop.religo index 60bba7d17..a1d8b6e44 100644 --- a/src/test/contracts/loop.religo +++ b/src/test/contracts/loop.religo @@ -1,46 +1,41 @@ /* Test loops in ReasonLIGO */ -let aux_simple = (i: int): (bool, int) => - if (i < 100) { - continue(i + 1); - } else { - stop(i); - }; +let aux_simple = (i : int) : (bool, int) => + if (i < 100) { Loop.resume (i + 1); } else { Loop.stop (i); }; -let counter_simple = (n: int): int => Loop.fold_while(aux_simple, n); +let counter_simple = (n : int) : int => Loop.fold_while (aux_simple, n); type sum_aggregator = { - counter: int, - sum: int, + counter : int, + sum : int, }; -let counter = (n: int): int => { - let initial: sum_aggregator = {counter: 0, sum: 0}; - let out: sum_aggregator = - Loop.fold_while( - (prev: sum_aggregator) => - if (prev.counter <= n) { - continue({counter: prev.counter + 1, sum: prev.counter + prev.sum}); - } else { - stop({counter: prev.counter, sum: prev.sum}); - }, - initial - ); +let counter = (n : int) : int => { + let initial : sum_aggregator = {counter: 0, sum: 0}; + let aggregate = (prev : sum_aggregator) => + if (prev.counter <= n) { + Loop.resume ({counter : prev.counter + 1, + sum : prev.counter + prev.sum}); + } else { + Loop.stop ({counter: prev.counter, sum: prev.sum}); + }; + let out : sum_aggregator = + Loop.fold_while (aggregate, initial); out.sum; }; -let aux_nest = (prev: sum_aggregator): (bool, sum_aggregator) => +let aux_nest = (prev : sum_aggregator) : (bool, sum_aggregator) => if (prev.counter < 100) { - continue({ - counter: prev.counter + 1, - sum: prev.sum + Loop.fold_while(aux_simple, prev.counter), - }); + let sum : int = + prev.sum + Loop.fold_while (aux_simple, prev.counter); + Loop.resume ({counter: prev.counter + 1, + sum: sum}); } else { - stop({counter: prev.counter, sum: prev.sum}); + Loop.stop ({counter: prev.counter, sum: prev.sum}); }; -let counter_nest = (n: int): int => { - let initial: sum_aggregator = {counter: 0, sum: 0}; - let out: sum_aggregator = Loop.fold_while(aux_nest, initial); +let counter_nest = (n : int) : int => { + let initial : sum_aggregator = {counter: 0, sum: 0}; + let out : sum_aggregator = Loop.fold_while (aux_nest, initial); out.sum; }; diff --git a/src/test/contracts/map.mligo b/src/test/contracts/map.mligo index 7b13f406c..54772bf5b 100644 --- a/src/test/contracts/map.mligo +++ b/src/test/contracts/map.mligo @@ -7,47 +7,48 @@ let map1 : foobar = let map2 : foobar = Map.literal [(23,0); (42,0)] -let set_2 (n: int) (m: foobar) : foobar = Map.update 23 (Some n) m +let set_2 (n : int) (m : foobar) : foobar = Map.update 23 (Some n) m -let set_ (t: int * foobar) : foobar = set_2 t.0 t.1 +let set_ (t : int * foobar) : foobar = set_2 t.0 t.1 -let add (n,m: int * foobar) : foobar = Map.add 23 n m +let add (n,m : int * foobar) : foobar = Map.add 23 n m -let rm (m: foobar) : foobar = Map.remove 42 m +let rm (m : foobar) : foobar = Map.remove 42 m (* Dummy test so that we can add the same test for PascaLIGO *) -let patch_ (m: foobar) : foobar = Map.literal [(0,5); (1,6); (2,7)] + +let patch_ (m : foobar) : foobar = Map.literal [(0,5); (1,6); (2,7)] (* Second dummy test, see above *) -let patch_empty (m: foobar) : foobar = Map.literal [(0,0); (1,1); (2,2)] + +let patch_empty (m : foobar) : foobar = Map.literal [(0,0); (1,1); (2,2)] (* Third dummy test, see above *) -let patch_deep (m: foobar * nat) : foobar * nat = + +let patch_deep (m : foobar * nat) : foobar * nat = Map.literal [(0,0); (1,9); (2,2)], 10n -let size_ (m: foobar) : nat = Map.size m +let size_ (m : foobar) : nat = Map.size m -let gf (m: foobar) : int = Map.find 23 m +let get (m : foobar) : int option = Map.find_opt 42 m +let get_ (m : foobar) : int option = Map.find_opt 42 m -let get (m: foobar) : int option = Map.find_opt 42 m -let get_ (m: foobar) : int option = Map.find_opt 42 m - -let mem (k,m: int * foobar) : bool = Map.mem k m +let mem (k,m : int * foobar) : bool = Map.mem k m let iter_op (m : foobar) : unit = - let assert_eq = fun (i: int * int) -> assert (i.0 = i.1) + let assert_eq = fun (a, b : int * int) -> assert (a = b) in Map.iter assert_eq m let map_op (m : foobar) : foobar = - let increment = fun (i: int * int) -> i.1 + 1 + let increment = fun (i : int * int) -> i.1 + 1 in Map.map increment m let fold_op (m : foobar) : foobar = - let aggregate = fun (i: int * (int * int)) -> i.0 + i.1.0 + i.1.1 + let aggregate = fun (i : int * (int * int)) -> i.0 + i.1.0 + i.1.1 in Map.fold aggregate m 10 let deep_op (m: foobar) : foobar = - let coco = 0,m in + let coco = 0, m in let coco = 0, Map.remove 42 coco.1 in let coco = 0, Map.update 32 (Some 16) coco.1 in coco.1 diff --git a/src/test/contracts/map.religo b/src/test/contracts/map.religo index 74ec39dcf..a88ea1ad7 100644 --- a/src/test/contracts/map.religo +++ b/src/test/contracts/map.religo @@ -1,59 +1,60 @@ - -type foobar = map(int, int); +type foobar = map (int, int); let empty_map: foobar = Map.empty; -let map1: foobar = - Map.literal([(144, 23), (51, 23), (42, 23), (120, 23), (421, 23)]); +let map1 : foobar = + Map.literal ([(144, 23), (51, 23), (42, 23), (120, 23), (421, 23)]); -let map2: foobar = Map.literal([(23, 0), (42, 0)]); +let map2 : foobar = Map.literal ([(23, 0), (42, 0)]); -let set_ = (n: int, m: foobar): foobar => Map.update(23, Some(n), m); +let set_ = (n: int, m: foobar) : foobar => Map.update (23, Some (n), m); -let add = (n: int, m: foobar) : foobar => Map.add(23, n, m); +let add = (n: int, m: foobar) : foobar => Map.add (23, n, m); -let rm = (m: foobar): foobar => Map.remove(42, m); +let rm = (m: foobar) : foobar => Map.remove (42, m); /* Dummy test so that we can add the same test for PascaLIGO */ -let patch_ = (m: foobar): foobar => Map.literal([(0, 5), (1, 6), (2, 7)]); + +let patch_ = (m : foobar) : foobar => + Map.literal ([(0, 5), (1, 6), (2, 7)]); /* Second dummy test, see above */ -let patch_empty = (m: foobar): foobar => - Map.literal([(0, 0), (1, 1), (2, 2)]); + +let patch_empty = (m : foobar) : foobar => + Map.literal ([(0, 0), (1, 1), (2, 2)]); /* Third dummy test, see above */ -let patch_deep = (m: (foobar, nat)): (foobar, nat) => ( + +let patch_deep = (m : (foobar, nat)) : (foobar, nat) => ( Map.literal([(0, 0), (1, 9), (2, 2)]), 10n ); -let size_ = (m: foobar): nat => Map.size(m); +let size_ = (m : foobar) : nat => Map.size (m); -let gf = (m: foobar): int => Map.find(23, m); - -let get = (m: foobar): option(int) => Map.find_opt(42, m); +let get = (m: foobar): option(int) => Map.find_opt (42, m); let get_ = (m: foobar): option(int) => Map.find_opt(42, m); -let mem = (km: (int, foobar)): bool => Map.mem(km[0], km[1]); +let mem = (km: (int, foobar)): bool => Map.mem (km[0], km[1]); let iter_op = (m: foobar): unit => { - let assert_eq = (i: int, j: int) => assert(i == j); - Map.iter(assert_eq, m); + let assert_eq = (i: int, j: int) => assert (i == j); + Map.iter (assert_eq, m); }; -let map_op = (m: foobar): foobar => { +let map_op = (m: foobar) : foobar => { let increment = (z: int, j: int) => j + 1; - Map.map(increment, m); + Map.map (increment, m); }; let fold_op = (m: foobar): foobar => { let aggregate = (i: int, j: (int, int)) => i + j[0] + j[1]; - Map.fold(aggregate, m, 10); + Map.fold (aggregate, m, 10); }; -let deep_op = (m: foobar): foobar => { +let deep_op = (m: foobar) : foobar => { let coco = (0, m); - let coco = (0, Map.remove(42, coco[1])); - let coco = (0, Map.update(32, Some(16), coco[1])); + let coco = (0, Map.remove (42, coco[1])); + let coco = (0, Map.update (32, Some (16), coco[1])); coco[1]; }; diff --git a/src/test/contracts/match.mligo b/src/test/contracts/match.mligo index 36d3f4b9b..d3e9d8d52 100644 --- a/src/test/contracts/match.mligo +++ b/src/test/contracts/match.mligo @@ -1,28 +1,30 @@ type storage = int -type param = +type parameter = Add of int | Sub of int -let main (p, s: param * storage) = - let storage = - s + - (match p with - Add n -> n - | Sub n -> 0-n) - in ([] : operation list), storage +type return = operation list * storage -let match_bool (b: bool) : int = +let main (action, store : parameter * storage) = + let store = + store + + (match action with + Add n -> n + | Sub n -> -n) + in ([] : operation list), store + +let match_bool (b : bool) : int = match b with true -> 10 | false -> 0 -let match_list (l: int list) : int = +let match_list (l : int list) : int = match l with - hd :: tl -> hd + hd::tl -> hd | [] -> 10 -let match_option (i: int option) : int = +let match_option (i : int option) : int = match i with Some n -> n | None -> 0 diff --git a/src/test/contracts/match.religo b/src/test/contracts/match.religo index 3f77b252d..6aaf3f0a4 100644 --- a/src/test/contracts/match.religo +++ b/src/test/contracts/match.religo @@ -1,19 +1,18 @@ type storage = int; -type param = - | Add(int) - | Sub(int); +type parameter = +| Add (int) +| Sub (int); -let main2 = ((p: param), storage) => { - let storage = - storage - + ( - switch (p) { - | Add(n) => n - | Sub(n) => 0 - n +type return = (list (operation), storage); + +let main = ((action, store): (parameter, storage)) => { + let store = + store + + (switch (action) { + | Add (n) => n + | Sub (n) => -n } ); - (([]: list(operation)), storage); + (([]: list(operation)), store); }; - -let main = (x: (param, storage)) => main2(x[0],x[1]); diff --git a/src/test/contracts/match_bis.mligo b/src/test/contracts/match_bis.mligo index dcbc155e9..145e1bcf6 100644 --- a/src/test/contracts/match_bis.mligo +++ b/src/test/contracts/match_bis.mligo @@ -1,19 +1,17 @@ type storage = int -(* variant defining pseudo multi-entrypoint actions *) - -type action = +type parameter = Increment of int | Decrement of int -let add (a: int) (b: int) : int = a + b -let sub (a: int) (b: int) : int = a - b +type return = operation list * storage -(* real entrypoint that re-routes the flow based on the action provided *) +let add (a : int) (b : int) : int = a + b +let sub (a : int) (b : int) : int = a - b -let main (p, s: action * storage) = - let storage = - match p with - Increment n -> add s n - | Decrement n -> sub s n - in ([] : operation list), storage +let main (action, store : parameter * storage) : return = + let store = + match action with + Increment n -> add store n + | Decrement n -> sub store n + in ([] : operation list), store diff --git a/src/test/contracts/match_bis.religo b/src/test/contracts/match_bis.religo index d1465d77b..9c7d12dae 100644 --- a/src/test/contracts/match_bis.religo +++ b/src/test/contracts/match_bis.religo @@ -1,24 +1,17 @@ type storage = int; -/* variant defining pseudo multi-entrypoint actions */ - -type action = - Increment(int) - | Decrement(int); +type parameter = + Increment (int) +| Decrement (int); let add = ((a: int), (b: int)) => a + b; +let sub = ((a: int), (b: int)) => a - b; -let subtract = ((a: int), (b: int)) => a - b; - -/* real entrypoint that re-routes the flow based on the action provided */ - -let main2 = ((p: action), storage) => { - let storage = - switch (p) { - | Increment(n) => add(storage, n) - | Decrement(n) => subtract(storage, n) +let main = ((action, store) : (parameter, storage)) => { + let store = + switch (action) { + | Increment (n) => add (store, n) + | Decrement (n) => sub (store, n) }; - (([]: list(operation)), storage); + (([]: list (operation)), store); }; - -let main = (x: (action, storage)) => main2(x[0],x[1]); diff --git a/src/test/contracts/multiple-parameters.mligo b/src/test/contracts/multiple-parameters.mligo index 8b6d442f7..745b421cf 100644 --- a/src/test/contracts/multiple-parameters.mligo +++ b/src/test/contracts/multiple-parameters.mligo @@ -1,7 +1,7 @@ (* Test function with several parameters *) let abcde_curried (a : int) (b : int) (c : int) (d : int) (e : int) : int = - (c + e + 3) + c + e + 3 let abcde (x : int * int * int * int * int) : int = abcde_curried x.0 x.1 x.2 x.3 x.4 diff --git a/src/test/contracts/multiple-parameters.religo b/src/test/contracts/multiple-parameters.religo index 09af4152b..bececfa8f 100644 --- a/src/test/contracts/multiple-parameters.religo +++ b/src/test/contracts/multiple-parameters.religo @@ -1,6 +1,7 @@ /* Test function with several parameters */ -let abcde_curried = (a: int, b: int, c: int, d: int, e: int): int => c + e + 3; - -let abcde = (x: (int , int , int , int , int)): int => abcde_curried(x[0], x[1], x[2], x[3], x[4]); +let abcde_curried = + (a: int, b: int, c: int, d: int, e: int): int => c + e + 3; +let abcde = (x: (int , int , int , int , int)) : int => + abcde_curried (x[0], x[1], x[2], x[3], x[4]); diff --git a/src/test/contracts/multisig.mligo b/src/test/contracts/multisig.mligo index 2a7753cc6..4d81e158a 100644 --- a/src/test/contracts/multisig.mligo +++ b/src/test/contracts/multisig.mligo @@ -2,65 +2,63 @@ type counter = nat type threshold = nat -type authorized_keys = (key) list +type authorized_keys = key list type id = string type storage = { - id : id; - counter : counter; - threshold : threshold; - auth : authorized_keys + id : id; + counter : counter; + threshold : threshold; + auth : authorized_keys } // I/O types -type message = unit -> (operation) list +type message = unit -> operation list + +type signatures = (key_hash * signature) list -type signatures = (key_hash*signature) list type check_message_pt = { - counter : counter; - message : message; - signatures : signatures + counter : counter; + message : message; + signatures : signatures } -type return = (operation) list * storage +type return = operation list * storage type parameter = CheckMessage of check_message_pt -let check_message (param,s : check_message_pt * storage) : return = +let check_message (param, s : check_message_pt * storage) : return = let message : message = param.message in let s = - if (param.counter <> s.counter) then - let coco = failwith ("Counters does not match") in s - else ( - let packed_payload : bytes = Bytes.pack ((message, param.counter, s.id, chain_id)) in - let valid : nat = 0n in - let keys : authorized_keys = s.auth in - let aux = fun (vk, pkh_sig: (nat* authorized_keys) * (key_hash*signature)) -> - let (valid,keys) = vk in - match (keys) with - | [] -> (valid,keys) - | key::tl -> ( - let keys = tl in - if (pkh_sig.0 = Crypto.hash_key (key)) then - let valid = - if (Crypto.check key pkh_sig.1 packed_payload) then valid + 1n - else let coco = failwith ("Invalid signature") in valid - in - (valid,keys) - else (valid,keys) - ) - in - let (valid,keys) = List.fold aux param.signatures (valid,keys) in - if (valid < s.threshold) then - let coco = failwith ("Not enough signatures passed the check") in - s - else - {s with counter = s.counter + 1n} - ) - in - (message(unit),s) + if param.counter <> s.counter then + (failwith "Counters does not match" : storage) + else + let packed_payload : bytes = + Bytes.pack (message, param.counter, s.id, chain_id) in + let valid : nat = 0n in + let keys : authorized_keys = s.auth in + let aux = + fun (vk, pkh_sig: (nat * authorized_keys)*(key_hash * signature)) -> + let valid, keys = vk in + match keys with + | [] -> vk + | key::keys -> + if pkh_sig.0 = Crypto.hash_key key + then + let valid = + if Crypto.check key pkh_sig.1 packed_payload + then valid + 1n + else (failwith "Invalid signature" : nat) + in valid, keys + else valid, keys in + let valid, keys = + List.fold aux param.signatures (valid, keys) in + if valid < s.threshold then + (failwith ("Not enough signatures passed the check") : storage) + else {s with counter = s.counter + 1n} + in message unit, s -let main (param, s: parameter * storage) : return = - match (param) with - | CheckMessage (p) -> check_message (p,s) +let main (action, store : parameter * storage) : return = + match action with + CheckMessage (p) -> check_message (p, store) diff --git a/src/test/contracts/multisig.religo b/src/test/contracts/multisig.religo index a2d709ab9..82b44d861 100644 --- a/src/test/contracts/multisig.religo +++ b/src/test/contracts/multisig.religo @@ -6,75 +6,72 @@ type authorized_keys = list (key); type id = string; type storage = { - id : id, - counter : counter, - threshold : threshold, - auth : authorized_keys + id : id, + counter : counter, + threshold : threshold, + auth : authorized_keys }; // I/O types type message = unit => list (operation); + type dummy = (key_hash,signature); -type signatures = list (dummy); + +type signatures = list (dummy); /* Waiting to be fixed */ type check_message_pt = { - counter : counter, - message : message, - signatures : signatures + counter : counter, + message : message, + signatures : signatures }; -type return = (list (operation),storage); +type return = (list (operation),storage); type parameter = CheckMessage (check_message_pt); -let check_message = ((param,s) : (check_message_pt, storage)) : return => { +let check_message = ((param, s): (check_message_pt, storage)) : return => +{ let message : message = param.message; let s = - if (param.counter != s.counter) { - let coco = failwith ("Counters does not match"); - s; - } - else { - let packed_payload : bytes = Bytes.pack ((message, param.counter, s.id, chain_id)); - let valid : nat = 0n; - let keys : authorized_keys = s.auth; - let aux = ((vk,pkh_sig) : ((nat, authorized_keys),(key_hash,signature))):(nat,authorized_keys) => { - let (valid,keys) = vk; - switch(keys) { - | [] => (valid,keys); - | [key, ...tl] => { - let keys = tl; - if (pkh_sig[0] == Crypto.hash_key (key)){ - let valid = - if (Crypto.check (key, pkh_sig[1], packed_payload)){ - valid + 1n ; - } - else { - let coco = failwith ("Invalid signature"); - valid; - }; - (valid,keys); - } - else { - (valid,keys); - }; + if (param.counter != s.counter) { + (failwith ("Counters does not match") : storage); + } else { + let packed_payload : bytes = + Bytes.pack ((message, param.counter, s.id, chain_id)); + let valid : nat = 0n; + let keys : authorized_keys = s.auth; + let aux = ((vk, pkh_sig) : + ((nat, authorized_keys), (key_hash, signature))) + : (nat, authorized_keys) => { + let (valid, keys) = vk; + switch (keys) { + | [] => vk; + | [key, ...keys] => + if (pkh_sig[0] == Crypto.hash_key (key)) { + let valid = + if (Crypto.check (key, pkh_sig[1], packed_payload)) { + valid + 1n; + } + else { (failwith ("Invalid signature") : nat) }; + (valid, keys); + } + else { (valid, keys); }; }; }; - }; - let (valid,keys) = List.fold (aux, param.signatures, (valid,keys)); + let (valid, keys) = + List.fold (aux, param.signatures, (valid, keys)); if (valid < s.threshold) { - let coco = failwith ("Not enough signatures passed the check"); - s; + (failwith ("Not enough signatures passed the check") : storage); } else { {...s,counter : s.counter + 1n}; }; }; - (message(unit),s) + (message (unit),s) }; -let main = ((param, s) : (parameter,storage)) : return => - switch(param) { - | CheckMessage (p) => check_message ((p,s)) +let main = ((action, store) : (parameter,storage)) : return => + switch (action) { + | CheckMessage (p) => check_message ((p, store)) } diff --git a/src/test/contracts/negative/self_in_lambda.mligo b/src/test/contracts/negative/self_in_lambda.mligo index 493047199..88d201974 100644 --- a/src/test/contracts/negative/self_in_lambda.mligo +++ b/src/test/contracts/negative/self_in_lambda.mligo @@ -1,5 +1,5 @@ let foo (u: unit) : address = - Current.self_address + Tezos.self_address let main (ps: unit * address): (operation list * address) = - ( ([] : operation list) , foo) \ No newline at end of file + ( ([] : operation list) , foo) diff --git a/src/test/contracts/option.religo b/src/test/contracts/option.religo index 75dacb697..e416a034e 100644 --- a/src/test/contracts/option.religo +++ b/src/test/contracts/option.religo @@ -1,4 +1,4 @@ -type foobar = option(int); +type foobar = option (int); -let s: foobar = Some(42); -let n: foobar = None; +let s : foobar = Some (42); +let n : foobar = None; diff --git a/src/test/contracts/record.mligo b/src/test/contracts/record.mligo index 4863cdf6c..96cb99a33 100644 --- a/src/test/contracts/record.mligo +++ b/src/test/contracts/record.mligo @@ -1,24 +1,10 @@ -type foobar = { - foo : int ; - bar : int ; -} +type foobar = {foo : int; bar : int} -let fb : foobar = { - foo = 0 ; - bar = 0 ; -} +let fb : foobar = {foo=0; bar=0} -type abc = { - a : int ; - b : int ; - c : int -} +type abc = {a : int; b : int; c : int} -let abc : abc = { - a = 42 ; - b = 142 ; - c = 242 -} +let abc : abc = {a=42; b=142; c=242} let a : int = abc.a let b : int = abc.b @@ -28,26 +14,25 @@ let projection (r : foobar) : int = r.foo + r.bar let modify (r : foobar) : foobar = {foo = 256; bar = r.bar} -let modify_abc (r : abc) : abc = let c = 42 in {r with b = 2048; c = c} +let modify_abc (r : abc) : abc = let c = 42 in {r with b=2048; c=c} type big_record = { - a : int ; - b : int ; - c : int ; - d : int ; - e : int ; + a : int; + b : int; + c : int; + d : int; + e : int } let br : big_record = { - a = 23 ; - b = 23 ; - c = 23 ; - d = 23 ; - e = 23 ; + a = 23; + b = 23; + c = 23; + d = 23; + e = 23 } -type double_record = { - inner : abc; -} +type double_record = {inner : abc} -let modify_inner (r : double_record) : double_record = {r with inner.b = 2048 } +let modify_inner (r : double_record) : double_record = + {r with inner.b = 2048} diff --git a/src/test/contracts/record.religo b/src/test/contracts/record.religo index c82801324..793d01640 100644 --- a/src/test/contracts/record.religo +++ b/src/test/contracts/record.religo @@ -1,22 +1,22 @@ type foobar = { - foo : int , - bar : int , + foo : int, + bar : int }; let fb : foobar = { - foo : 0 , - bar : 0 , + foo : 0, + bar : 0 }; type abc = { - a : int , - b : int , + a : int, + b : int, c : int }; let abc : abc = { - a : 42 , - b : 142 , + a : 42, + b : 142, c : 242 }; @@ -24,30 +24,31 @@ let a : int = abc.a; let b : int = abc.b; let c : int = abc.c; -let projection = (r : foobar) : int => r.foo + r.bar; +let projection = (r: foobar) : int => r.foo + r.bar; -let modify = (r : foobar) : foobar => {foo : 256, bar : r.bar}; +let modify = (r: foobar) : foobar => {foo: 256, bar: r.bar}; -let modify_abc = (r : abc) : abc => {...r,b : 2048 , c:42}; +let modify_abc = (r: abc) : abc => {...r, b: 2048, c: 42}; type big_record = { - a : int , - b : int , - c : int , - d : int , - e : int , + a : int, + b : int, + c : int, + d : int, + e : int }; let br : big_record = { - a : 23 , - b : 23 , - c : 23 , - d : 23 , - e : 23 , + a : 23, + b : 23, + c : 23, + d : 23, + e : 23 }; type double_record = { inner : abc, }; -let modify_inner = (r : double_record) : double_record => {...r,inner.b : 2048 }; +let modify_inner = + (r: double_record) : double_record => {...r, inner.b : 2048}; diff --git a/src/test/contracts/self_address.ligo b/src/test/contracts/self_address.ligo index e6f440a7e..5dd4aebe0 100644 --- a/src/test/contracts/self_address.ligo +++ b/src/test/contracts/self_address.ligo @@ -1 +1 @@ -function main (const p : unit) : address is self_address +function main (const p : unit) : address is Tezos.self_address diff --git a/src/test/contracts/self_address.mligo b/src/test/contracts/self_address.mligo index ade0926ee..bd33b92a6 100644 --- a/src/test/contracts/self_address.mligo +++ b/src/test/contracts/self_address.mligo @@ -1 +1 @@ -let main (p: unit) : address = Current.self_address +let main (p : unit) : address = Tezos.self_address diff --git a/src/test/contracts/self_address.religo b/src/test/contracts/self_address.religo index e072bc56f..a2dd5a652 100644 --- a/src/test/contracts/self_address.religo +++ b/src/test/contracts/self_address.religo @@ -1 +1 @@ -let main = (p: unit): address => Current.self_address; +let main = (p: unit) : address => Tezos.self_address; diff --git a/src/test/contracts/set_arithmetic-1.mligo b/src/test/contracts/set_arithmetic-1.mligo index 6c31953b4..634c18cc6 100644 --- a/src/test/contracts/set_arithmetic-1.mligo +++ b/src/test/contracts/set_arithmetic-1.mligo @@ -2,5 +2,4 @@ let aggregate (i : int) (j : int) : int = i + j -let fold_op (s : int set) : int = - Set.fold aggregate s 15 +let fold_op (s : int set) : int = Set.fold aggregate s 15 diff --git a/src/test/contracts/set_arithmetic.mligo b/src/test/contracts/set_arithmetic.mligo index 2713905b3..9d3c6e2a1 100644 --- a/src/test/contracts/set_arithmetic.mligo +++ b/src/test/contracts/set_arithmetic.mligo @@ -20,8 +20,6 @@ let patch_op_deep (s: string set * nat) : string set * nat = begin patch s.0 with set ["foobar"]; end with s *) -let mem_op (s : string set) : bool = - Set.mem "foobar" s +let mem_op (s : string set) : bool = Set.mem "foobar" s -let size_op (s: string set) : nat = - Set.size s +let size_op (s: string set) : nat = Set.cardinal s diff --git a/src/test/contracts/set_arithmetic.religo b/src/test/contracts/set_arithmetic.religo index 5aa634333..a219fba9b 100644 --- a/src/test/contracts/set_arithmetic.religo +++ b/src/test/contracts/set_arithmetic.religo @@ -1,22 +1,19 @@ /* Test set operations in ReasonLIGO */ -let literal_op = (p: unit) : set(string) => Set.literal(["foo", "bar", "foobar"]); +let literal_op = (p: unit) : set (string) => + Set.literal (["foo", "bar", "foobar"]); -let add_op = (s: set(string)): set(string) => Set.add("foobar", s); +let add_op = (s: set (string)) : set (string) => + Set.add ("foobar", s); -let remove_op = (s: set(string)): set(string) => Set.remove("foobar", s); +let remove_op = (s: set (string)) : set(string) => + Set.remove ("foobar", s); -let remove_deep = (s: (set(string), nat)): (set(string), nat) => - Set.remove("foobar", s[0]); +let remove_deep = (s: (set (string), nat)): (set (string), nat) => + Set.remove ("foobar", s[0]); -/* - let patch_op (s: string set) : string set = - begin patch s with set ["foobar"]; end with s +let mem_op = (s: set (string)) : bool => + Set.mem ("foobar", s); - let patch_op_deep (s: string set * nat) : string set * nat = - begin patch s[0] with set ["foobar"]; end with s - */ - -let mem_op = (s: set(string)): bool => Set.mem("foobar", s); - -let size_op = (s: set(string)): nat => Set.size(s); +let size_op = (s: set (string)): nat => + Set.cardinal (s); diff --git a/src/test/contracts/set_delegate.mligo b/src/test/contracts/set_delegate.mligo index 9b3629f5d..66346cef6 100644 --- a/src/test/contracts/set_delegate.mligo +++ b/src/test/contracts/set_delegate.mligo @@ -1,3 +1,3 @@ -let main (p: key_hash) : operation list = - let unused: operation = (Operation.set_delegate (Some p)) in ([]: operation list) - +let main (p : key_hash) : operation list = + let useless : operation = Tezos.set_delegate (Some p) + in ([] : operation list) diff --git a/src/test/contracts/set_delegate.religo b/src/test/contracts/set_delegate.religo index bae3a38fb..90d3d0c12 100644 --- a/src/test/contracts/set_delegate.religo +++ b/src/test/contracts/set_delegate.religo @@ -1,4 +1,4 @@ -let main = (p: key_hash) : list(operation) => { - let unused: operation = (Operation.set_delegate(Some(p))); - ([]: list(operation)); +let main = (p: key_hash) : list (operation) => { + let unused : operation = (Tezos.set_delegate (Some (p))); + ([] : list (operation)); } ; diff --git a/src/test/contracts/string_arithmetic.mligo b/src/test/contracts/string_arithmetic.mligo index a17e8bd47..97d74d5e3 100644 --- a/src/test/contracts/string_arithmetic.mligo +++ b/src/test/contracts/string_arithmetic.mligo @@ -1,7 +1,5 @@ (* Test that the string concatenation syntax in CameLIGO works *) -let size_op (s: string) : nat = String.size s - -let slice_op (s: string) : string = String.slice 1n 2n s - -let concat_syntax (s: string) = s ^ "test_literal" +let size_op (s : string) : nat = String.length s +let slice_op (s : string) : string = String.sub 1n 2n s +let concat_syntax (s : string) = s ^ "test_literal" diff --git a/src/test/contracts/string_arithmetic.religo b/src/test/contracts/string_arithmetic.religo index ba3949f08..cd3a785cb 100644 --- a/src/test/contracts/string_arithmetic.religo +++ b/src/test/contracts/string_arithmetic.religo @@ -1,7 +1,5 @@ /* Test that the string concatenation syntax in ReasonLIGO works */ -let size_op = (s: string): nat => String.size(s); - -let slice_op = (s: string): string => String.slice(1n, 2n, s); - +let size_op = (s: string) : nat => String.length (s); +let slice_op = (s: string) : string => String.sub (1n, 2n, s); let concat_syntax = (s: string) => s ++ "test_literal"; diff --git a/src/test/contracts/subtle_nontail_fail.mligo b/src/test/contracts/subtle_nontail_fail.mligo index 107dbdb1e..6b3c52b9b 100644 --- a/src/test/contracts/subtle_nontail_fail.mligo +++ b/src/test/contracts/subtle_nontail_fail.mligo @@ -1,4 +1,4 @@ -let main (ps : unit * unit) = +let main (_ : unit * unit) = if true then failwith "This contract always fails" else failwith "This contract still always fails" diff --git a/src/test/contracts/super-counter.mligo b/src/test/contracts/super-counter.mligo index dc00c9567..2090a5732 100644 --- a/src/test/contracts/super-counter.mligo +++ b/src/test/contracts/super-counter.mligo @@ -1,13 +1,17 @@ -type action = -| Increment of int +type parameter = + Increment of int | Decrement of int -let test_param = Increment(1) +type storage = int + +type return = operation list * storage + +let test_param = Increment 1 let test_storage = 2 -let main (ps : action * int) : (operation list * int) = - let storage = - match ps.0 with - | Increment n -> ps.1 + n - | Decrement n -> ps.1 - n in - (([] : operation list) , storage) +let main (action, store : parameter * storage) : return = + let store = + match action with + | Increment n -> store + n + | Decrement n -> store - n + in ([] : operation list), store diff --git a/src/test/contracts/super-counter.religo b/src/test/contracts/super-counter.religo index 3e64f3152..53eba61af 100644 --- a/src/test/contracts/super-counter.religo +++ b/src/test/contracts/super-counter.religo @@ -1,12 +1,16 @@ -type action = - | Increment(int) - | Decrement(int); +type parameter = + Increment (int) +| Decrement (int); -let main = (p: action, s: int): (list(operation), int) => { - let storage = - switch (p) { - | Increment(n) => s + n - | Decrement(n) => s - n +type storage = int; + +type return = (list (operation), storage); + +let main = ((action, store): (parameter, storage) : return => { + let store = + switch (action) { + | Increment (n) => store + n + | Decrement (n) => store - n }; - ([]: list(operation), storage); + ([] : list (operation), store); }; diff --git a/src/test/contracts/tez.mligo b/src/test/contracts/tez.mligo index 557de9e2d..f03821ec8 100644 --- a/src/test/contracts/tez.mligo +++ b/src/test/contracts/tez.mligo @@ -1,5 +1,6 @@ -let add_tez : tez = 21mutez + 0.000021tz -let sub_tez : tez = 0.000021tz - 0.000020tz -let not_enough_tez : tez = 4611686018427.387903tz +let add_tez : tez = 21mutez + 0.000_021tez +let sub_tez : tez = 0.000021tez - 0.000_020tez +let not_enough_tez : tez = 461_168_601_842_738_7903mutez -let add_more_tez : tez = 100tz + 10tz + 1tz + 0.1tz + 0.01tz + 0.001tz +let add_more_tez : tez = + 100tez + 10tez + 1tez + 0.1tez + 0.01tez + 0.001tez diff --git a/src/test/contracts/timelock_repeat.mligo b/src/test/contracts/timelock_repeat.mligo index 5efff81a9..e2d4edd05 100644 --- a/src/test/contracts/timelock_repeat.mligo +++ b/src/test/contracts/timelock_repeat.mligo @@ -1,22 +1,22 @@ +type parameter = unit + type storage = { - next_use: timestamp; - interval: int; - execute: unit -> operation list; + next_use : timestamp; + interval : int; + execute : unit -> operation list } -let main (p,s: unit * storage) : operation list * storage = - (* Multiple calls to Current.time give different values *) - let now: timestamp = Current.time in - if now > s.next_use +type return = operation list * storage + +let main (action, store : parameter * storage) : return = + (* Multiple evaluations of Tezos.now give different values *) + let my_now : timestamp = Tezos.now in + if my_now > store.next_use then - let s: storage = { - next_use = now + s.interval; - interval = s.interval; - execute = s.execute; - } - in - (s.execute (), s) + let store : storage = + {store with next_use = my_now + store.interval} + in store.execute (), store else (* TODO: Add the time until next use to this message *) - (failwith "You have to wait before you can execute this contract again.": - operation list * storage) + (failwith "You have to wait before you can execute this contract again." + : return) diff --git a/src/test/contracts/tuple.mligo b/src/test/contracts/tuple.mligo index 11726bf18..5dd1c4c2e 100644 --- a/src/test/contracts/tuple.mligo +++ b/src/test/contracts/tuple.mligo @@ -4,7 +4,7 @@ let projection_abc (tpl : abc) : int = tpl.1 type foobar = int * int -let fb : foobar = (0, 0) +let fb : foobar = (0,0) let projection (tpl : foobar) : int = tpl.0 + tpl.1 diff --git a/src/test/contracts/tuple_type.mligo b/src/test/contracts/tuple_type.mligo index d9cdb62b5..98e85209f 100644 --- a/src/test/contracts/tuple_type.mligo +++ b/src/test/contracts/tuple_type.mligo @@ -1,14 +1,13 @@ -let g (b: int) = b + 3 +let g (b : int) = b + 3 -let f (b: int * int) : int -> int = g +let f (b : int * int) : int -> int = g -let a (b: int * int -> int -> int) : int = (b (5,3)) 5 +let a (b : int * int -> int -> int) : int = (b (5,3)) 5 -let test1 (_: int) = - a f +let test1 (_: int) = a f -let n (a, b: int * int): int = a + b +let n (a, b : int * int) : int = a + b -let o (p: int * int -> int): int = p((3, 9)) +let o (p : int * int -> int) : int = p (3, 9) -let test2 (ignore: int) = o(n) +let test2 (ignore : int) = o (n) diff --git a/src/test/contracts/tuple_type.religo b/src/test/contracts/tuple_type.religo index 6148840c0..e17fbc9fb 100644 --- a/src/test/contracts/tuple_type.religo +++ b/src/test/contracts/tuple_type.religo @@ -1,49 +1,43 @@ -/* - The difference between tuples and arguments is subtle in ReasonLIGO. - - `f(a, b);` +/* + The difference between tuples and arguments is subtle in ReasonLIGO. + + `f(a, b);` f is called with two arguments - `f((a, b));` + `f((a, b));` f is called with a tuple. - + */ type fun_type = (int, int) => int; -let arguments = (b: int, c: int) => { - b + c; -}; +let arguments = (b: int, c: int) => { b + c; }; -let arguments_type_def = (b: fun_type) => b(5, 3); +let arguments_type_def = (b: fun_type) => b (5, 3); -let arguments_test = (ignore: int) => arguments_type_def(arguments); +let arguments_test = (ignore: int) => arguments_type_def (arguments); type tuple_type = ((int, int)) => int; -let tuple = ((a, b): (int, int)) => { - a + b; -}; +let tuple = ((a, b): (int, int)) => { a + b; }; -let tuple_type_def = (b: tuple_type) => b((5, 3)); +let tuple_type_def = (b: tuple_type) => b ((5, 3)); -let tuple_test = (ignore: int) => tuple_type_def(tuple); +let tuple_test = (ignore: int) => tuple_type_def (tuple); /* inline */ -let arguments_inline = (b: int, c: int) => { - b + c; -}; +let arguments_inline = (b: int, c: int) => { b + c; }; -let arguments_type_def_inline = (b: (int, int) => int) => b(5, 3); +let arguments_type_def_inline = (b: (int, int) => int) => b (5, 3); -let arguments_test_inline = (ignore: int) => arguments_type_def_inline(arguments_inline); +let arguments_test_inline = (ignore: int) => + arguments_type_def_inline (arguments_inline); -let tuple_inline = ((a, b): (int, int)) => { - a + b; -}; +let tuple_inline = ((a, b): (int, int)) => { a + b; }; -let tuple_type_def_inline = (b: ((int, int)) => int) => b((5, 3)); +let tuple_type_def_inline = (b: ((int, int)) => int) => b ((5, 3)); -let tuple_test_inline = (ignore: int) => tuple_type_def_inline(tuple_inline); +let tuple_test_inline = (ignore: int) => + tuple_type_def_inline(tuple_inline); diff --git a/src/test/contracts/tuples_sequences_functions.religo b/src/test/contracts/tuples_sequences_functions.religo index bffd78faf..38107dd54 100644 --- a/src/test/contracts/tuples_sequences_functions.religo +++ b/src/test/contracts/tuples_sequences_functions.religo @@ -34,12 +34,12 @@ let q = { }, }; -/* +/* Not supported yet by parser: let r = { a: 1 -}; +}; */ let s = { diff --git a/src/test/contracts/type_tuple_destruct.mligo b/src/test/contracts/type_tuple_destruct.mligo index 05bcaea59..b9b9afcaa 100644 --- a/src/test/contracts/type_tuple_destruct.mligo +++ b/src/test/contracts/type_tuple_destruct.mligo @@ -1,11 +1,11 @@ type foobar = int * int -let test_t: foobar = 10, 25 +let test_t : foobar = 10, 25 let foo, bar = test_t -let type_tuple_d (p: unit) = foo + bar +let type_tuple_d (p : unit) = foo + bar type complex = string * int * string * nat let test_t_2 = "hello", 10, "world", 50n let hello, ten, world, fifty_n = test_t_2 -let type_tuple_d_2 (p: unit) = hello ^ world +let type_tuple_d_2 (p : unit) = hello ^ world diff --git a/src/test/contracts/variant.mligo b/src/test/contracts/variant.mligo index ee56b808d..874ab75be 100644 --- a/src/test/contracts/variant.mligo +++ b/src/test/contracts/variant.mligo @@ -4,7 +4,5 @@ type foobar = | Kee of nat let foo : foobar = Foo 42 - let bar : foobar = Bar true - let kee : foobar = Kee 23n diff --git a/src/test/contracts/variant.religo b/src/test/contracts/variant.religo index 99b69e94f..a408a3900 100644 --- a/src/test/contracts/variant.religo +++ b/src/test/contracts/variant.religo @@ -1,10 +1,8 @@ type foobar = - | Foo(int) - | Bar(bool) - | Kee(nat); + Foo (int) +| Bar (bool) +| Kee (nat); -let foo: foobar = Foo(42); - -let bar: foobar = Bar(true); - -let kee: foobar = Kee(23n); +let foo: foobar = Foo (42); +let bar: foobar = Bar (true); +let kee: foobar = Kee (23n); diff --git a/src/test/contracts/vote.mligo b/src/test/contracts/vote.mligo index a32f54fa4..aefc8e4a0 100644 --- a/src/test/contracts/vote.mligo +++ b/src/test/contracts/vote.mligo @@ -1,56 +1,49 @@ type storage = { - title : string ; - candidates : (string , int) map ; - voters : address set ; - beginning_time : timestamp ; - finish_time : timestamp ; + title : string; + yea : nat; + nay : nat; + voters : address set; + start_time : timestamp; + finish_time : timestamp } -type init_action = { - title : string ; - beginning_time : timestamp ; - finish_time : timestamp ; +type return = operation list * storage + +type vote = Yea | Nay + +type reset = { + title : string; + start_time : timestamp; + finish_time : timestamp } -type action = - | Vote of string - | Init of init_action +type parameter = +| Vote of vote +| Reset of reset -let init (init_params_s : init_action * storage) = - let candidates = Map.literal [ - ("Yes" , 0) ; - ("No" , 0) - ] in - ( - ([] : operation list), - { - title = init_params_s.0.title ; - candidates = candidates ; - voters = (Set.empty : address set) ; - beginning_time = init_params_s.0.beginning_time ; - finish_time = init_params_s.0.finish_time ; - } - ) +let reset (reset, _ : reset * storage) : return = + ([] : operation list), + {title = reset.title; + yea = 0n; + nay = 0n; + voters = (Set.empty : address set); + start_time = reset.start_time; + finish_time = reset.finish_time} -let vote (ps : string * storage) = - let now = Current.time in - (* let _ = assert (now >= ps.1.beginning_time && ps.1.finish_time > now) in *) - let addr = Current.sender in - (* let _ = assert (not Set.mem addr ps.1.voters) in *) - let x = Map.find ps.0 ps.1.candidates in - ( - ([] : operation list), - { - title = ps.1.title ; - candidates = Map.update ps.0 (Some (x + 1)) ps.1.candidates ; - voters = Set.add addr ps.1.voters ; - beginning_time = ps.1.beginning_time ; - finish_time = ps.1.finish_time ; - } - ) - -let main (a_s : action * storage) = - match a_s.0 with - | Vote p -> vote (p, a_s.1) - | Init ps -> init (ps, a_s.1) +let vote (vote, store : vote * storage) : return = + let now = Tezos.now in + (* let _ = + assert (now >= store.start_time && store.finish_time > now) in *) + let addr = Tezos.sender in + (* let _ = assert (not Set.mem addr store.voters) in *) + let store = + match vote with + Yea -> {store with yea = store.yea + 1n} + | Nay -> {store with nay = store.nay + 1n} + in ([] : operation list), + {store with voters = Set.add addr store.voters} +let main (action, store : parameter * storage) : return = + match action with + | Vote v -> vote (v, store) + | Reset r -> reset (r, store) diff --git a/src/test/contracts/website2.mligo b/src/test/contracts/website2.mligo index 73c04cbd5..cc6d85ff5 100644 --- a/src/test/contracts/website2.mligo +++ b/src/test/contracts/website2.mligo @@ -4,16 +4,16 @@ type storage = int (* variant defining pseudo multi-entrypoint actions *) -type action = +type parameter = | Increment of int | Decrement of int let add (a,b: int * int) : int = a + b let sub (a,b: int * int) : int = a - b -(* real entrypoint that re-routes the flow based on the action provided *) +(* real entrypoint that re-routes the flow based on the parameter provided *) -let main (p,s: action * storage) = +let main (p,s: parameter * storage) = let storage = match p with | Increment n -> add (s, n) diff --git a/src/test/contracts/website2.religo b/src/test/contracts/website2.religo index ffed8cd90..f9b936047 100644 --- a/src/test/contracts/website2.religo +++ b/src/test/contracts/website2.religo @@ -4,22 +4,22 @@ type storage = int; /* variant defining pseudo multi-entrypoint actions */ -type action = - | Increment(int) - | Decrement(int); +type parameter = +| Increment (int) +| Decrement (int); let add = ((a,b): (int, int)): int => a + b; let sub = ((a,b): (int, int)): int => a - b; -/* real entrypoint that re-routes the flow based on the action provided */ +/* real entrypoint that re-routes the flow based on the parameter provided */ -let main = ((p,storage): (action, storage)) => { +let main = ((p,storage): (parameter, storage)) => { let storage = switch (p) { - | Increment(n) => add((storage, n)) - | Decrement(n) => sub((storage, n)) + | Increment(n) => add ((storage, n)) + | Decrement(n) => sub ((storage, n)) }; - ([]: list(operation), storage); + ([]: list (operation), storage); }; (* IF YOU CHANGE THIS, CHANGE THE EXAMPLE ON THE FRONT PAGE OF THE WEBSITE *) diff --git a/src/test/hash_lock_tests.ml b/src/test/hash_lock_tests.ml index 7bfe77c88..7da1882ab 100644 --- a/src/test/hash_lock_tests.ml +++ b/src/test/hash_lock_tests.ml @@ -61,7 +61,7 @@ let commit () = let salted_hash = e_bytes_raw (sha_256_hash (Bytes.concat Bytes.empty [test_hash_raw; packed_sender])) - + in let pre_commits = e_typed_big_map [] t_address (t_record_ez [("date", t_timestamp); ("salted_hash", t_bytes)]) @@ -99,7 +99,7 @@ let reveal_no_commit () = let init_storage = storage test_hash true pre_commits in expect_string_failwith program "reveal" (e_pair reveal init_storage) - "You haven't made a commitment to hash against yet." + "You have not made a commitment to hash against yet." (* Test that the contract fails if our commit isn't 24 hours old yet *) let reveal_young_commit () = @@ -132,7 +132,7 @@ let reveal_young_commit () = in expect_string_failwith ~options program "reveal" (e_pair reveal init_storage) - "It hasn't been 24 hours since your commit yet." + "It has not been 24 hours since your commit yet." (* Test that the contract fails if our reveal doesn't meet our commitment *) let reveal_breaks_commit () = @@ -164,7 +164,7 @@ let reveal_breaks_commit () = in expect_string_failwith ~options program "reveal" (e_pair reveal init_storage) - "This reveal doesn't match your commitment." + "This reveal does not match your commitment." (* Test that the contract fails if we reveal the wrong bytes for the stored hash *) let reveal_wrong_commit () = @@ -199,7 +199,7 @@ let reveal_wrong_commit () = "Your commitment did not match the storage hash." (* Test that the contract fails if we try to reuse it after unused flag changed *) -let reveal_no_reuse () = +let reveal_no_reuse () = let%bind program,_ = get_program () in let empty_message = empty_message in let reveal = e_record_ez [("hashable", e_bytes_string "hello"); diff --git a/src/test/time_lock_repeat_tests.ml b/src/test/time_lock_repeat_tests.ml index aa7b8b01b..4405948bf 100644 --- a/src/test/time_lock_repeat_tests.ml +++ b/src/test/time_lock_repeat_tests.ml @@ -17,7 +17,7 @@ let get_program = ok program ) -let compile_main () = +let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/timelock_repeat.mligo" (Syntax_name "cameligo") in let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in @@ -63,7 +63,7 @@ let interval_advance () = let%bind predecessor_timestamp = mk_time "2000-01-01T10:10:10Z" in let%bind lock_time = mk_time "2000-01-01T00:10:10Z" in let init_storage = storage lock_time 86400 empty_message in - (* It takes a second for Current.now to be called, awful hack *) + (* It takes a second for Tezos.now to be called, awful hack *) let%bind new_timestamp = mk_time "2000-01-02T10:10:11Z" in let new_storage_fake = storage new_timestamp 86400 fake_uncompiled_empty_message in let options = diff --git a/src/test/vote_tests.ml b/src/test/vote_tests.ml index 6817b9d6d..3a0a95021 100644 --- a/src/test/vote_tests.ml +++ b/src/test/vote_tests.ml @@ -20,38 +20,33 @@ open Ast_simplified let init_storage name = e_record_ez [ ("title" , e_string name) ; - ("candidates" , e_map [ - (e_string "Yes" , e_int 0) ; - (e_string "No" , e_int 0) ; - ]) ; + ("yea", e_nat 0) ; + ("nay", e_nat 0) ; ("voters" , e_typed_set [] t_address) ; - ("beginning_time" , e_timestamp 0) ; + ("start_time" , e_timestamp 0) ; ("finish_time" , e_timestamp 1000000000) ; ] -let init title beginning_time finish_time = - let init_action = e_record_ez [ +let reset title start_time finish_time = + let reset_action = e_record_ez [ ("title" , e_string title) ; - ("beginning_time" , e_timestamp beginning_time) ; - ("finish_time" , e_timestamp finish_time) ; - ] in - e_constructor "Init" init_action + ("start_time" , e_timestamp start_time) ; + ("finish_time" , e_timestamp finish_time)] + in e_constructor "Reset" reset_action -let vote str = - let vote = e_string str in - e_constructor "Vote" vote +let yea = e_constructor "Vote" (e_constructor "Yea" (e_unit ())) let init_vote () = let%bind (program , _) = get_program () in - let%bind result = Test_helpers.run_typed_program_with_simplified_input program "main" (e_pair (vote "Yes") (init_storage "basic")) in - let%bind (_ , storage) = extract_pair result in + let%bind result = + Test_helpers.run_typed_program_with_simplified_input + program "main" (e_pair yea (init_storage "basic")) in + let%bind (_, storage) = extract_pair result in let%bind storage' = extract_record storage in - let votes = List.assoc (Label "candidates") storage' in - let%bind votes' = extract_map votes in - let%bind (_ , yess) = - trace_option (simple_error "") @@ - List.find_opt (fun (k , _) -> Ast_simplified.Misc.is_value_eq (k , e_string "Yes")) votes' in - let%bind () = Ast_simplified.Misc.assert_value_eq (yess , e_int 1) in +(* let votes = List.assoc (Label "voters") storage' in + let%bind votes' = extract_map votes in *) + let yea = List.assoc (Label "yea") storage' in + let%bind () = Ast_simplified.Misc.assert_value_eq (yea, e_nat 1) in ok () let main = test_suite "Vote" [ From 9791b993d2a485c98709f55255277db62e41cde6 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Mon, 2 Mar 2020 21:42:45 -0800 Subject: [PATCH 07/40] Abbreviate and de-tone LIGO introduction draft --- gitlab-pages/docs/intro/ligo-intro.md | 51 ++++++++++----------------- src/test/md_file_tests.ml | 2 +- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/gitlab-pages/docs/intro/ligo-intro.md b/gitlab-pages/docs/intro/ligo-intro.md index 87a9bf7ba..d5eb5a9ac 100644 --- a/gitlab-pages/docs/intro/ligo-intro.md +++ b/gitlab-pages/docs/intro/ligo-intro.md @@ -7,11 +7,10 @@ LIGO is a programming language for writing [Tezos](https://tezos.com/) smart con The LIGO philosophy can be described in a few bullet points: -1. Design a clean, simple language with no extraneous parts or additions. +1. Design a clean, simple language with no unnecessary parts. -2. Give that language multiple syntaxes borrowed from other languages so users don't -have to clutter their brain with Yet Another Notation for the same programming -concepts we've been using since the 1980's. +2. Give that language multiple syntaxes borrowed from other languages. Ideally +LIGO requires the user to learn almost no new syntax. 3. Have that simple language encourage people to write simple code, so that it's easy to formally verify the compiled output using a project like [Mi-Cho-Coq](https://gitlab.com/nomadic-labs/mi-cho-coq/). @@ -19,35 +18,23 @@ easy to formally verify the compiled output using a project like [Mi-Cho-Coq](ht 4. Stop waking up in the morning to find that your smart contract lost all its money to some [stupid exploit](https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/). -Lets expand on each: +The current trend in language design is more, more, more, so this might seem +counterintuitive. However most useful smart contracts can express their core +functionality in under a thousand lines of code. The problem domain +necessitates that you get as close as possible to the minimal code size and +resource use. LIGO is a functional language designed to include the features +you need, while avoiding patterns that make formal verification hard. -* **Clean and simple** — Programming languages for making video games or websites -tend to prioritize accumulating a vast number of features, they're big languages for -making big projects. You use an army of mediocre programmers to write thousands -and thousands of lines of code, and then accelerate development by including dozens -or hundreds of unvetted dependencies; each of which provides an opportunity to -introduce a security exploit or insert malicious code. That's fine for a game, but -we don't think that's a very intelligent way to write a smart contract. Most useful -smart contracts can express their core functionality in under a thousand lines of -code, and the problem domain necessitates that you get as close as possible to -the minimal code size and resource use. LIGO is a functional language designed -to include the features you need, avoiding patterns that make formal verification -hard. - -* **Multiple Syntaxes** — LIGO provides three syntaxes for users which express the -same underlying language semantics. PascaLIGO is an imperative syntax based on -[Pascal](https://en.wikipedia.org/wiki/Pascal_%28programming_language%29), CameLIGO -is a syntax which closely mimics the look and feel of [OCaml](https://en.wikipedia.org/wiki/OCaml), -and ReasonLIGO is based on Facebook's JavaScript-flavored [ReasonML](https://reasonml.github.io/) syntax. - -* **Simple Code & Formal Verification** — LIGO doesn't use an object oriented paradigm, -currently code is organized using functions. While LIGO plans to have a module system -in the future, it's not the intent that this be used to create npm style cathedrals -of logical mystery meat. Once a contract is put on the blockchain, it's not possible -to change it. A new version can be uploaded, but the original contract remains -available. This makes formal verification of contract logic attractive. When the -cost of bugs is extreme and patches aren't possible it pays to get things right -the first time. +For example LIGO doesn't use an object oriented paradigm, currently code is +organized using functions. While LIGO plans to have a module system in the +future, we don't want programs to have thousands of dependencies. Once a +contract is put on the blockchain, it's not possible to change it. A new +version can be uploaded, but the original contract remains available. Contracts +tend to control money. In that environment it's not responsible to encourage +users to incorporate lots of code from strangers. The immutability of contracts +make formal verification of contract logic attractive. The eventual goal is +to make it easy to compile a LIGO contract to a format that can be loaded into +the [Coq proof assistant](https://coq.inria.fr/). ## LIGO for Programming Smart Contracts on Tezos diff --git a/src/test/md_file_tests.ml b/src/test/md_file_tests.ml index c728a929d..ca3eb65e3 100644 --- a/src/test/md_file_tests.ml +++ b/src/test/md_file_tests.ml @@ -92,7 +92,7 @@ let md_files = [ "/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-payout.md"; "/gitlab-pages/docs/intro/installation.md"; "/gitlab-pages/docs/intro/editor-support.md"; - "/gitlab-pages/docs/intro/what-and-why.md"; + "/gitlab-pages/docs/intro/ligo-intro.md"; "/gitlab-pages/docs/language-basics/math-numbers-tez.md"; "/gitlab-pages/docs/language-basics/functions.md"; "/gitlab-pages/docs/language-basics/boolean-if-else.md"; From 313bb0c2b3e7f21b5c918ec34fafdcc658233ff8 Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Wed, 4 Mar 2020 15:23:51 +0100 Subject: [PATCH 08/40] Reverted two changes. --- src/test/contracts/entrypoints.ligo | 6 +----- src/test/contracts/get_contract.ligo | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/test/contracts/entrypoints.ligo b/src/test/contracts/entrypoints.ligo index d47a8b78a..8775e7314 100644 --- a/src/test/contracts/entrypoints.ligo +++ b/src/test/contracts/entrypoints.ligo @@ -4,11 +4,7 @@ type return is list (operation) * storage function cb (const a : address; const s : storage) : return is block { - const c : contract (unit) = - case (Tezos.get_entrypoint_opt ("%cb", a) : option (contract (unit))) of - Some (contract) -> contract - | None -> (failwith ("cb: Entrypoint not found.") : contract (unit)) - end + const c : contract (unit) = get_entrypoint ("%cb", a) } with (list [Tezos.transaction (unit, 0tez, c)], s) diff --git a/src/test/contracts/get_contract.ligo b/src/test/contracts/get_contract.ligo index 5a7ca3541..13d325cba 100644 --- a/src/test/contracts/get_contract.ligo +++ b/src/test/contracts/get_contract.ligo @@ -2,11 +2,7 @@ type storage is unit type return is list (operation) * storage function cb (const s : storage) : return is block { - const c : contract (unit) = - case (Tezos.get_contract_opt (Tezos.sender) : option (contract (unit))) of - Some (contract) -> contract - | None -> (failwith ("cb: No contract.") : contract (unit)) - end + const c : contract (unit) = get_contract (Tezos.sender) } with (list [Tezos.transaction (unit, 0tez, c)], s) From bd48a56a2460cf3e3af27e15dd13f452aed23988 Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Wed, 4 Mar 2020 15:36:33 +0100 Subject: [PATCH 09/40] Forgot to add to the previous commit. --- src/bin/expect_tests/contract_tests.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index de2c772d9..39d95584f 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -1161,7 +1161,7 @@ let%expect_test _ = let%expect_test _ = run_ligo_bad [ "compile-contract" ; bad_contract "create_contract_toplevel.mligo" ; "main" ] ; [%expect {| - ligo: in file "create_contract_toplevel.mligo", line 4, character 35 to line 8, character 8. No free variable allowed in this lambda: variable 'store' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * string ):Some(( nat * string ))) : None return let rhs#752 = #P in let p = rhs#752.0 in let s = rhs#752.1 in ( list[] : (TO_list(operation)) , store ) , NONE() : (TO_option(key_hash)) , 300000000mutez , \"un\")","location":"in file \"create_contract_toplevel.mligo\", line 4, character 35 to line 8, character 8"} + ligo: in file "create_contract_toplevel.mligo", line 4, character 35 to line 8, character 8. No free variable allowed in this lambda: variable 'store' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * string ):Some(( nat * string ))) : None return let rhs#804 = #P in let p = rhs#804.0 in let s = rhs#804.1 in ( list[] : (TO_list(operation)) , store ) , NONE() : (TO_option(key_hash)) , 300000000mutez , \"un\")","location":"in file \"create_contract_toplevel.mligo\", line 4, character 35 to line 8, character 8"} If you're not sure how to fix this error, you can @@ -1174,7 +1174,7 @@ let%expect_test _ = run_ligo_bad [ "compile-contract" ; bad_contract "create_contract_var.mligo" ; "main" ] ; [%expect {| - ligo: in file "create_contract_var.mligo", line 6, character 35 to line 10, character 5. No free variable allowed in this lambda: variable 'a' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * int ):Some(( nat * int ))) : None return let rhs#755 = #P in let p = rhs#755.0 in let s = rhs#755.1 in ( list[] : (TO_list(operation)) , a ) , NONE() : (TO_option(key_hash)) , 300000000mutez , 1)","location":"in file \"create_contract_var.mligo\", line 6, character 35 to line 10, character 5"} + ligo: in file "create_contract_var.mligo", line 6, character 35 to line 10, character 5. No free variable allowed in this lambda: variable 'a' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * int ):Some(( nat * int ))) : None return let rhs#807 = #P in let p = rhs#807.0 in let s = rhs#807.1 in ( list[] : (TO_list(operation)) , a ) , NONE() : (TO_option(key_hash)) , 300000000mutez , 1)","location":"in file \"create_contract_var.mligo\", line 6, character 35 to line 10, character 5"} If you're not sure how to fix this error, you can From 9f675da02f116308d7519a1e236f82f71ec642df Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Wed, 4 Mar 2020 17:10:59 +0100 Subject: [PATCH 10/40] Probable cause of new website CI issue --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0f82551d9..970db9fc9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,7 @@ dont-merge-to-master: .website_build: &website_build stage: build_and_deploy - image: node:12-alpine + image: node:12 dependencies: - build-and-package-debian-9 - build-and-package-debian-10 From 8f6f4398dd6186428d7bbb52ba005691848d2d4d Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Wed, 4 Mar 2020 12:03:58 -0600 Subject: [PATCH 11/40] Add working example of Crypto.check --- src/test/contracts/check_signature.mligo | 22 ++++++++++++++++++++++ src/test/integration_tests.ml | 1 + 2 files changed, 23 insertions(+) diff --git a/src/test/contracts/check_signature.mligo b/src/test/contracts/check_signature.mligo index ecd56eb4b..5af7022c0 100644 --- a/src/test/contracts/check_signature.mligo +++ b/src/test/contracts/check_signature.mligo @@ -1,2 +1,24 @@ let check_signature (pk, signed, msg: key * signature * bytes) : bool = Crypto.check pk signed msg + +(* +$ tezos-client gen keys testsign + +$ tezos-client show address testsign -S +Hash: tz1RffmtWjy435AXZuWwLWG6UaJ66ERmgviA +Public Key: edpktz4xg6csJnJ5vcmMb2H37sWXyBDcoAp3XrBvjRaTSQ1zmZTeRQ +Secret Key: unencrypted:edsk34mH9qhMdVWtbammJfYkUoQfwW6Rw5K6rbGW1ajppy3LPNbiJA + +$ tezos-client hash data '"hello"' of type string +Raw packed data: 0x05010000000568656c6c6f +... + +$ tezos-client sign bytes 0x05010000000568656c6c6f for testsign +Signature: edsigtnzKd51CDomKVMFBoU8SzFZgNqRkYUaQH4DLUg8Lsimz98DFB82uiHAkdvx29DDqHxPf1noQ8noWpKMZoxTCsfprrbs4Xo +*) + +let example : bool = + Crypto.check + ("edpktz4xg6csJnJ5vcmMb2H37sWXyBDcoAp3XrBvjRaTSQ1zmZTeRQ" : key) + ("edsigtnzKd51CDomKVMFBoU8SzFZgNqRkYUaQH4DLUg8Lsimz98DFB82uiHAkdvx29DDqHxPf1noQ8noWpKMZoxTCsfprrbs4Xo" : signature) + 0x05010000000568656c6c6f diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index b8270e005..7f9369190 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -2090,6 +2090,7 @@ let check_signature_mligo () : unit result = e_bytes_string "hello world"] in let make_expected = e_bool true in let%bind () = expect_eq program "check_signature" make_input make_expected in + let%bind () = expect_eq_evaluate program "example" (e_bool true) in ok () let check_signature_religo () : unit result = From e66ddd78ba44c197668aab462173b3658f1724b7 Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Wed, 4 Mar 2020 19:39:06 +0100 Subject: [PATCH 12/40] Move to yarn --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 970db9fc9..d9c9a6ad5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,11 +62,11 @@ dont-merge-to-master: # copy .deb packages into website - find dist -name \*.deb -exec sh -c 'cp {} gitlab-pages/website/static/deb/ligo_$(basename $(dirname {})).deb' \; - # npm + # yarn - cd gitlab-pages/website - - npm install + - yarn install script: - - npm run build + - yarn build # move internal odoc documentation to the website folder - mv ../../_build/default/_doc/_html/ build/odoc after_script: From 7b5dd8de3b9a522ff976de9ae7759fef89d7d3eb Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Wed, 4 Mar 2020 21:39:57 +0100 Subject: [PATCH 13/40] Persistent syntax selection. --- gitlab-pages/website/src/theme/DocPage/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitlab-pages/website/src/theme/DocPage/index.js b/gitlab-pages/website/src/theme/DocPage/index.js index 5c2f21044..69d441f9d 100644 --- a/gitlab-pages/website/src/theme/DocPage/index.js +++ b/gitlab-pages/website/src/theme/DocPage/index.js @@ -59,7 +59,10 @@ function DocPage(props) { sidebar={sidebar} sidebarCollapsible={sidebarCollapsible} syntax={syntax} - onSyntaxChange={l => setSyntax(l)} + onSyntaxChange={l => { + localStorage.setItem('syntax', l); + setSyntax(l) + }} /> )} From 168a4d5b840f49a5211d81df3ede63f996fdcbff Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Thu, 5 Mar 2020 00:24:55 -0800 Subject: [PATCH 14/40] Add pledge-distribute contract --- src/test/contracts/pledge.religo | 38 ++++++++++++++ src/test/pledge_tests.ml | 88 ++++++++++++++++++++++++++++++++ src/test/test.ml | 1 + 3 files changed, 127 insertions(+) create mode 100644 src/test/contracts/pledge.religo create mode 100644 src/test/pledge_tests.ml diff --git a/src/test/contracts/pledge.religo b/src/test/contracts/pledge.religo new file mode 100644 index 000000000..394435397 --- /dev/null +++ b/src/test/contracts/pledge.religo @@ -0,0 +1,38 @@ +(* Pledge-Distribute — Accept money from a number of contributors and then donate + to an address designated by an oracle *) + +(* A lot of people (myself included) seem to expect an oracle to be more than it is. + That is, they expect it to be something complicated when it's actually pretty simple. + An oracle is just an authorized source of information external to the chain, like an + arbiter or moderator. For example, it's not possible to do an HTTP request to get + info from a weather site directly using a smart contract. So instead what you + do is make (or use) an oracle service which uploads the data to the chain so + that contracts can use it. +*) + +type storage = address + +type parameter = + | Donate(unit) + | Distribute((unit => list(operation))) + +let donate = ((p,s): (unit, storage)) : (list(operation), storage) => { + (([]: list(operation)), s); +}; + +let distribute = ((p,s): ((unit => list(operation)), storage)) : (list(operation), storage) => { + if (Tezos.sender == s) { + (p(),s); + } + else { + (failwith("You're not the oracle for this distribution."): + (list(operation), storage)); + }; +}; + +let main = ((p,s): (parameter, storage)) : (list(operation), storage) => { + switch (p) { + | Donate => donate (((),s)) + | Distribute msg => distribute ((msg,s)) + }; +}; diff --git a/src/test/pledge_tests.ml b/src/test/pledge_tests.ml new file mode 100644 index 000000000..189e45a82 --- /dev/null +++ b/src/test/pledge_tests.ml @@ -0,0 +1,88 @@ +open Trace +open Test_helpers +open Ast_simplified + + +let retype_file f = + let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "reasonligo") in + let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + ok (typed,state) + +let get_program = + let s = ref None in + fun () -> match !s with + | Some s -> ok s + | None -> ( + let%bind program = retype_file "./contracts/pledge.religo" in + s := Some program ; + ok program + ) + +let compile_main () = + let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/pledge.religo" (Syntax_name "reasonligo") in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in + let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in + let%bind (_contract: Tezos_utils.Michelson.michelson) = + (* fails if the given entry point is not a valid contract *) + Ligo.Compile.Of_michelson.build_contract michelson_prg in + ok () + +let (oracle_addr , oracle_contract) = + let open Proto_alpha_utils.Memory_proto_alpha in + let id = List.nth dummy_environment.identities 0 in + let kt = id.implicit_contract in + Protocol.Alpha_context.Contract.to_b58check kt , kt + +let (stranger_addr , stranger_contract) = + let open Proto_alpha_utils.Memory_proto_alpha in + let id = List.nth dummy_environment.identities 1 in + let kt = id.implicit_contract in + Protocol.Alpha_context.Contract.to_b58check kt , kt + +let empty_op_list = + (e_typed_list [] t_operation) +let empty_message = e_lambda (Var.of_name "arguments") + (Some t_unit) (Some (t_list t_operation)) + empty_op_list + + +let pledge () = + let%bind program, _ = get_program () in + let storage = e_address oracle_addr in + let parameter = e_unit () in + let options = Proto_alpha_utils.Memory_proto_alpha.make_options + ~sender:oracle_contract + ~amount:(Memory_proto_alpha.Protocol.Alpha_context.Tez.one) () + in + expect_eq ~options program "donate" + (e_pair parameter storage) + (e_pair (e_list []) storage) + +let distribute () = + let%bind program, _ = get_program () in + let storage = e_address oracle_addr in + let parameter = empty_message in + let options = Proto_alpha_utils.Memory_proto_alpha.make_options + ~sender:oracle_contract () + in + expect_eq ~options program "distribute" + (e_pair parameter storage) + (e_pair (e_list []) storage) + +let distribute_unauthorized () = + let%bind program, _ = get_program () in + let storage = e_address oracle_addr in + let parameter = empty_message in + let options = Proto_alpha_utils.Memory_proto_alpha.make_options + ~sender:stranger_contract () + in + expect_string_failwith ~options program "distribute" + (e_pair parameter storage) + "You're not the oracle for this distribution." + +let main = test_suite "Pledge & Distribute" [ + test "donate" pledge ; + test "distribute" distribute ; + test "distribute (unauthorized)" distribute_unauthorized ; +] diff --git a/src/test/test.ml b/src/test/test.ml index 617e1cf77..c21411092 100644 --- a/src/test/test.ml +++ b/src/test/test.ml @@ -17,5 +17,6 @@ let () = Time_lock_tests.main ; Hash_lock_tests.main ; Time_lock_repeat_tests.main ; + Pledge_tests.main ; ] ; () From 2a38375f6c7b8f0ac404769197bb9fdadc6efe47 Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Thu, 5 Mar 2020 09:35:32 +0100 Subject: [PATCH 15/40] Fix mobile homepage --- gitlab-pages/website/static/css/custom.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gitlab-pages/website/static/css/custom.css b/gitlab-pages/website/static/css/custom.css index e3f9eed8e..b779c2e69 100644 --- a/gitlab-pages/website/static/css/custom.css +++ b/gitlab-pages/website/static/css/custom.css @@ -582,7 +582,6 @@ a:hover { } #homePage #intro #preview { - min-width: 700px; min-height: 450px; max-width: 400px } @@ -896,6 +895,9 @@ a:hover { .nav-footer .sitemap { max-width: 1400px; } + #homePage #intro #preview { + min-width: 700px; + } } @media (min-width: 1500px) { @@ -919,7 +921,7 @@ a:hover { #homePage #intro #preview { order: 1; - width: 100%; + min-width: 100%; } #homePage #intro #preview .hljs { From acf3f9284e7a5a1660a0a0c9ec7fe6b05a91a1e3 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Thu, 5 Mar 2020 15:38:08 +0000 Subject: [PATCH 16/40] More gas for typechecking etc --- vendors/ligo-utils/proto-alpha-utils/init_proto_alpha.ml | 2 +- vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vendors/ligo-utils/proto-alpha-utils/init_proto_alpha.ml b/vendors/ligo-utils/proto-alpha-utils/init_proto_alpha.ml index 1e0a04566..da331b1e5 100644 --- a/vendors/ligo-utils/proto-alpha-utils/init_proto_alpha.ml +++ b/vendors/ligo-utils/proto-alpha-utils/init_proto_alpha.ml @@ -200,7 +200,7 @@ type environment = { let init_environment () = Context_init.main 10 >>=? fun (tezos_context, accounts, contracts) -> let accounts = List.map fst accounts in - let tezos_context = Alpha_context.Gas.set_limit tezos_context @@ Z.of_int 350000 in + let tezos_context = Alpha_context.Gas.set_limit tezos_context @@ Z.of_int 800000 in let identities = List.map (fun ((a:Context_init.account), c) -> { public_key = a.pk ; diff --git a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml index a8f5aa468..06b740983 100644 --- a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml +++ b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml @@ -1111,7 +1111,8 @@ type typecheck_res = let typecheck_contract contract = let contract' = Tezos_micheline.Micheline.strip_locations contract in - Script_ir_translator.typecheck_code dummy_environment.tezos_context contract' >>= fun x -> + let ctxt = Raw_context.set_gas_unlimited dummy_environment.tezos_context in + Script_ir_translator.typecheck_code ctxt contract' >>= fun x -> match x with | Ok _res -> return Type_checked | Error (Script_tc_errors.Ill_formed_type (Some "parameter", _code, _)::_) -> return Err_parameter From 1e77bd82c8a254da59f1bbbd290d6fe9775c50d3 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Thu, 5 Mar 2020 10:27:25 -0600 Subject: [PATCH 17/40] Revert "Use unlimited gas for typechecking contract" This reverts commit 97aad1c5ea65375d464a278495cb3dc696c28c70. --- vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml index 06b740983..a8f5aa468 100644 --- a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml +++ b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml @@ -1111,8 +1111,7 @@ type typecheck_res = let typecheck_contract contract = let contract' = Tezos_micheline.Micheline.strip_locations contract in - let ctxt = Raw_context.set_gas_unlimited dummy_environment.tezos_context in - Script_ir_translator.typecheck_code ctxt contract' >>= fun x -> + Script_ir_translator.typecheck_code dummy_environment.tezos_context contract' >>= fun x -> match x with | Ok _res -> return Type_checked | Error (Script_tc_errors.Ill_formed_type (Some "parameter", _code, _)::_) -> return Err_parameter From fe84d2120836786e61eaf0e8a1dde0495f5e570f Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Thu, 5 Mar 2020 10:27:34 -0600 Subject: [PATCH 18/40] Hack: don't log types in Michelson typecheck_code --- vendors/ligo-utils/tezos-protocol-alpha/script_ir_translator.ml | 2 -- 1 file changed, 2 deletions(-) diff --git a/vendors/ligo-utils/tezos-protocol-alpha/script_ir_translator.ml b/vendors/ligo-utils/tezos-protocol-alpha/script_ir_translator.ml index df884eb02..a369758f4 100644 --- a/vendors/ligo-utils/tezos-protocol-alpha/script_ir_translator.ml +++ b/vendors/ligo-utils/tezos-protocol-alpha/script_ir_translator.ml @@ -5325,8 +5325,6 @@ let typecheck_code : }) ctxt ~legacy - ~type_logger:(fun loc bef aft -> - type_map := (loc, (bef, aft)) :: !type_map) (arg_type_full, None) ret_type_full code_field From d10b95357fb817d4770d0fd983f5b45ec089ed66 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Thu, 5 Mar 2020 10:30:44 -0600 Subject: [PATCH 19/40] Detect gas exhaustion while typechecking --- src/main/compile/of_michelson.ml | 4 ++++ vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/main/compile/of_michelson.ml b/src/main/compile/of_michelson.ml index 87cfbb5a7..3602a495e 100644 --- a/src/main/compile/of_michelson.ml +++ b/src/main/compile/of_michelson.ml @@ -23,6 +23,9 @@ module Errors = struct let code = Format.asprintf "%a" Michelson.pp c in "bad contract type\n"^code in error title_type_check_msg message + let ran_out_of_gas () = + let message () = "Ran out of gas!" in + error title_type_check_msg message let unknown () = let message () = "unknown error" in @@ -47,6 +50,7 @@ let build_contract : Compiler.compiled_expression -> Michelson.michelson result | Err_parameter -> fail @@ Errors.bad_parameter contract () | Err_storage -> fail @@ Errors.bad_storage contract () | Err_contract -> fail @@ Errors.bad_contract contract () + | Err_gas -> fail @@ Errors.ran_out_of_gas () | Err_unknown -> fail @@ Errors.unknown () type check_type = Check_parameter | Check_storage diff --git a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml index a8f5aa468..d5d1b3ab7 100644 --- a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml +++ b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml @@ -1107,6 +1107,7 @@ let unparse_ty_michelson ty = type typecheck_res = | Type_checked | Err_parameter | Err_storage | Err_contract + | Err_gas | Err_unknown let typecheck_contract contract = @@ -1116,6 +1117,7 @@ let typecheck_contract contract = | Ok _res -> return Type_checked | Error (Script_tc_errors.Ill_formed_type (Some "parameter", _code, _)::_) -> return Err_parameter | Error (Script_tc_errors.Ill_formed_type (Some "storage", _code, _)::_) -> return Err_storage + | Error (Script_tc_errors.Ill_typed_contract _ :: Script_tc_errors.Cannot_serialize_error :: []) -> return @@ Err_gas | Error (Script_tc_errors.Ill_typed_contract (_code, _)::_) -> return @@ Err_contract | Error _ -> return Err_unknown From 9de04123d392a2573fbc3492f6e88ad733781457 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Thu, 5 Mar 2020 20:52:47 +0100 Subject: [PATCH 20/40] --balance option and updated tests --- src/bin/cli.ml | 46 +++++++++++-------- src/bin/expect_tests/help_tests.ml | 35 ++++++++++++-- src/main/run/of_michelson.ml | 6 ++- src/test/integration_tests.ml | 15 ++++-- .../proto-alpha-utils/x_memory_proto_alpha.ml | 8 ++++ .../tezos-protocol-alpha/alpha_context.ml | 2 + .../tezos-protocol-alpha/alpha_context.mli | 3 ++ .../tezos-protocol-alpha/contract_storage.ml | 2 + .../tezos-protocol-alpha/contract_storage.mli | 3 ++ 9 files changed, 92 insertions(+), 28 deletions(-) diff --git a/src/bin/cli.ml b/src/bin/cli.ml index f9b6321e5..1ad68d049 100644 --- a/src/bin/cli.ml +++ b/src/bin/cli.ml @@ -66,10 +66,18 @@ let amount = let open Arg in let info = let docv = "AMOUNT" in - let doc = "$(docv) is the amount the Michelson interpreter will use." in + let doc = "$(docv) is the amount the Michelson interpreter will use for the transaction." in info ~docv ~doc ["amount"] in value @@ opt string "0" info +let balance = + let open Arg in + let info = + let docv = "BALANCE" in + let doc = "$(docv) is the balance the Michelson interpreter will use for the contract balance." in + info ~docv ~doc ["balance"] in + value @@ opt string "0" info + let sender = let open Arg in let info = @@ -207,7 +215,7 @@ let measure_contract = (Term.ret term , Term.info ~doc cmdname) let compile_parameter = - let f source_file entry_point expression syntax amount sender source predecessor_timestamp display_format michelson_format = + let f source_file entry_point expression syntax amount balance sender source predecessor_timestamp display_format michelson_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in let%bind typed_prg,state = Compile.Of_simplified.compile simplified in @@ -225,18 +233,18 @@ let compile_parameter = let%bind compiled_param = Compile.Of_mini_c.aggregate_and_compile_expression mini_c_prg mini_c_param in let%bind () = Compile.Of_typed.assert_equal_contract_type Check_parameter entry_point typed_prg typed_param in let%bind () = Compile.Of_michelson.assert_equal_contract_type Check_parameter michelson_prg compiled_param in - let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; sender ; source } in + let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; balance ; sender ; source } in let%bind value = Run.evaluate_expression ~options compiled_param.expr compiled_param.expr_ty in ok @@ Format.asprintf "%a\n" (Main.Display.michelson_pp michelson_format) value in let term = - Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax $ amount $ sender $ source $ predecessor_timestamp $ display_format $ michelson_code_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax $ amount $ balance $ sender $ source $ predecessor_timestamp $ display_format $ michelson_code_format) in let cmdname = "compile-parameter" in let doc = "Subcommand: Compile parameters to a Michelson expression. The resulting Michelson expression can be passed as an argument in a transaction which calls a contract." in (Term.ret term , Term.info ~doc cmdname) let interpret = - let f expression init_file syntax amount sender source predecessor_timestamp display_format = + let f expression init_file syntax amount balance sender source predecessor_timestamp display_format = toplevel ~display_format @@ let%bind (decl_list,state,env) = match init_file with | Some init_file -> @@ -252,7 +260,7 @@ let interpret = let%bind (typed_exp,_) = Compile.Of_simplified.compile_expression ~env ~state simplified_exp in let%bind mini_c_exp = Compile.Of_typed.compile_expression typed_exp in let%bind compiled_exp = Compile.Of_mini_c.aggregate_and_compile_expression decl_list mini_c_exp in - let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; sender ; source } in + let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; balance ; sender ; source } in let%bind runres = Run.run_expression ~options compiled_exp.expr compiled_exp.expr_ty in match runres with | Fail fail_res -> @@ -263,7 +271,7 @@ let interpret = ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression simplified_output in let term = - Term.(const f $ expression "EXPRESSION" 0 $ init_file $ syntax $ amount $ sender $ source $ predecessor_timestamp $ display_format ) in + Term.(const f $ expression "EXPRESSION" 0 $ init_file $ syntax $ amount $ balance $ sender $ source $ predecessor_timestamp $ display_format ) in let cmdname = "interpret" in let doc = "Subcommand: Interpret the expression in the context initialized by the provided source file." in (Term.ret term , Term.info ~doc cmdname) @@ -283,7 +291,7 @@ let temp_ligo_interpreter = (Term.ret term , Term.info ~doc cmdname) let compile_storage = - let f source_file entry_point expression syntax amount sender source predecessor_timestamp display_format michelson_format = + let f source_file entry_point expression syntax amount balance sender source predecessor_timestamp display_format michelson_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in let%bind typed_prg,state = Compile.Of_simplified.compile simplified in @@ -301,18 +309,18 @@ let compile_storage = let%bind compiled_param = Compile.Of_mini_c.aggregate_and_compile_expression mini_c_prg mini_c_param in let%bind () = Compile.Of_typed.assert_equal_contract_type Check_storage entry_point typed_prg typed_param in let%bind () = Compile.Of_michelson.assert_equal_contract_type Check_storage michelson_prg compiled_param in - let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; sender ; source } in + let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; balance ; sender ; source } in let%bind value = Run.evaluate_expression ~options compiled_param.expr compiled_param.expr_ty in ok @@ Format.asprintf "%a\n" (Main.Display.michelson_pp michelson_format) value in let term = - Term.(const f $ source_file 0 $ entry_point 1 $ expression "STORAGE" 2 $ syntax $ amount $ sender $ source $ predecessor_timestamp $ display_format $ michelson_code_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "STORAGE" 2 $ syntax $ amount $ balance $ sender $ source $ predecessor_timestamp $ display_format $ michelson_code_format) in let cmdname = "compile-storage" in let doc = "Subcommand: Compile an initial storage in ligo syntax to a Michelson expression. The resulting Michelson expression can be passed as an argument in a transaction which originates a contract." in (Term.ret term , Term.info ~doc cmdname) let dry_run = - let f source_file entry_point storage input amount sender source predecessor_timestamp syntax display_format = + let f source_file entry_point storage input amount balance sender source predecessor_timestamp syntax display_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in let%bind typed_prg,state = Compile.Of_simplified.compile simplified in @@ -330,7 +338,7 @@ let dry_run = let%bind compiled_params = Compile.Of_mini_c.aggregate_and_compile_expression mini_c_prg mini_c in let%bind args_michelson = Run.evaluate_expression compiled_params.expr compiled_params.expr_ty in - let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; sender ; source } in + let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; balance ; sender ; source } in let%bind runres = Run.run_contract ~options michelson_prg.expr michelson_prg.expr_ty args_michelson in match runres with | Fail fail_res -> @@ -341,13 +349,13 @@ let dry_run = ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression simplified_output in let term = - Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ expression "STORAGE" 3 $ amount $ sender $ source $ predecessor_timestamp $ syntax $ display_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ expression "STORAGE" 3 $ amount $ balance $ sender $ source $ predecessor_timestamp $ syntax $ display_format) in let cmdname = "dry-run" in let doc = "Subcommand: Run a smart-contract with the given storage and input." in (Term.ret term , Term.info ~doc cmdname) let run_function = - let f source_file entry_point parameter amount sender source predecessor_timestamp syntax display_format = + let f source_file entry_point parameter amount balance sender source predecessor_timestamp syntax display_format = toplevel ~display_format @@ let%bind v_syntax = Helpers.syntax_to_variant (Syntax_name syntax) (Some source_file) in let%bind simplified_prg = Compile.Of_source.compile source_file (Syntax_name syntax) in @@ -362,7 +370,7 @@ let run_function = let%bind compiled_applied = Compile.Of_typed.compile_expression typed_app in let%bind michelson = Compile.Of_mini_c.aggregate_and_compile_expression mini_c_prg compiled_applied in - let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; sender ; source } in + let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; balance ; sender ; source } in let%bind runres = Run.run_expression ~options michelson.expr michelson.expr_ty in match runres with | Fail fail_res -> @@ -373,26 +381,26 @@ let run_function = ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression simplified_output in let term = - Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ amount $ sender $ source $ predecessor_timestamp $ syntax $ display_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ amount $ balance $ sender $ source $ predecessor_timestamp $ syntax $ display_format) in let cmdname = "run-function" in let doc = "Subcommand: Run a function with the given parameter." in (Term.ret term , Term.info ~doc cmdname) let evaluate_value = - let f source_file entry_point amount sender source predecessor_timestamp syntax display_format = + let f source_file entry_point amount balance sender source predecessor_timestamp syntax display_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in let%bind typed_prg,_ = Compile.Of_simplified.compile simplified in let%bind mini_c = Compile.Of_typed.compile typed_prg in let%bind (exp,_) = Mini_c.get_entry mini_c entry_point in let%bind compiled = Compile.Of_mini_c.aggregate_and_compile_expression mini_c exp in - let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; sender ; source } in + let%bind options = Run.make_dry_run_options {predecessor_timestamp ; amount ; balance ; sender ; source } in let%bind michelson_output = Run.run_no_failwith ~options compiled.expr compiled.expr_ty in let%bind simplified_output = Uncompile.uncompile_typed_program_entry_expression_result typed_prg entry_point michelson_output in ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression simplified_output in let term = - Term.(const f $ source_file 0 $ entry_point 1 $ amount $ sender $ source $ predecessor_timestamp $ syntax $ display_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ amount $ balance $ sender $ source $ predecessor_timestamp $ syntax $ display_format) in let cmdname = "evaluate-value" in let doc = "Subcommand: Evaluate a given definition." in (Term.ret term , Term.info ~doc cmdname) diff --git a/src/bin/expect_tests/help_tests.ml b/src/bin/expect_tests/help_tests.ml index bd5824881..f13b5c078 100644 --- a/src/bin/expect_tests/help_tests.ml +++ b/src/bin/expect_tests/help_tests.ml @@ -226,7 +226,12 @@ let%expect_test _ = OPTIONS --amount=AMOUNT (absent=0) - AMOUNT is the amount the Michelson interpreter will use. + AMOUNT is the amount the Michelson interpreter will use for the + transaction. + + --balance=BALANCE (absent=0) + BALANCE is the balance the Michelson interpreter will use for the + contract balance. --format=DISPLAY_FORMAT, --display-format=DISPLAY_FORMAT (absent=human-readable) @@ -292,7 +297,12 @@ let%expect_test _ = OPTIONS --amount=AMOUNT (absent=0) - AMOUNT is the amount the Michelson interpreter will use. + AMOUNT is the amount the Michelson interpreter will use for the + transaction. + + --balance=BALANCE (absent=0) + BALANCE is the balance the Michelson interpreter will use for the + contract balance. --format=DISPLAY_FORMAT, --display-format=DISPLAY_FORMAT (absent=human-readable) @@ -359,7 +369,12 @@ let%expect_test _ = OPTIONS --amount=AMOUNT (absent=0) - AMOUNT is the amount the Michelson interpreter will use. + AMOUNT is the amount the Michelson interpreter will use for the + transaction. + + --balance=BALANCE (absent=0) + BALANCE is the balance the Michelson interpreter will use for the + contract balance. --format=DISPLAY_FORMAT, --display-format=DISPLAY_FORMAT (absent=human-readable) @@ -418,7 +433,12 @@ let%expect_test _ = OPTIONS --amount=AMOUNT (absent=0) - AMOUNT is the amount the Michelson interpreter will use. + AMOUNT is the amount the Michelson interpreter will use for the + transaction. + + --balance=BALANCE (absent=0) + BALANCE is the balance the Michelson interpreter will use for the + contract balance. --format=DISPLAY_FORMAT, --display-format=DISPLAY_FORMAT (absent=human-readable) @@ -472,7 +492,12 @@ let%expect_test _ = OPTIONS --amount=AMOUNT (absent=0) - AMOUNT is the amount the Michelson interpreter will use. + AMOUNT is the amount the Michelson interpreter will use for the + transaction. + + --balance=BALANCE (absent=0) + BALANCE is the balance the Michelson interpreter will use for the + contract balance. --format=DISPLAY_FORMAT, --display-format=DISPLAY_FORMAT (absent=human-readable) diff --git a/src/main/run/of_michelson.ml b/src/main/run/of_michelson.ml index 6e8733e0e..02e884840 100644 --- a/src/main/run/of_michelson.ml +++ b/src/main/run/of_michelson.ml @@ -31,6 +31,7 @@ type run_res = type dry_run_options = { amount : string ; + balance : string ; predecessor_timestamp : string option ; sender : string option ; source : string option } @@ -47,6 +48,9 @@ let make_dry_run_options (opts : dry_run_options) : options result = let open Proto_alpha_utils.Trace in let open Proto_alpha_utils.Memory_proto_alpha in let open Protocol.Alpha_context in + let%bind balance = match Tez.of_string opts.balance with + | None -> simple_fail "invalid amount" + | Some balance -> ok balance in let%bind amount = match Tez.of_string opts.amount with | None -> simple_fail "invalid amount" | Some amount -> ok amount in @@ -75,7 +79,7 @@ let make_dry_run_options (opts : dry_run_options) : options result = match Memory_proto_alpha.Protocol.Alpha_context.Timestamp.of_notation st with | Some t -> ok (Some t) | None -> simple_fail ("\""^st^"\" is a bad timestamp notation") in - ok @@ make_options ?predecessor_timestamp:predecessor_timestamp ~amount ?sender ?source () + ok @@ make_options ?predecessor_timestamp:predecessor_timestamp ~amount ~balance ?sender ?source () let ex_value_ty_to_michelson (v : ex_typed_value) : Michelson.t result = let (Ex_typed_value (value , ty)) = v in diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 2ad0dfc8f..e6de67651 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -1786,24 +1786,33 @@ let religo_let_multiple () : unit result = in ok () + +let balance_test_options () = + let%bind balance = trace_option (simple_error "could not convert balance") @@ + Memory_proto_alpha.Protocol.Alpha_context.Tez.of_string "4000000" in + ok @@ Proto_alpha_utils.Memory_proto_alpha.make_options ~balance () + let balance_constant () : unit result = let%bind program = type_file "./contracts/balance_constant.ligo" in let input = e_tuple [e_unit () ; e_mutez 0] in let expected = e_tuple [e_list []; e_mutez 4000000000000] in - expect_eq program "main" input expected + let%bind options = balance_test_options () in + expect_eq ~options program "main" input expected let balance_constant_mligo () : unit result = let%bind program = mtype_file "./contracts/balance_constant.mligo" in let input = e_tuple [e_unit () ; e_mutez 0] in let expected = e_tuple [e_list []; e_mutez 4000000000000] in - expect_eq program "main" input expected + let%bind options = balance_test_options () in + expect_eq ~options program "main" input expected let balance_constant_religo () : unit result = let%bind program = retype_file "./contracts/balance_constant.religo" in let input = e_tuple [e_unit () ; e_mutez 0] in let expected = e_tuple [e_list []; e_mutez 4000000000000] in - expect_eq program "main" input expected + let%bind options = balance_test_options () in + expect_eq ~options program "main" input expected let amount () : unit result = let%bind program = type_file "./contracts/amount.ligo" in diff --git a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml index d5d1b3ab7..863d19a62 100644 --- a/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml +++ b/vendors/ligo-utils/proto-alpha-utils/x_memory_proto_alpha.ml @@ -1071,10 +1071,18 @@ let make_options ?(self = (List.nth dummy_environment.identities 0).implicit_contract) ?(source = (List.nth dummy_environment.identities 1).implicit_contract) ?(amount = Alpha_context.Tez.one) + ?(balance = Alpha_context.Tez.zero) ?(chain_id = Environment.Chain_id.zero) () = let tezos_context = { tezos_context with predecessor_timestamp } in + let tezos_context_error = + Trace.trace_alpha_tzresult_lwt (Trace.simple_error "lol") @@ + Alpha_context.Contract.set_balance tezos_context self balance + in + let tezos_context = match tezos_context_error with + | Ok (a,_) -> a + | Error _ -> tezos_context in { tezos_context ; (* yep *) diff --git a/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.ml b/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.ml index 5eaf19850..16ed177b8 100644 --- a/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.ml +++ b/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.ml @@ -158,8 +158,10 @@ module Contract = struct let init_origination_nonce = Raw_context.init_origination_nonce let unset_origination_nonce = Raw_context.unset_origination_nonce + let set_balance = Contract_storage.set_balance end + module Big_map = struct type id = Z.t diff --git a/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.mli b/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.mli index 17e32aa76..df38cd83e 100644 --- a/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.mli +++ b/vendors/ligo-utils/tezos-protocol-alpha/alpha_context.mli @@ -706,6 +706,9 @@ module Contract : sig include BASIC_DATA type contract = t + + val set_balance : context -> + contract -> Tez.t -> context tzresult Lwt.t val rpc_arg : contract RPC_arg.arg diff --git a/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.ml b/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.ml index c63a9f283..ddc913b4a 100644 --- a/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.ml +++ b/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.ml @@ -23,6 +23,8 @@ (* *) (*****************************************************************************) +let set_balance = Storage.Contract.Balance.set + type error += | Balance_too_low of Contract_repr.contract * Tez_repr.t * Tez_repr.t | (* `Temporary *) diff --git a/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.mli b/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.mli index 450b58ac1..e9277bb5d 100644 --- a/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.mli +++ b/vendors/ligo-utils/tezos-protocol-alpha/contract_storage.mli @@ -23,6 +23,9 @@ (* *) (*****************************************************************************) +val set_balance : Raw_context.t -> +Contract_repr.t -> Tez_repr.t -> Raw_context.t tzresult Lwt.t + type error += | Balance_too_low of Contract_repr.contract * Tez_repr.t * Tez_repr.t | (* `Temporary *) From 15b3dc02db431f7618548862f461e12c321609ba Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Thu, 5 Mar 2020 20:22:43 -0800 Subject: [PATCH 21/40] Improve LIGO intro page based on Sander's suggestions --- gitlab-pages/docs/intro/ligo-intro.md | 73 +++++++++++---------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/gitlab-pages/docs/intro/ligo-intro.md b/gitlab-pages/docs/intro/ligo-intro.md index d5eb5a9ac..09da92f2a 100644 --- a/gitlab-pages/docs/intro/ligo-intro.md +++ b/gitlab-pages/docs/intro/ligo-intro.md @@ -4,59 +4,46 @@ title: Introduction To LIGO --- LIGO is a programming language for writing [Tezos](https://tezos.com/) smart contracts. +Smart contracts are a unique domain with extreme resource constraints and even +more extreme security risks. Unlike desktop, mobile, or web +application development smart contracts cannot rely on cheap CPU time and memory. +All resources used by contracts are expensive, and tracked as 'gas costs'. Smart +contracts often directly control money or assets, which if stolen could rack up to +a large financial loss to the contracts controllers and users. Tezos smart contracts +live on the blockchain forever, if there's a bug in them they can't be patched or +amended. Naturally under these conditions it's not possible to develop smart contracts +the way we're used to developing user facing applications. -The LIGO philosophy can be described in a few bullet points: +LIGO is designed with these problems in mind. The design philosophy can be +described in a few bullet points: -1. Design a clean, simple language with no unnecessary parts. +1. Make a clean, simple language with no unnecessary parts. -2. Give that language multiple syntaxes borrowed from other languages. Ideally -LIGO requires the user to learn almost no new syntax. +2. Offer multiple familiar syntaxes so users can get up and running quickly. -3. Have that simple language encourage people to write simple code, so that it's -easy to formally verify the compiled output using a project like [Mi-Cho-Coq](https://gitlab.com/nomadic-labs/mi-cho-coq/). +3. Encourage people to write simple code, so that it's easy to formally verify the +compiled output using a project like [Mi-Cho-Coq](https://gitlab.com/nomadic-labs/mi-cho-coq/). -4. Stop waking up in the morning to find that your smart contract lost all its money -to some [stupid exploit](https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/). +4. Significantly reduce the risk that your smart contract will lose its balance to an [avoidable exploit](https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/). -The current trend in language design is more, more, more, so this might seem -counterintuitive. However most useful smart contracts can express their core -functionality in under a thousand lines of code. The problem domain -necessitates that you get as close as possible to the minimal code size and -resource use. LIGO is a functional language designed to include the features -you need, while avoiding patterns that make formal verification hard. +LIGO is a functional language designed to include the features you need, while +avoiding patterns that make formal verification hard. Most useful smart contracts +can express their core functionality in under a thousand lines of code. This makes +them a good target for formal methods, and what can't be easily proven can at least +be extensively tested. The simplicity of LIGO also keeps its compiled output +unbloated. Our hope is to have a simple, strongly typed language with a low footprint. -For example LIGO doesn't use an object oriented paradigm, currently code is -organized using functions. While LIGO plans to have a module system in the -future, we don't want programs to have thousands of dependencies. Once a -contract is put on the blockchain, it's not possible to change it. A new -version can be uploaded, but the original contract remains available. Contracts -tend to control money. In that environment it's not responsible to encourage -users to incorporate lots of code from strangers. The immutability of contracts -make formal verification of contract logic attractive. The eventual goal is -to make it easy to compile a LIGO contract to a format that can be loaded into -the [Coq proof assistant](https://coq.inria.fr/). +LIGO currently offers three syntaxes: -## LIGO for Programming Smart Contracts on Tezos + - **PascaLIGO**, a syntax inspired by Pascal which provides an + imperative developer experience. -Perhaps the most striking feature of LIGO is that it comes in -different concrete syntaxes, and even different programming -paradigms. In other words, LIGO is not defined by one syntax and one -paradigm, like imperative versus functional. + - **CameLIGO**, an [OCaml]((https://ocaml.org/)) inspired + syntax that allows you to write in a functional style. - - There is **PascaLIGO**, which is inspired by Pascal, hence is an - imperative language with lots of keywords, where values can be - locally mutated after they have been annotated with their types - (declaration). - - - There is **CameLIGO**, which is inspired by the pure subset of - [OCaml](https://ocaml.org/), hence is a functional language with - few keywords, where values cannot be mutated, but still require - type annotations (unlike OCaml, whose compiler performs almost - full type inference). - - - There is **ReasonLIGO**, which is inspired by the pure subset of - [ReasonML](https://reasonml.github.io/), which is based upon - OCaml. + - **ReasonLIGO**, an [ReasonML]((https://reasonml.github.io/)) inspired syntax + that builds on the strong points of OCaml. It aims to be familiar for those + coming from JavaScript. Let's define some LIGO contract in the three flavours above. Do not worry if it is a little confusing at first; we will explain all From 314b2358dbf3b03957941ef7533d33dfe4b442cd Mon Sep 17 00:00:00 2001 From: Maksym Bykovskyy Date: Fri, 6 Mar 2020 17:35:14 +0000 Subject: [PATCH 22/40] Revised README --- .gitlab-ci.yml | 23 +++++++++++-------- tools/webide/README.md | 19 +++++++++++---- tools/webide/packages/client/README.md | 13 ++++++++++- .../packages/client/package-examples.js | 12 +++++----- tools/webide/packages/server/README.md | 2 +- tools/webide/packages/server/package.json | 2 +- 6 files changed, 49 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d9c9a6ad5..cbb91c5d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ stages: - build_and_package_binaries - build_docker - build_and_deploy + - ide-unit-test - ide-build - ide-e2e-test - ide-deploy @@ -23,9 +24,8 @@ dont-merge-to-master: only: - master -.build_binary: - &build_binary # To run in sequence and save CPU usage, use stage: build_and_package_binaries - stage: test +.build_binary: &build_binary + stage: test # To run in sequence and save CPU usage, use stage: build_and_package_binaries script: - $build_binary_script "$target_os_family" "$target_os" "$target_os_version" - $package_binary_script "$target_os_family" "$target_os" "$target_os_version" @@ -213,15 +213,20 @@ pages-attempt: # WEBIDE jobs run-webide-unit-tests: - stage: test - image: node:12-alpine + stage: ide-unit-test + dependencies: + - build-and-package-debian-10 + image: node:12-buster script: + - mv $(realpath dist/package/debian-10/*.deb) ligo_deb10.deb + - apt-get update && apt-get -y install libev-dev perl pkg-config libgmp-dev libhidapi-dev m4 libcap-dev bubblewrap rsync + - dpkg -i ligo_deb10.deb - cd tools/webide/packages/server - npm ci - - npm run test + - export LIGO_CMD=/bin/ligo && npm run test rules: - changes: - - tools/webide/** + - tools/webide/** when: always build-publish-ide-image: @@ -245,7 +250,7 @@ build-publish-ide-image: - docker push "${WEBIDE_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}" rules: - changes: - - tools/webide/** + - tools/webide/** when: always - if: '$CI_COMMIT_REF_NAME == "dev"' when: always @@ -260,7 +265,7 @@ run-webide-e2e-tests: - docker-compose run e2e rules: - changes: - - tools/webide/** + - tools/webide/** when: always - if: '$CI_COMMIT_REF_NAME == "dev"' when: always diff --git a/tools/webide/README.md b/tools/webide/README.md index bf9724e1a..e61ec8b7c 100644 --- a/tools/webide/README.md +++ b/tools/webide/README.md @@ -1,12 +1,23 @@ # Quick Start -Install `yarn`. -Run `yarn` to install dependencies. +1. Install `yarn` +1. Run `yarn` to install dependencies +1. Install Ligo compiler by following [Ligo installation instructions][install-ligo] +1. Go to `packages/server/` directory +1. Run `yarn start` to start the development server +1. Open http://localhost:8080 + +# Dependency on Examples + +Examples that are displayed in the Web IDE are curated from `/src/test/examples` folder and packaged during the build of the client. To add a new example to the Web IDE, first add the example file to `/src/test/examples` folder; it may live under any level of subdirectories. Then, add the path to the example to the `CURATED_EXAMPLES` array in the `packages/client/package-examples.js` script. The path has to be relative to `/src/test/examples`. ## Server -See the README under the `packages/server/` for information about how to get started on the server development. +The server source code is located under `packages/server/`. Please see README under `packages/server/` for information about how to get started on the server development. ## Client -See the README under the `packages/client/` for information about how to get started on the client development. +The client source code is located under `packages/client/`. See the README under the `packages/client/` for information about how to get started on the client development. + + +[install-ligo]: https://ligolang.org/docs/intro/installation/ diff --git a/tools/webide/packages/client/README.md b/tools/webide/packages/client/README.md index 2fa78e71b..6716f58f3 100644 --- a/tools/webide/packages/client/README.md +++ b/tools/webide/packages/client/README.md @@ -1,4 +1,15 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +# Quick Start + +```sh +yarn start +open http://localhost:3000 +``` + +Note: Some features such as compiler commands and examples will be unavailable. In order to have these features you have to start the server. See README under `../packages/server` for details. + +# Dependency on Examples + +Examples that are displayed in the Web IDE are curated from `/src/test/examples` folder and packaged during the build of the client. To add a new example to the Web IDE, first add the example file to `/src/test/examples` folder; it may live under any level of subdirectories. Then, add the path to the example to the `CURATED_EXAMPLES` array in the `packages/client/package-examples.js` script. The path has to be relative to `/src/test/examples`. ## Available Scripts diff --git a/tools/webide/packages/client/package-examples.js b/tools/webide/packages/client/package-examples.js index 04146b7f4..b6e2be960 100644 --- a/tools/webide/packages/client/package-examples.js +++ b/tools/webide/packages/client/package-examples.js @@ -4,6 +4,12 @@ const join = require('path').join; const fs = require('fs'); const YAML = require('yamljs'); +const CURATED_EXAMPLES = [ + 'cameligo/arithmetic-contract.ligo', + 'pascaligo/arithmetic-contract.ligo', + 'reasonligo/arithmetic-contract.ligo' +]; + function urlFriendlyHash(content) { const hash = createHash('md5'); hash.update(content); @@ -103,12 +109,6 @@ async function main() { // const EXAMPLES_GLOB = '**/*.ligo'; // const files = await findFiles(EXAMPLES_GLOB, EXAMPLES_DIR); - const CURATED_EXAMPLES = [ - 'cameligo/arithmetic-contract.ligo', - 'pascaligo/arithmetic-contract.ligo', - 'reasonligo/arithmetic-contract.ligo' - ]; - const EXAMPLES_DEST_DIR = join(process.cwd(), 'build', 'static', 'examples'); fs.mkdirSync(EXAMPLES_DEST_DIR, { recursive: true }); diff --git a/tools/webide/packages/server/README.md b/tools/webide/packages/server/README.md index 8eca36b66..561108456 100644 --- a/tools/webide/packages/server/README.md +++ b/tools/webide/packages/server/README.md @@ -11,7 +11,7 @@ In the project directory, you can run: ## `yarn start` -Runs the server in development mode. This will also start the client. +Runs the server in development mode. This will also build and server the client. ## `yarn test` diff --git a/tools/webide/packages/server/package.json b/tools/webide/packages/server/package.json index 9a757c7a9..d5ceac898 100644 --- a/tools/webide/packages/server/package.json +++ b/tools/webide/packages/server/package.json @@ -7,7 +7,7 @@ "prestart": "cd ../client && npm run build", "start": "nodemon -r @ts-tools/node/r -r tsconfig-paths/register ./src/index.ts", "build": "tsc", - "test": "jest" + "test": "export DATA_DIR=/tmp && jest" }, "devDependencies": { "@ts-tools/node": "^1.0.0", From e61662af5fa81e157bbfe449cc8acbf2e0892927 Mon Sep 17 00:00:00 2001 From: Maksym Bykovskyy Date: Fri, 6 Mar 2020 20:59:56 +0000 Subject: [PATCH 23/40] Show storage after deploy --- tools/webide/packages/client/src/App.tsx | 2 +- .../{ => configure}/command-select.tsx | 2 +- .../{ => configure}/compile-pane.tsx | 8 +- .../{ => configure}/configure-tab.tsx | 16 +- .../{ => configure}/deploy-pane.tsx | 8 +- .../{ => configure}/dry-run-pane.tsx | 6 +- .../evaluate-function-pane.tsx | 6 +- .../{ => configure}/evaluate-value-pane.tsx | 6 +- .../{ => editor}/editable-title.tsx | 0 .../src/components/{ => editor}/editor.tsx | 6 +- .../src/components/{ => editor}/monaco.tsx | 6 +- .../components/{ => editor}/syntax-select.tsx | 8 +- .../src/components/{ => form}/checkbox.tsx | 0 .../src/components/{ => form}/inputs.tsx | 0 .../src/components/{ => form}/toggle.tsx | 0 .../client/src/components/output-tab.tsx | 194 ------------------ .../components/output/compile-output-pane.tsx | 73 +++++++ .../components/output/deploy-output-pane.tsx | 68 ++++++ .../client/src/components/output/loading.tsx | 81 ++++++++ .../src/components/output/output-pane.tsx | 37 ++++ .../src/components/output/output-tab.tsx | 58 ++++++ .../{ => output}/output-toolbar.tsx | 8 +- .../client/src/components/tabs-panel.tsx | 8 +- .../client/src/redux/actions/deploy.ts | 11 +- .../packages/server/src/handlers/deploy.ts | 4 +- 25 files changed, 374 insertions(+), 242 deletions(-) rename tools/webide/packages/client/src/components/{ => configure}/command-select.tsx (98%) rename tools/webide/packages/client/src/components/{ => configure}/compile-pane.tsx (86%) rename tools/webide/packages/client/src/components/{ => configure}/configure-tab.tsx (88%) rename tools/webide/packages/client/src/components/{ => configure}/deploy-pane.tsx (88%) rename tools/webide/packages/client/src/components/{ => configure}/dry-run-pane.tsx (90%) rename tools/webide/packages/client/src/components/{ => configure}/evaluate-function-pane.tsx (88%) rename tools/webide/packages/client/src/components/{ => configure}/evaluate-value-pane.tsx (79%) rename tools/webide/packages/client/src/components/{ => editor}/editable-title.tsx (100%) rename tools/webide/packages/client/src/components/{ => editor}/editor.tsx (90%) rename tools/webide/packages/client/src/components/{ => editor}/monaco.tsx (93%) rename tools/webide/packages/client/src/components/{ => editor}/syntax-select.tsx (94%) rename tools/webide/packages/client/src/components/{ => form}/checkbox.tsx (100%) rename tools/webide/packages/client/src/components/{ => form}/inputs.tsx (100%) rename tools/webide/packages/client/src/components/{ => form}/toggle.tsx (100%) delete mode 100644 tools/webide/packages/client/src/components/output-tab.tsx create mode 100644 tools/webide/packages/client/src/components/output/compile-output-pane.tsx create mode 100644 tools/webide/packages/client/src/components/output/deploy-output-pane.tsx create mode 100644 tools/webide/packages/client/src/components/output/loading.tsx create mode 100644 tools/webide/packages/client/src/components/output/output-pane.tsx create mode 100644 tools/webide/packages/client/src/components/output/output-tab.tsx rename tools/webide/packages/client/src/components/{ => output}/output-toolbar.tsx (88%) diff --git a/tools/webide/packages/client/src/App.tsx b/tools/webide/packages/client/src/App.tsx index ed379ef8e..e8ea7802e 100644 --- a/tools/webide/packages/client/src/App.tsx +++ b/tools/webide/packages/client/src/App.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import styled from 'styled-components'; -import { EditorComponent } from './components/editor'; +import { EditorComponent } from './components/editor/editor'; import { Examples } from './components/examples'; import { FloatButtonComponent } from './components/float-button'; import { HeaderComponent } from './components/header'; diff --git a/tools/webide/packages/client/src/components/command-select.tsx b/tools/webide/packages/client/src/components/configure/command-select.tsx similarity index 98% rename from tools/webide/packages/client/src/components/command-select.tsx rename to tools/webide/packages/client/src/components/configure/command-select.tsx index 767063858..43711dfd3 100644 --- a/tools/webide/packages/client/src/components/command-select.tsx +++ b/tools/webide/packages/client/src/components/configure/command-select.tsx @@ -4,7 +4,7 @@ import React, { useState } from 'react'; import OutsideClickHandler from 'react-outside-click-handler'; import styled, { css } from 'styled-components'; -import { Command } from '../redux/types'; +import { Command } from '../../redux/types'; const Container = styled.div` flex: 2; diff --git a/tools/webide/packages/client/src/components/compile-pane.tsx b/tools/webide/packages/client/src/components/configure/compile-pane.tsx similarity index 86% rename from tools/webide/packages/client/src/components/compile-pane.tsx rename to tools/webide/packages/client/src/components/configure/compile-pane.tsx index 31d05fd01..21fb4c3bc 100644 --- a/tools/webide/packages/client/src/components/compile-pane.tsx +++ b/tools/webide/packages/client/src/components/configure/compile-pane.tsx @@ -2,10 +2,10 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeEntrypointAction, ChangeMichelsonFormatAction, CompileState, MichelsonFormat } from '../redux/compile'; -import { CheckboxComponent } from './checkbox'; -import { Group, HGroup, Input, Label } from './inputs'; +import { AppState } from '../../redux/app'; +import { ChangeEntrypointAction, ChangeMichelsonFormatAction, CompileState, MichelsonFormat } from '../../redux/compile'; +import { CheckboxComponent } from '../form/checkbox'; +import { Group, HGroup, Input, Label } from '../form/inputs'; const Container = styled.div``; diff --git a/tools/webide/packages/client/src/components/configure-tab.tsx b/tools/webide/packages/client/src/components/configure/configure-tab.tsx similarity index 88% rename from tools/webide/packages/client/src/components/configure-tab.tsx rename to tools/webide/packages/client/src/components/configure/configure-tab.tsx index 160297861..1292cd09c 100644 --- a/tools/webide/packages/client/src/components/configure-tab.tsx +++ b/tools/webide/packages/client/src/components/configure/configure-tab.tsx @@ -2,14 +2,14 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled, { css } from 'styled-components'; -import { CompileAction } from '../redux/actions/compile'; -import { DeployAction } from '../redux/actions/deploy'; -import { DryRunAction } from '../redux/actions/dry-run'; -import { EvaluateFunctionAction } from '../redux/actions/evaluate-function'; -import { EvaluateValueAction } from '../redux/actions/evaluate-value'; -import { AppState } from '../redux/app'; -import { ChangeDispatchedAction, ChangeSelectedAction, CommandState } from '../redux/command'; -import { Command } from '../redux/types'; +import { CompileAction } from '../../redux/actions/compile'; +import { DeployAction } from '../../redux/actions/deploy'; +import { DryRunAction } from '../../redux/actions/dry-run'; +import { EvaluateFunctionAction } from '../../redux/actions/evaluate-function'; +import { EvaluateValueAction } from '../../redux/actions/evaluate-value'; +import { AppState } from '../../redux/app'; +import { ChangeDispatchedAction, ChangeSelectedAction, CommandState } from '../../redux/command'; +import { Command } from '../../redux/types'; import { CommandSelectComponent } from './command-select'; import { CompilePaneComponent } from './compile-pane'; import { DeployPaneComponent } from './deploy-pane'; diff --git a/tools/webide/packages/client/src/components/deploy-pane.tsx b/tools/webide/packages/client/src/components/configure/deploy-pane.tsx similarity index 88% rename from tools/webide/packages/client/src/components/deploy-pane.tsx rename to tools/webide/packages/client/src/components/configure/deploy-pane.tsx index 3dfc37153..0522fc3bc 100644 --- a/tools/webide/packages/client/src/components/deploy-pane.tsx +++ b/tools/webide/packages/client/src/components/configure/deploy-pane.tsx @@ -2,10 +2,10 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeEntrypointAction, ChangeStorageAction, DeployState, UseTezBridgeAction } from '../redux/deploy'; -import { CheckboxComponent } from './checkbox'; -import { Group, HGroup, Input, Label, Textarea } from './inputs'; +import { AppState } from '../../redux/app'; +import { ChangeEntrypointAction, ChangeStorageAction, DeployState, UseTezBridgeAction } from '../../redux/deploy'; +import { CheckboxComponent } from '../form/checkbox'; +import { Group, HGroup, Input, Label, Textarea } from '../form/inputs'; const Container = styled.div``; diff --git a/tools/webide/packages/client/src/components/dry-run-pane.tsx b/tools/webide/packages/client/src/components/configure/dry-run-pane.tsx similarity index 90% rename from tools/webide/packages/client/src/components/dry-run-pane.tsx rename to tools/webide/packages/client/src/components/configure/dry-run-pane.tsx index 45522127d..501f91972 100644 --- a/tools/webide/packages/client/src/components/dry-run-pane.tsx +++ b/tools/webide/packages/client/src/components/configure/dry-run-pane.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeEntrypointAction, ChangeParametersAction, ChangeStorageAction, DryRunState } from '../redux/dry-run'; -import { Group, Input, Label, Textarea } from './inputs'; +import { AppState } from '../../redux/app'; +import { ChangeEntrypointAction, ChangeParametersAction, ChangeStorageAction, DryRunState } from '../../redux/dry-run'; +import { Group, Input, Label, Textarea } from '../form/inputs'; const Container = styled.div``; diff --git a/tools/webide/packages/client/src/components/evaluate-function-pane.tsx b/tools/webide/packages/client/src/components/configure/evaluate-function-pane.tsx similarity index 88% rename from tools/webide/packages/client/src/components/evaluate-function-pane.tsx rename to tools/webide/packages/client/src/components/configure/evaluate-function-pane.tsx index fb467094f..d9fe87482 100644 --- a/tools/webide/packages/client/src/components/evaluate-function-pane.tsx +++ b/tools/webide/packages/client/src/components/configure/evaluate-function-pane.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeEntrypointAction, ChangeParametersAction, EvaluateFunctionState } from '../redux/evaluate-function'; -import { Group, Input, Label, Textarea } from './inputs'; +import { AppState } from '../../redux/app'; +import { ChangeEntrypointAction, ChangeParametersAction, EvaluateFunctionState } from '../../redux/evaluate-function'; +import { Group, Input, Label, Textarea } from '../form/inputs'; const Container = styled.div``; diff --git a/tools/webide/packages/client/src/components/evaluate-value-pane.tsx b/tools/webide/packages/client/src/components/configure/evaluate-value-pane.tsx similarity index 79% rename from tools/webide/packages/client/src/components/evaluate-value-pane.tsx rename to tools/webide/packages/client/src/components/configure/evaluate-value-pane.tsx index 9db29ec19..87e3a7f60 100644 --- a/tools/webide/packages/client/src/components/evaluate-value-pane.tsx +++ b/tools/webide/packages/client/src/components/configure/evaluate-value-pane.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeEntrypointAction, EvaluateValueState } from '../redux/evaluate-value'; -import { Group, Input, Label } from './inputs'; +import { AppState } from '../../redux/app'; +import { ChangeEntrypointAction, EvaluateValueState } from '../../redux/evaluate-value'; +import { Group, Input, Label } from '../form/inputs'; const Container = styled.div``; diff --git a/tools/webide/packages/client/src/components/editable-title.tsx b/tools/webide/packages/client/src/components/editor/editable-title.tsx similarity index 100% rename from tools/webide/packages/client/src/components/editable-title.tsx rename to tools/webide/packages/client/src/components/editor/editable-title.tsx diff --git a/tools/webide/packages/client/src/components/editor.tsx b/tools/webide/packages/client/src/components/editor/editor.tsx similarity index 90% rename from tools/webide/packages/client/src/components/editor.tsx rename to tools/webide/packages/client/src/components/editor/editor.tsx index d3d28b99a..f75009b07 100644 --- a/tools/webide/packages/client/src/components/editor.tsx +++ b/tools/webide/packages/client/src/components/editor/editor.tsx @@ -2,11 +2,11 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeTitleAction } from '../redux/editor'; +import { AppState } from '../../redux/app'; +import { ChangeTitleAction } from '../../redux/editor'; +import { ShareComponent } from '../share'; import { EditableTitleComponent } from './editable-title'; import { MonacoComponent } from './monaco'; -import { ShareComponent } from './share'; import { SyntaxSelectComponent } from './syntax-select'; const Container = styled.div` diff --git a/tools/webide/packages/client/src/components/monaco.tsx b/tools/webide/packages/client/src/components/editor/monaco.tsx similarity index 93% rename from tools/webide/packages/client/src/components/monaco.tsx rename to tools/webide/packages/client/src/components/editor/monaco.tsx index 7007cc832..e8f237500 100644 --- a/tools/webide/packages/client/src/components/monaco.tsx +++ b/tools/webide/packages/client/src/components/editor/monaco.tsx @@ -3,9 +3,9 @@ import React, { useEffect, useRef } from 'react'; import { useDispatch, useStore } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeCodeAction, ChangeDirtyAction } from '../redux/editor'; -import { ClearSelectedAction } from '../redux/examples'; +import { AppState } from '../../redux/app'; +import { ChangeCodeAction, ChangeDirtyAction } from '../../redux/editor'; +import { ClearSelectedAction } from '../../redux/examples'; const Container = styled.div` height: var(--content_height); diff --git a/tools/webide/packages/client/src/components/syntax-select.tsx b/tools/webide/packages/client/src/components/editor/syntax-select.tsx similarity index 94% rename from tools/webide/packages/client/src/components/syntax-select.tsx rename to tools/webide/packages/client/src/components/editor/syntax-select.tsx index d3fd4f794..dcb935e7e 100644 --- a/tools/webide/packages/client/src/components/syntax-select.tsx +++ b/tools/webide/packages/client/src/components/editor/syntax-select.tsx @@ -5,10 +5,10 @@ import OutsideClickHandler from 'react-outside-click-handler'; import { useDispatch, useSelector } from 'react-redux'; import styled, { css } from 'styled-components'; -import { AppState } from '../redux/app'; -import { ChangeLanguageAction, EditorState } from '../redux/editor'; -import { Language } from '../redux/types'; -import { Tooltip } from './tooltip'; +import { AppState } from '../../redux/app'; +import { ChangeLanguageAction, EditorState } from '../../redux/editor'; +import { Language } from '../../redux/types'; +import { Tooltip } from '../tooltip'; const Container = styled.div` display: flex; diff --git a/tools/webide/packages/client/src/components/checkbox.tsx b/tools/webide/packages/client/src/components/form/checkbox.tsx similarity index 100% rename from tools/webide/packages/client/src/components/checkbox.tsx rename to tools/webide/packages/client/src/components/form/checkbox.tsx diff --git a/tools/webide/packages/client/src/components/inputs.tsx b/tools/webide/packages/client/src/components/form/inputs.tsx similarity index 100% rename from tools/webide/packages/client/src/components/inputs.tsx rename to tools/webide/packages/client/src/components/form/inputs.tsx diff --git a/tools/webide/packages/client/src/components/toggle.tsx b/tools/webide/packages/client/src/components/form/toggle.tsx similarity index 100% rename from tools/webide/packages/client/src/components/toggle.tsx rename to tools/webide/packages/client/src/components/form/toggle.tsx diff --git a/tools/webide/packages/client/src/components/output-tab.tsx b/tools/webide/packages/client/src/components/output-tab.tsx deleted file mode 100644 index 147942910..000000000 --- a/tools/webide/packages/client/src/components/output-tab.tsx +++ /dev/null @@ -1,194 +0,0 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; -import { PushSpinner } from 'react-spinners-kit'; -import styled, { css } from 'styled-components'; - -import { AppState } from '../redux/app'; -import { CommandState } from '../redux/command'; -import { DoneLoadingAction, LoadingState } from '../redux/loading'; -import { ResultState } from '../redux/result'; -import { Command } from '../redux/types'; -import { OutputToolbarComponent } from './output-toolbar'; - -const Container = styled.div<{ visible?: boolean }>` - position: absolute; - box-sizing: border-box; - width: 100%; - height: 100%; - - font-family: Menlo, Monaco, 'Courier New', monospace; - display: flex; - flex-direction: column; - - transform: translateX(100%); - transition: transform 0.2s ease-in; - - ${props => - props.visible && - css` - transform: translateX(0px); - `} -`; - -const CancelButton = styled.div` - display: flex; - justify-content: center; - align-items: center; - color: white; - background-color: #fc683a; - cursor: pointer; - user-select: none; - margin: 1em; - padding: 0.5em 1em; -`; - -const Output = styled.div` - flex: 1; - padding: 0.5em; - display: flex; - overflow: scroll; - /* This font size is used to calcuate spinner size */ - font-size: 1em; -`; - -const LoadingContainer = styled.div` - flex: 1; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -`; - -const LoadingMessage = styled.div` - padding: 1em 0; -`; - -const Pre = styled.pre` - margin: 0; -`; - -function copyOutput(el: HTMLElement | null) { - if (el) { - const range = document.createRange(); - range.selectNodeContents(el); - - const selection = window.getSelection(); - - if (selection) { - selection.removeAllRanges(); - selection.addRange(range); - document.execCommand('copy'); - } - } -} - -function downloadOutput(output: string) { - const anchor = document.createElement('a'); - anchor.setAttribute( - 'href', - `data:text/plain;charset=utf-8,${encodeURIComponent(output)}` - ); - anchor.setAttribute('download', 'output.txt'); - - anchor.style.display = 'none'; - document.body.appendChild(anchor); - anchor.click(); - document.body.removeChild(anchor); -} - -export const OutputTabComponent = (props: { - selected?: boolean; - onCancel?: () => void; -}) => { - const output = useSelector( - state => state.result.output - ); - const contract = useSelector( - state => state.result.contract - ); - const command = useSelector( - state => state.result.command - ); - - const loading = useSelector(state => state.loading); - - const dispatchedAction = useSelector< - AppState, - CommandState['dispatchedAction'] - >(state => state.command.dispatchedAction); - - const dispatch = useDispatch(); - - const outputRef = useRef(null); - const preRef = useRef(null); - const [spinnerSize, setSpinnerSize] = useState(50); - - useEffect(() => { - const outputEl = (outputRef.current as unknown) as HTMLElement; - const fontSize = window - .getComputedStyle(outputEl, null) - .getPropertyValue('font-size'); - - setSpinnerSize(parseFloat(fontSize) * 3); - }, [setSpinnerSize]); - - return ( - - {!( - loading.loading || - output.length === 0 || - command !== Command.Compile - ) && ( - copyOutput(preRef.current)} - onDownload={() => downloadOutput(output)} - > - )} - - {loading.loading && ( - - - {loading.message} - { - if (dispatchedAction) { - dispatchedAction.cancel(); - } - - dispatch({ ...new DoneLoadingAction() }); - - if (props.onCancel) { - props.onCancel(); - } - }} - > - Cancel - - - )} - {!loading.loading && - ((output.length !== 0 &&
{output}
) || - (contract.length !== 0 && ( - - The contract was successfully deployed to the babylonnet test - network. -
-
- The address of your new contract is: {contract} -
-
- View your new contract using{' '} - - Better Call Dev - - ! -
- )))} -
-
- ); -}; diff --git a/tools/webide/packages/client/src/components/output/compile-output-pane.tsx b/tools/webide/packages/client/src/components/output/compile-output-pane.tsx new file mode 100644 index 000000000..110f9f54e --- /dev/null +++ b/tools/webide/packages/client/src/components/output/compile-output-pane.tsx @@ -0,0 +1,73 @@ +import React, { useRef } from 'react'; +import { useSelector } from 'react-redux'; +import styled from 'styled-components'; + +import { AppState } from '../../redux/app'; +import { ResultState } from '../../redux/result'; +import { OutputToolbarComponent } from './output-toolbar'; + +const Container = styled.div<{ visible?: boolean }>` + display: flex; + flex-direction: column; + height: 100%; +`; + +const Output = styled.div` + flex: 1; + padding: 0.5em; + display: flex; + overflow: scroll; +`; + +const Pre = styled.pre` + margin: 0; +`; + +function copyOutput(el: HTMLElement | null) { + if (el) { + const range = document.createRange(); + range.selectNodeContents(el); + + const selection = window.getSelection(); + + if (selection) { + selection.removeAllRanges(); + selection.addRange(range); + document.execCommand('copy'); + } + } +} + +function downloadOutput(output: string) { + const anchor = document.createElement('a'); + anchor.setAttribute( + 'href', + `data:text/plain;charset=utf-8,${encodeURIComponent(output)}` + ); + anchor.setAttribute('download', 'output.txt'); + + anchor.style.display = 'none'; + document.body.appendChild(anchor); + anchor.click(); + document.body.removeChild(anchor); +} + +export const CompileOutputPane = () => { + const output = useSelector( + state => state.result.output + ); + + const preRef = useRef(null); + + return ( + + copyOutput(preRef.current)} + onDownload={() => downloadOutput(output)} + > + +
{output}
+
+
+ ); +}; diff --git a/tools/webide/packages/client/src/components/output/deploy-output-pane.tsx b/tools/webide/packages/client/src/components/output/deploy-output-pane.tsx new file mode 100644 index 000000000..ca3271484 --- /dev/null +++ b/tools/webide/packages/client/src/components/output/deploy-output-pane.tsx @@ -0,0 +1,68 @@ +import React from 'react'; +import { useSelector } from 'react-redux'; +import styled from 'styled-components'; + +import { AppState } from '../../redux/app'; +import { ResultState } from '../../redux/result'; + +const Container = styled.div<{ visible?: boolean }>` + display: flex; + flex-direction: column; + height: 100%; +`; + +const Output = styled.div` + flex: 1; + padding: 0.5em 0.5em 0 0.5em; + display: flex; + flex-direction: column; + overflow: auto; +`; + +const Pre = styled.pre` + padding: 0.5em; + margin: 0 -0.5em; + overflow: scroll; + height: 100%; +`; + +export const DeployOutputPane = () => { + const output = useSelector( + state => state.result.output + ); + const contract = useSelector( + state => state.result.contract + ); + + return ( + + + {contract && ( +
+ The contract was successfully deployed to the babylonnet test + network. +
+
+ View your new contract using{' '} + + Better Call Dev + + ! +
+
+ The address of your new contract is: + {contract} +
+
+ The initial storage of your contract is: +
+ )} + {output &&
{output}
} +
+
+ ); +}; diff --git a/tools/webide/packages/client/src/components/output/loading.tsx b/tools/webide/packages/client/src/components/output/loading.tsx new file mode 100644 index 000000000..ebab1a73d --- /dev/null +++ b/tools/webide/packages/client/src/components/output/loading.tsx @@ -0,0 +1,81 @@ +import React, { useEffect, useRef, useState } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { PushSpinner } from 'react-spinners-kit'; +import styled from 'styled-components'; + +import { AppState } from '../../redux/app'; +import { CommandState } from '../../redux/command'; +import { DoneLoadingAction, LoadingState } from '../../redux/loading'; + +const Container = styled.div` + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + /* This font size is used to calcuate spinner size */ + font-size: 1em; +`; + +const Cancel = styled.div` + display: flex; + justify-content: center; + align-items: center; + color: white; + background-color: #fc683a; + cursor: pointer; + user-select: none; + margin: 1em; + padding: 0.5em 1em; +`; + +const Message = styled.div` + padding: 1em 0; +`; + +export const Loading = (props: { onCancel?: () => void }) => { + const loading = useSelector(state => state.loading); + + const dispatchedAction = useSelector< + AppState, + CommandState['dispatchedAction'] + >(state => state.command.dispatchedAction); + + const dispatch = useDispatch(); + + const containerRef = useRef(null); + + const [spinnerSize, setSpinnerSize] = useState(50); + + useEffect(() => { + const el = (containerRef.current as unknown) as HTMLElement; + const fontSize = window + .getComputedStyle(el, null) + .getPropertyValue('font-size'); + + setSpinnerSize(parseFloat(fontSize) * 3); + }, [setSpinnerSize]); + + return ( + + + {loading.message} + { + if (dispatchedAction) { + dispatchedAction.cancel(); + } + + dispatch({ ...new DoneLoadingAction() }); + + if (props.onCancel) { + props.onCancel(); + } + }} + > + Cancel + + + ); +}; diff --git a/tools/webide/packages/client/src/components/output/output-pane.tsx b/tools/webide/packages/client/src/components/output/output-pane.tsx new file mode 100644 index 000000000..d0fee8b92 --- /dev/null +++ b/tools/webide/packages/client/src/components/output/output-pane.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { useSelector } from 'react-redux'; +import styled from 'styled-components'; + +import { AppState } from '../../redux/app'; +import { ResultState } from '../../redux/result'; + +const Container = styled.div<{ visible?: boolean }>` + display: flex; + flex-direction: column; + flex: 1; +`; + +const Output = styled.div` + flex: 1; + padding: 0.5em; + display: flex; + overflow: scroll; +`; + +const Pre = styled.pre` + margin: 0; +`; + +export const OutputPane = () => { + const output = useSelector( + state => state.result.output + ); + + return ( + + +
{output}
+
+
+ ); +}; diff --git a/tools/webide/packages/client/src/components/output/output-tab.tsx b/tools/webide/packages/client/src/components/output/output-tab.tsx new file mode 100644 index 000000000..1f838aabf --- /dev/null +++ b/tools/webide/packages/client/src/components/output/output-tab.tsx @@ -0,0 +1,58 @@ +import React from 'react'; +import { useSelector } from 'react-redux'; +import styled, { css } from 'styled-components'; + +import { AppState } from '../../redux/app'; +import { LoadingState } from '../../redux/loading'; +import { ResultState } from '../../redux/result'; +import { Command } from '../../redux/types'; +import { CompileOutputPane } from './compile-output-pane'; +import { DeployOutputPane } from './deploy-output-pane'; +import { Loading } from './loading'; +import { OutputPane } from './output-pane'; + +const Container = styled.div<{ visible?: boolean }>` + position: absolute; + box-sizing: border-box; + width: 100%; + height: 100%; + + font-family: Menlo, Monaco, 'Courier New', monospace; + display: flex; + flex-direction: column; + + transform: translateX(100%); + transition: transform 0.2s ease-in; + + ${props => + props.visible && + css` + transform: translateX(0px); + `} +`; + +export const OutputTab = (props: { + selected?: boolean; + onCancel?: () => void; +}) => { + const command = useSelector( + state => state.result.command + ); + const loading = useSelector( + state => state.loading.loading + ); + + const renderResult = () => { + if (loading) { + return ; + } else if (command === Command.Compile) { + return ; + } else if (command === Command.Deploy) { + return ; + } + + return ; + }; + + return {renderResult()}; +}; diff --git a/tools/webide/packages/client/src/components/output-toolbar.tsx b/tools/webide/packages/client/src/components/output/output-toolbar.tsx similarity index 88% rename from tools/webide/packages/client/src/components/output-toolbar.tsx rename to tools/webide/packages/client/src/components/output/output-toolbar.tsx index 871dcb873..0606b8d7a 100644 --- a/tools/webide/packages/client/src/components/output-toolbar.tsx +++ b/tools/webide/packages/client/src/components/output/output-toolbar.tsx @@ -4,10 +4,10 @@ import React from 'react'; import { useSelector } from 'react-redux'; import styled from 'styled-components'; -import { AppState } from '../redux/app'; -import { ResultState } from '../redux/result'; -import { Item, Toolbar } from './toolbar'; -import { Tooltip } from './tooltip'; +import { AppState } from '../../redux/app'; +import { ResultState } from '../../redux/result'; +import { Item, Toolbar } from '../toolbar'; +import { Tooltip } from '../tooltip'; const Divider = styled.div` display: block; diff --git a/tools/webide/packages/client/src/components/tabs-panel.tsx b/tools/webide/packages/client/src/components/tabs-panel.tsx index 8714dd9bf..2bc26fdc3 100644 --- a/tools/webide/packages/client/src/components/tabs-panel.tsx +++ b/tools/webide/packages/client/src/components/tabs-panel.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; import styled, { css } from 'styled-components'; -import { ConfigureTabComponent } from './configure-tab'; -import { OutputTabComponent } from './output-tab'; +import { ConfigureTabComponent } from './configure/configure-tab'; +import { OutputTab } from './output/output-tab'; const Container = styled.div` flex: 1; @@ -86,12 +86,12 @@ export const TabsPanelComponent = () => { selectTab(TABS[1]); }} > - { selectTab(TABS[0]); }} - > + > ); diff --git a/tools/webide/packages/client/src/redux/actions/deploy.ts b/tools/webide/packages/client/src/redux/actions/deploy.ts index 5fc9dcf1d..00864e090 100644 --- a/tools/webide/packages/client/src/redux/actions/deploy.ts +++ b/tools/webide/packages/client/src/redux/actions/deploy.ts @@ -57,7 +57,10 @@ export class DeployAction extends CancellableAction { } dispatch({ ...new UpdateLoadingAction('Deploying to babylon network...') }); - return await op.contract(); + return { + address: (await op.contract()).address, + storage: michelsonStorage + }; } async deployOnServerSide(dispatch: Dispatch, getState: () => AppState) { @@ -89,10 +92,16 @@ export class DeployAction extends CancellableAction { dispatch({ ...new ChangeContractAction(contract.address, Command.Deploy) }); + dispatch({ + ...new ChangeOutputAction(contract.storage, Command.Deploy) + }); } catch (ex) { if (this.isCancelled()) { return; } + dispatch({ + ...new ChangeContractAction('', Command.Deploy) + }); dispatch({ ...new ChangeOutputAction( `Error: ${getErrorMessage(ex)}`, diff --git a/tools/webide/packages/server/src/handlers/deploy.ts b/tools/webide/packages/server/src/handlers/deploy.ts index 2d24dfd3e..9e681fad4 100644 --- a/tools/webide/packages/server/src/handlers/deploy.ts +++ b/tools/webide/packages/server/src/handlers/deploy.ts @@ -57,13 +57,13 @@ export async function deployHandler(req: Request, res: Response) { const contract = await op.contract(); - res.send({ ...contract }); + res.send({ address: contract.address, storage: michelsonStorage }); } catch (ex) { if (ex instanceof CompilerError) { res.status(400).json({ error: ex.message }); } else { logger.error(ex); - res.sendStatus(500); + res.status(500).json({ error: ex.message }); } } } From 3317e8462e8034085b853bef2e5bdb1d56f6f4b8 Mon Sep 17 00:00:00 2001 From: Maksym Bykovskyy Date: Fri, 6 Mar 2020 13:58:50 -0800 Subject: [PATCH 24/40] Upgraded taquito and using carthage network --- tools/webide/packages/client/package.json | 4 +- .../components/output/deploy-output-pane.tsx | 5 +- .../client/src/redux/actions/deploy.ts | 10 ++- tools/webide/packages/e2e/test/deploy.spec.js | 2 +- tools/webide/packages/server/package.json | 2 +- .../packages/server/src/handlers/deploy.ts | 2 +- .../packages/server/src/services/key.ts | 10 +-- tools/webide/yarn.lock | 87 +++++++++---------- 8 files changed, 61 insertions(+), 61 deletions(-) diff --git a/tools/webide/packages/client/package.json b/tools/webide/packages/client/package.json index 457ee3139..53012c75e 100644 --- a/tools/webide/packages/client/package.json +++ b/tools/webide/packages/client/package.json @@ -6,8 +6,8 @@ "@fortawesome/fontawesome-svg-core": "^1.2.25", "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.6", - "@taquito/taquito": "^5.1.0-beta.1", - "@taquito/tezbridge-signer": "^5.1.0-beta.1", + "@taquito/taquito": "^6.1.0-beta.0", + "@taquito/tezbridge-signer": "^6.1.0-beta.0", "@types/jest": "24.0.18", "@types/node": "12.7.12", "@types/react": "16.9.5", diff --git a/tools/webide/packages/client/src/components/output/deploy-output-pane.tsx b/tools/webide/packages/client/src/components/output/deploy-output-pane.tsx index ca3271484..42a28f5fa 100644 --- a/tools/webide/packages/client/src/components/output/deploy-output-pane.tsx +++ b/tools/webide/packages/client/src/components/output/deploy-output-pane.tsx @@ -39,15 +39,14 @@ export const DeployOutputPane = () => { {contract && (
- The contract was successfully deployed to the babylonnet test - network. + The contract was successfully deployed to the carthage test network.

View your new contract using{' '} Better Call Dev diff --git a/tools/webide/packages/client/src/redux/actions/deploy.ts b/tools/webide/packages/client/src/redux/actions/deploy.ts index 00864e090..77977b04d 100644 --- a/tools/webide/packages/client/src/redux/actions/deploy.ts +++ b/tools/webide/packages/client/src/redux/actions/deploy.ts @@ -11,7 +11,7 @@ import { Command } from '../types'; import { CancellableAction } from './cancellable'; Tezos.setProvider({ - rpc: 'https://api.tez.ie/rpc/babylonnet', + rpc: 'https://api.tez.ie/rpc/carthagenet', signer: new TezBridgeSigner() }); @@ -56,7 +56,9 @@ export class DeployAction extends CancellableAction { return; } - dispatch({ ...new UpdateLoadingAction('Deploying to babylon network...') }); + dispatch({ + ...new UpdateLoadingAction('Deploying to carthage network...') + }); return { address: (await op.contract()).address, storage: michelsonStorage @@ -64,7 +66,9 @@ export class DeployAction extends CancellableAction { } async deployOnServerSide(dispatch: Dispatch, getState: () => AppState) { - dispatch({ ...new UpdateLoadingAction('Deploying to babylon network...') }); + dispatch({ + ...new UpdateLoadingAction('Deploying to carthage network...') + }); const { editor: editorState, deploy: deployState } = getState(); diff --git a/tools/webide/packages/e2e/test/deploy.spec.js b/tools/webide/packages/e2e/test/deploy.spec.js index ba0424565..958774cae 100644 --- a/tools/webide/packages/e2e/test/deploy.spec.js +++ b/tools/webide/packages/e2e/test/deploy.spec.js @@ -18,7 +18,7 @@ describe('Deploy contract', () => { beforeEach(async () => await page.goto(API_HOST)); it('should deploy', async done => { - expect(await deploy()).toContain('The contract was successfully deployed to the babylonnet test network.'); + expect(await deploy()).toContain('The contract was successfully deployed to the carthage test network.'); done(); }); diff --git a/tools/webide/packages/server/package.json b/tools/webide/packages/server/package.json index d5ceac898..a797ff061 100644 --- a/tools/webide/packages/server/package.json +++ b/tools/webide/packages/server/package.json @@ -31,7 +31,7 @@ "dependencies": { "@google-cloud/storage": "^4.0.0", "@hapi/joi": "^16.1.7", - "@taquito/taquito": "^5.1.0-beta.1", + "@taquito/taquito": "^6.1.0-beta.0", "@types/node-fetch": "^2.5.4", "body-parser": "^1.19.0", "escape-html": "^1.0.3", diff --git a/tools/webide/packages/server/src/handlers/deploy.ts b/tools/webide/packages/server/src/handlers/deploy.ts index 9e681fad4..6409c0da6 100644 --- a/tools/webide/packages/server/src/handlers/deploy.ts +++ b/tools/webide/packages/server/src/handlers/deploy.ts @@ -13,7 +13,7 @@ interface DeployBody { storage: string; } -Tezos.setProvider({ rpc: 'https://api.tez.ie/rpc/babylonnet' }); +Tezos.setProvider({ rpc: 'https://api.tez.ie/rpc/carthagenet' }); const validateRequest = (body: any): { value: DeployBody; error: any } => { return joi diff --git a/tools/webide/packages/server/src/services/key.ts b/tools/webide/packages/server/src/services/key.ts index 5c8bac9df..13ecf1c86 100644 --- a/tools/webide/packages/server/src/services/key.ts +++ b/tools/webide/packages/server/src/services/key.ts @@ -1,13 +1,13 @@ import fetch from 'node-fetch'; -const URL = 'https://api.tez.ie/keys/babylonnet/'; +const URL = 'https://api.tez.ie/keys/carthagenet/'; const AUTHORIZATION_HEADER = 'Bearer ligo-ide'; export async function fetchRandomPrivateKey(): Promise { const response = await fetch(URL, { - method: 'POST', - headers: { 'Authorization': AUTHORIZATION_HEADER } - }); + method: 'POST', + headers: { Authorization: AUTHORIZATION_HEADER } + }); - return response.text(); + return response.text(); } diff --git a/tools/webide/yarn.lock b/tools/webide/yarn.lock index 19fb7dc8c..9bc7ff8c1 100644 --- a/tools/webide/yarn.lock +++ b/tools/webide/yarn.lock @@ -1343,44 +1343,37 @@ "@svgr/plugin-svgo" "^4.3.1" loader-utils "^1.2.3" -"@taquito/http-utils@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/http-utils/-/http-utils-5.1.0-beta.1.tgz#283b89eeae13c78c54657bccef15f1b3242326a0" - integrity sha512-/UvE61t9j5CR94vy8Dtb+/6oJERE0P9LmHBbkESKUxNC9SAlETCEntSNiHha+vuwgCoOj0pXsHkBtAZkWAaEeg== +"@taquito/http-utils@^6.1.0-beta.0": + version "6.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@taquito/http-utils/-/http-utils-6.1.0-beta.0.tgz#9d7eb1e41962e3d6aefbb89840e496753407fef6" + integrity sha512-qQg/siOh3Vrj4lYbRGuHXKLgd8Or/5upJ2LgP8Y+i6X0n/uBsE6lnwGD8JCHWt644tvhEuf53j7DJI13blLaKg== dependencies: xhr2-cookies "^1.1.0" -"@taquito/indexer@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/indexer/-/indexer-5.1.0-beta.1.tgz#62595d2b4758ad541dc54906896131ddf8ee9c59" - integrity sha512-NDWK7XQGgUP0YkEWhJklF9uhKHZDWtRaAPSsSfxSDYiQzol4iAUn7ru7+TQPNqfsXq0NjpvzGHBysQ8HTeb0Gg== +"@taquito/michelson-encoder@^6.1.0-beta.0": + version "6.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@taquito/michelson-encoder/-/michelson-encoder-6.1.0-beta.0.tgz#8f8d143a69814723550776dfe9c024a2196cbb57" + integrity sha512-02CHk0Ag7pBLCDIJnAKXPp4Owcl3qLkIKB8pQa5uOT1fxefaT2EadMnxQEpbXPiFp4tcBRJq16Bd4JtogO+/CQ== dependencies: - "@taquito/http-utils" "^5.1.0-beta.1" + "@taquito/utils" "^6.1.0-beta.0" bignumber.js "^9.0.0" + fast-json-stable-stringify "^2.1.0" -"@taquito/michelson-encoder@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/michelson-encoder/-/michelson-encoder-5.1.0-beta.1.tgz#38620820d377f908ea6fc6d4136fa08247702656" - integrity sha512-kBpHDfsvsxzsIXbM4dOZs0nklY7CjCunSJ2sABUdBu4SmXDM06F5NDzg0166q7VBhFZgOhq/NNM9g7hcgn5qJg== +"@taquito/rpc@^6.1.0-beta.0": + version "6.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@taquito/rpc/-/rpc-6.1.0-beta.0.tgz#e3247607a578f778f5168a356567dc86c0a3b809" + integrity sha512-umpiFpasPIVNuRUkrlOi2Z3tOHQ1p6MU0AI3xRUdoUf2Hhn7tWN1CsFzQzm87LekVz1kW7Dogkwc5hD4gsIPZg== dependencies: - "@taquito/utils" "^5.1.0-beta.1" - bignumber.js "^9.0.0" - -"@taquito/rpc@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/rpc/-/rpc-5.1.0-beta.1.tgz#6e6aa3ca57a9e5d5811f7bb16ce3a1e9fd8a87e3" - integrity sha512-ZbqpJVZw1ljAS92Xs9t/1BAgPEMzOv3qk7ubWU7AGZOKDLREjOqI4EAZQfq4gL9hP2KIgqgLubTvPF3GsmTADg== - dependencies: - "@taquito/http-utils" "^5.1.0-beta.1" + "@taquito/http-utils" "^6.1.0-beta.0" bignumber.js "^9.0.0" lodash "^4.17.15" -"@taquito/signer@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/signer/-/signer-5.1.0-beta.1.tgz#b5aadd782df0cc7330501c01f5d4ffd5c537ebd7" - integrity sha512-N7ZteHnXv2kS+CCxbmQ+Br21aIf8cwP/WGAjwOh0uMUcXg2qsmKE/0XnRYnLhftVaJolNo85oBckYnA6U48uCg== +"@taquito/signer@^6.1.0-beta.0": + version "6.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@taquito/signer/-/signer-6.1.0-beta.0.tgz#05d3994347de460f0f1722a99ac0bdc95528d3cf" + integrity sha512-/N5X+e029r5xJ8/LCdRqzBMh3or0n3BL2m15CRsZdhH21n8I1SHRh7vqXG/jDHLqB7i47lWW6rb5V2Pql2q0og== dependencies: - "@taquito/utils" "^5.1.0-beta.1" + "@taquito/utils" "^6.1.0-beta.0" bignumber.js "^9.0.0" bip39 "^3.0.2" elliptic "^6.5.1" @@ -1388,31 +1381,30 @@ pbkdf2 "^3.0.17" typedarray-to-buffer "^3.1.5" -"@taquito/taquito@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/taquito/-/taquito-5.1.0-beta.1.tgz#32ab600a3a08214463e961085205e25c87fea122" - integrity sha512-hLV7vZiraMlx+Not3dRdELNSwxd0ZLndRGGDBh+uexpo1aH7xX5IQbIgQBREaR1F7fqHswxBBCKcBbrGhP5EWQ== +"@taquito/taquito@^6.1.0-beta.0": + version "6.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@taquito/taquito/-/taquito-6.1.0-beta.0.tgz#f7497979170019f888b32f290012ce1005cd0c7a" + integrity sha512-gln8L2w4jYPj5PY2sCld5J8b5i+so7qUnGbVtoWIvqURfLSxIzLhhGDCMoSqJaJnjWWDQcsE88398TbCLjZJxQ== dependencies: - "@taquito/indexer" "^5.1.0-beta.1" - "@taquito/michelson-encoder" "^5.1.0-beta.1" - "@taquito/rpc" "^5.1.0-beta.1" - "@taquito/signer" "^5.1.0-beta.1" - "@taquito/utils" "^5.1.0-beta.1" + "@taquito/michelson-encoder" "^6.1.0-beta.0" + "@taquito/rpc" "^6.1.0-beta.0" + "@taquito/signer" "^6.1.0-beta.0" + "@taquito/utils" "^6.1.0-beta.0" bignumber.js "^9.0.0" rxjs "^6.5.3" -"@taquito/tezbridge-signer@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/tezbridge-signer/-/tezbridge-signer-5.1.0-beta.1.tgz#8e88cc3c47a802dade294336d9afa53f8d53bc21" - integrity sha512-Q/bjRjMgYjIcrdW4h2JUAajYuck0wxxb27k7ElINVEtV3qdP3g+0Ubls1YXPMnb5MG4NlDJ4H3xGWiy1dnfrdQ== +"@taquito/tezbridge-signer@^6.1.0-beta.0": + version "6.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@taquito/tezbridge-signer/-/tezbridge-signer-6.1.0-beta.0.tgz#adaad917091e946d6284ce4fd74f314b9c52c8d3" + integrity sha512-diVlbdJTqrw23xZ86E3NqfKDLrJSdg6sNQ1tZkQUvinEwYUGCUTTu7+kDM9vOM/loEH0vfyUUBE+cf27uJ7j1w== dependencies: - "@taquito/utils" "^5.1.0-beta.1" + "@taquito/utils" "^6.1.0-beta.0" typedarray-to-buffer "^3.1.5" -"@taquito/utils@^5.1.0-beta.1": - version "5.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@taquito/utils/-/utils-5.1.0-beta.1.tgz#6ab4f344abd0e3e7d40828182f461cccb9b94b24" - integrity sha512-3Qk+RLYKNYUW3jj1HYH0KymQQjWXdMcsp08eG+Cc0LKDvwzC5ewd4tfeUwq/jfHsd1fQ9LsG5FJ3NZg93W0H6w== +"@taquito/utils@^6.1.0-beta.0": + version "6.1.0-beta.0" + resolved "https://registry.yarnpkg.com/@taquito/utils/-/utils-6.1.0-beta.0.tgz#11e8887379738cae10d7a696c7b6cc0cec9eeab0" + integrity sha512-RaqVw1F7tR9RV71wuDs2Qn1DSH5qwcVVQc/JZMwQS92YUGyFGM5Sp3d+TivBaMhcjgESJNPUNijKj2xNCLd1aQ== dependencies: blakejs "^1.1.0" bs58check "^2.1.2" @@ -4900,6 +4892,11 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= +fast-json-stable-stringify@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" From c555df3ff796923026539e41ce5d0b365c4509ee Mon Sep 17 00:00:00 2001 From: Maksym Bykovskyy Date: Fri, 6 Mar 2020 13:32:50 -0800 Subject: [PATCH 25/40] Renamed entrypoint fieldname --- .../src/components/configure/compile-pane.tsx | 4 ++-- .../src/components/configure/deploy-pane.tsx | 4 ++-- .../src/components/configure/dry-run-pane.tsx | 4 ++-- .../configure/evaluate-function-pane.tsx | 2 +- .../components/configure/evaluate-value-pane.tsx | 2 +- .../client/src/components/form/inputs.tsx | 16 ++++++++++++++++ 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/tools/webide/packages/client/src/components/configure/compile-pane.tsx b/tools/webide/packages/client/src/components/configure/compile-pane.tsx index 21fb4c3bc..9093357fb 100644 --- a/tools/webide/packages/client/src/components/configure/compile-pane.tsx +++ b/tools/webide/packages/client/src/components/configure/compile-pane.tsx @@ -5,7 +5,7 @@ import styled from 'styled-components'; import { AppState } from '../../redux/app'; import { ChangeEntrypointAction, ChangeMichelsonFormatAction, CompileState, MichelsonFormat } from '../../redux/compile'; import { CheckboxComponent } from '../form/checkbox'; -import { Group, HGroup, Input, Label } from '../form/inputs'; +import { AccessFunctionLabel, Group, HGroup, Input, Label } from '../form/inputs'; const Container = styled.div``; @@ -26,7 +26,7 @@ export const CompilePaneComponent = () => { return ( - + { return ( - + { return ( - + { return ( - + { return ( - + { + return ( + + ); +}; + export const Input = styled.input` margin: 0.3em 0 0.7em 0; background-color: var(--input_background); From 558f3f5e80b11d4cee6be137acd52aca71a1163e Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Wulfman Date: Sat, 7 Mar 2020 02:00:29 +0100 Subject: [PATCH 26/40] fix annotation for funciton in ReasonLigo --- src/passes/1-parser/reasonligo/Parser.mly | 6 ++++- src/passes/2-simplify/cameligo.ml | 27 +++++++++++------------ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/passes/1-parser/reasonligo/Parser.mly b/src/passes/1-parser/reasonligo/Parser.mly index defde2e55..d24e3f832 100644 --- a/src/passes/1-parser/reasonligo/Parser.mly +++ b/src/passes/1-parser/reasonligo/Parser.mly @@ -558,9 +558,13 @@ fun_expr: in raise (Error (WrongFunctionArguments e)) in let binders = fun_args_to_pattern $1 in + let lhs_type = match $1 with + EAnnot {value = {inside = _ , _, t; _}; region = r} -> Some (r,t) + | _ -> None + in let f = {kwd_fun; binders; - lhs_type=None; + lhs_type; arrow; body } diff --git a/src/passes/2-simplify/cameligo.ml b/src/passes/2-simplify/cameligo.ml index 910da246f..03cdc6344 100644 --- a/src/passes/2-simplify/cameligo.ml +++ b/src/passes/2-simplify/cameligo.ml @@ -176,11 +176,6 @@ let rec pattern_to_typed_var : Raw.pattern -> _ = fun p -> | Raw.PWild r -> ok (({ region = r ; value = "_" } : Raw.variable) , None) | _ -> fail @@ wrong_pattern "single typed variable" p -let rec expr_to_typed_expr : Raw.expr -> _ = function - EPar e -> expr_to_typed_expr e.value.inside -| EAnnot {value={inside=e,_,t; _}; _} -> ok (e, Some t) -| e -> ok (e , None) - let rec tuple_pattern_to_typed_vars : Raw.pattern -> _ = fun pattern -> match pattern with | Raw.PPar pp -> tuple_pattern_to_typed_vars pp.value.inside @@ -646,9 +641,8 @@ and simpl_fun lamb' : expr result = | _ -> ok lamb.body) | _ -> ok lamb.body in - let%bind (body , body_type) = expr_to_typed_expr body in let%bind output_type = - bind_map_option simpl_type_expression body_type in + bind_map_option (fun x -> simpl_type_expression @@ snd x) lamb.lhs_type in let%bind body = simpl_expression body in let rec layer_arguments (arguments: (Raw.variable * type_expression) list) = match arguments with @@ -811,9 +805,8 @@ and simpl_declaration : Raw.declaration -> declaration Location.wrap list result let%bind var = pattern_to_var hd in ok (var , tl) in - let%bind lhs_type' = bind_map_option (fun x -> simpl_type_expression (snd x)) lhs_type in - let%bind let_rhs,lhs_type = match args with - | [] -> ok (let_rhs, lhs_type') + let%bind let_rhs = match args with + | [] -> ok (let_rhs) | param1::others -> let fun_ = { kwd_fun = Region.ghost; @@ -822,12 +815,18 @@ and simpl_declaration : Raw.declaration -> declaration Location.wrap list result arrow = Region.ghost; body = let_rhs } in - let f_args = nseq_to_list (param1,others) in - let%bind ty = bind_map_list typed_pattern_to_typed_vars f_args in - let aux acc ty = Option.map (t_function (snd ty)) acc in - ok (Raw.EFun {region=Region.ghost ; value=fun_},List.fold_right' aux lhs_type' ty) + ok (Raw.EFun {region=Region.ghost ; value=fun_}) in let%bind rhs' = simpl_expression let_rhs in + let%bind lhs_type = match let_rhs with + | Raw.EFun {value={binders;lhs_type};_} -> + let f_args = nseq_to_list (binders) in + let%bind ty = bind_map_list typed_pattern_to_typed_vars f_args in + let aux acc ty = Option.map (t_function (snd ty)) acc in + let%bind lhs_type' = bind_map_option (fun x -> simpl_type_expression (snd x)) lhs_type in + ok @@ List.fold_right' aux lhs_type' ty + | _ -> bind_map_option (fun x -> simpl_type_expression (snd x)) lhs_type + in ok @@ [loc x @@ (Declaration_constant (Var.of_name var.value , lhs_type , inline, rhs'))] ) From 49625001b15f1b8520fe7b12352c3d39fce7d00b Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Wulfman Date: Sat, 7 Mar 2020 02:39:39 +0100 Subject: [PATCH 27/40] Fix simplifyer and test --- .../docs/advanced/entrypoints-contracts.md | 3 +- src/passes/2-simplify/cameligo.ml | 35 +++++++++++++------ src/test/contracts/balance_constant.religo | 2 +- src/test/contracts/set_arithmetic.religo | 4 +-- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/gitlab-pages/docs/advanced/entrypoints-contracts.md b/gitlab-pages/docs/advanced/entrypoints-contracts.md index 499d07c58..c2232e494 100644 --- a/gitlab-pages/docs/advanced/entrypoints-contracts.md +++ b/gitlab-pages/docs/advanced/entrypoints-contracts.md @@ -310,7 +310,7 @@ let main (action, store: parameter * storage) : return = ```reasonligo group=c let owner : address = ("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address); -let main = ((action, store) : (parameter, storage)) : storage => { +let main = ((action, store) : (parameter, storage)) : return => { if (Tezos.source != owner) { (failwith ("Access denied.") : return); } else { (([] : list (operation)), store); }; }; @@ -478,4 +478,3 @@ let proxy = ((action, store): (parameter, storage)) : return => { > *deprecated*. - diff --git a/src/passes/2-simplify/cameligo.ml b/src/passes/2-simplify/cameligo.ml index 03cdc6344..569df20b3 100644 --- a/src/passes/2-simplify/cameligo.ml +++ b/src/passes/2-simplify/cameligo.ml @@ -176,6 +176,11 @@ let rec pattern_to_typed_var : Raw.pattern -> _ = fun p -> | Raw.PWild r -> ok (({ region = r ; value = "_" } : Raw.variable) , None) | _ -> fail @@ wrong_pattern "single typed variable" p +let rec expr_to_typed_expr : Raw.expr -> _ = function + EPar e -> expr_to_typed_expr e.value.inside +| EAnnot {value={inside=e,_,t; _}; _} -> ok (e, Some t) +| e -> ok (e , None) + let rec tuple_pattern_to_typed_vars : Raw.pattern -> _ = fun pattern -> match pattern with | Raw.PPar pp -> tuple_pattern_to_typed_vars pp.value.inside @@ -641,8 +646,9 @@ and simpl_fun lamb' : expr result = | _ -> ok lamb.body) | _ -> ok lamb.body in + let%bind (body , body_type) = expr_to_typed_expr body in let%bind output_type = - bind_map_option (fun x -> simpl_type_expression @@ snd x) lamb.lhs_type in + bind_map_option simpl_type_expression body_type in let%bind body = simpl_expression body in let rec layer_arguments (arguments: (Raw.variable * type_expression) list) = match arguments with @@ -805,8 +811,9 @@ and simpl_declaration : Raw.declaration -> declaration Location.wrap list result let%bind var = pattern_to_var hd in ok (var , tl) in - let%bind let_rhs = match args with - | [] -> ok (let_rhs) + let%bind lhs_type' = bind_map_option (fun x -> simpl_type_expression (snd x)) lhs_type in + let%bind let_rhs,lhs_type = match args with + | [] -> ok (let_rhs, lhs_type') | param1::others -> let fun_ = { kwd_fun = Region.ghost; @@ -815,17 +822,23 @@ and simpl_declaration : Raw.declaration -> declaration Location.wrap list result arrow = Region.ghost; body = let_rhs } in - ok (Raw.EFun {region=Region.ghost ; value=fun_}) - in - let%bind rhs' = simpl_expression let_rhs in - let%bind lhs_type = match let_rhs with - | Raw.EFun {value={binders;lhs_type};_} -> - let f_args = nseq_to_list (binders) in + let f_args = nseq_to_list (param1,others) in let%bind ty = bind_map_list typed_pattern_to_typed_vars f_args in let aux acc ty = Option.map (t_function (snd ty)) acc in + ok (Raw.EFun {region=Region.ghost ; value=fun_},List.fold_right' aux lhs_type' ty) + in + let%bind rhs' = simpl_expression let_rhs in + let%bind lhs_type = match lhs_type with + | None -> (match let_rhs with + | EFun {value={binders;lhs_type}} -> + let f_args = nseq_to_list (binders) in let%bind lhs_type' = bind_map_option (fun x -> simpl_type_expression (snd x)) lhs_type in - ok @@ List.fold_right' aux lhs_type' ty - | _ -> bind_map_option (fun x -> simpl_type_expression (snd x)) lhs_type + let%bind ty = bind_map_list typed_pattern_to_typed_vars f_args in + let aux acc ty = Option.map (t_function (snd ty)) acc in + ok @@ (List.fold_right' aux lhs_type' ty) + | _ -> ok None + ) + | Some t -> ok @@ Some t in ok @@ [loc x @@ (Declaration_constant (Var.of_name var.value , lhs_type , inline, rhs'))] ) diff --git a/src/test/contracts/balance_constant.religo b/src/test/contracts/balance_constant.religo index 1d136052b..33c1fd725 100644 --- a/src/test/contracts/balance_constant.religo +++ b/src/test/contracts/balance_constant.religo @@ -12,7 +12,7 @@ generated. unrecognized constant: {"constant":"BALANCE","location":"generated"} type storage = tez; -let main2 = (p : unit, storage) => +let main2 = (p : unit, s: storage) => ([]: list (operation), Tezos.balance); let main = (x : (unit, storage)) => main2 (x[0], x[1]); diff --git a/src/test/contracts/set_arithmetic.religo b/src/test/contracts/set_arithmetic.religo index a219fba9b..ed8f7a075 100644 --- a/src/test/contracts/set_arithmetic.religo +++ b/src/test/contracts/set_arithmetic.religo @@ -6,10 +6,10 @@ let literal_op = (p: unit) : set (string) => let add_op = (s: set (string)) : set (string) => Set.add ("foobar", s); -let remove_op = (s: set (string)) : set(string) => +let remove_op = (s: set (string)) : set (string) => Set.remove ("foobar", s); -let remove_deep = (s: (set (string), nat)): (set (string), nat) => +let remove_deep = (s: (set (string), nat)): set (string) => Set.remove ("foobar", s[0]); let mem_op = (s: set (string)) : bool => From f2e91cbfbe62964634f1b4e9987becbd73349a7b Mon Sep 17 00:00:00 2001 From: Maksym Bykovskyy Date: Sat, 7 Mar 2020 18:36:16 -0800 Subject: [PATCH 28/40] Updated package lock file --- .../webide/packages/client/package-lock.json | 3576 +++++++++++++---- .../webide/packages/server/package-lock.json | 570 ++- 2 files changed, 3084 insertions(+), 1062 deletions(-) diff --git a/tools/webide/packages/client/package-lock.json b/tools/webide/packages/client/package-lock.json index 3fb2eb759..62b1a6159 100644 --- a/tools/webide/packages/client/package-lock.json +++ b/tools/webide/packages/client/package-lock.json @@ -13,11 +13,11 @@ } }, "@babel/compat-data": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.8.1.tgz", - "integrity": "sha512-Z+6ZOXvyOWYxJ50BwxzdhRnRsGST8Y3jaZgxYig575lTjVSs3KtJnmESwZegg6e2Dn0td1eDhoWlp1wI4BTCPw==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.8.6.tgz", + "integrity": "sha512-CurCIKPTkS25Mb8mz267vU95vy+TyUpnctEX2lV33xWNmHAfjruztgiPBbXZRh3xZZy1CYvGx6XfxyTVS+sk7Q==", "requires": { - "browserslist": "^4.8.2", + "browserslist": "^4.8.5", "invariant": "^2.2.4", "semver": "^5.5.0" }, @@ -71,11 +71,11 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.7.tgz", + "integrity": "sha512-DQwjiKJqH4C3qGiyQCAExJHoZssn49JTMJgZ8SANGgVFdkupcUhLOdkAeoC6kmHZCPfoDG5M0b6cFlSN5wW7Ew==", "requires": { - "@babel/types": "^7.8.3", + "@babel/types": "^7.8.7", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -108,24 +108,24 @@ } }, "@babel/helper-call-delegate": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.8.3.tgz", - "integrity": "sha512-6Q05px0Eb+N4/GTyKPPvnkig7Lylw+QzihMpws9iiZQv7ZImf84ZsZpQH7QoWN4n4tm81SnSzPgHw2qtO0Zf3A==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.8.7.tgz", + "integrity": "sha512-doAA5LAKhsFCR0LAFIf+r2RSMmC+m8f/oQ+URnUET/rWeEzC0yTRmAGyWkD4sSu3xwbS7MYQ2u+xlt1V5R56KQ==", "requires": { "@babel/helper-hoist-variables": "^7.8.3", "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/types": "^7.8.7" } }, "@babel/helper-compilation-targets": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.3.tgz", - "integrity": "sha512-JLylPCsFjhLN+6uBSSh3iYdxKdeO9MNmoY96PE/99d8kyBFaXLORtAVhqN6iHa+wtPeqxKLghDOZry0+Aiw9Tw==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz", + "integrity": "sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw==", "requires": { - "@babel/compat-data": "^7.8.1", - "browserslist": "^4.8.2", + "@babel/compat-data": "^7.8.6", + "browserslist": "^4.9.1", "invariant": "^2.2.4", - "levenary": "^1.1.0", + "levenary": "^1.1.1", "semver": "^5.5.0" }, "dependencies": { @@ -137,23 +137,24 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.3.tgz", - "integrity": "sha512-qmp4pD7zeTxsv0JNecSBsEmG1ei2MqwJq4YQcK3ZWm/0t07QstWfvuV/vm3Qt5xNMFETn2SZqpMx2MQzbtq+KA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz", + "integrity": "sha512-klTBDdsr+VFFqaDHm5rR69OpEQtO2Qv8ECxHS1mNhJJvaHArR6a1xTf5K/eZW7eZpJbhCx3NW1Yt/sKsLXLblg==", "requires": { "@babel/helper-function-name": "^7.8.3", "@babel/helper-member-expression-to-functions": "^7.8.3", "@babel/helper-optimise-call-expression": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", "@babel/helper-split-export-declaration": "^7.8.3" } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.3.tgz", - "integrity": "sha512-Gcsm1OHCUr9o9TcJln57xhWHtdXbA2pgQ58S0Lxlks0WMGNXuki4+GLfX0p+L2ZkINUGZvfkz8rzoqJQSthI+Q==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.6.tgz", + "integrity": "sha512-bPyujWfsHhV/ztUkwGHz/RPV1T1TDEsSZDsN42JPehndA+p1KKTh3npvTadux0ZhCrytx9tvjpWNowKby3tM6A==", "requires": { + "@babel/helper-annotate-as-pure": "^7.8.3", "@babel/helper-regex": "^7.8.3", "regexpu-core": "^4.6.0" } @@ -220,15 +221,16 @@ } }, "@babel/helper-module-transforms": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.8.3.tgz", - "integrity": "sha512-C7NG6B7vfBa/pwCOshpMbOYUmrYQDfCpVL/JCRu0ek8B5p8kue1+BCXpg2vOYs7w5ACB9GTOBYQ5U6NwrMg+3Q==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.8.6.tgz", + "integrity": "sha512-RDnGJSR5EFBJjG3deY0NiL0K9TO8SXxS9n/MPsbPK/s9LbQymuLNtlzvDiNS7IpecuL45cMeLVkA+HfmlrnkRg==", "requires": { "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", "@babel/helper-simple-access": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.8.6", "lodash": "^4.17.13" } }, @@ -266,14 +268,14 @@ } }, "@babel/helper-replace-supers": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.3.tgz", - "integrity": "sha512-xOUssL6ho41U81etpLoT2RTdvdus4VfHamCuAm4AHxGr+0it5fnwoVdwUJ7GFEqCsQYzJUhcbsN9wB9apcYKFA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", "requires": { "@babel/helper-member-expression-to-functions": "^7.8.3", "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" } }, "@babel/helper-simple-access": { @@ -305,12 +307,12 @@ } }, "@babel/helpers": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.3.tgz", - "integrity": "sha512-LmU3q9Pah/XyZU89QvBgGt+BCsTPoQa+73RxAQh8fb8qkDyIfeQnmgs+hvzhTCKTzqOyk7JTkS3MS1S8Mq5yrQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", + "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", "requires": { "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", + "@babel/traverse": "^7.8.4", "@babel/types": "^7.8.3" } }, @@ -322,12 +324,58 @@ "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==" + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.7.tgz", + "integrity": "sha512-9JWls8WilDXFGxs0phaXAZgpxTZhSk/yOYH2hTHC0X1yC7Z78IJfvR1vJ+rmJKq3I35td2XzXzN6ZLYlna+r/A==" }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.8.3", @@ -340,22 +388,22 @@ } }, "@babel/plugin-proposal-class-properties": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.4.tgz", - "integrity": "sha512-EcuXeV4Hv1X3+Q1TsuOmyyxeTRiSqurGJ26+I/FW1WbymmRRapVORm6x1Zl3iDIHyRxEs+VXWp6qnlcfcJSbbw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz", + "integrity": "sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-class-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-proposal-decorators": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.7.4.tgz", - "integrity": "sha512-GftcVDcLCwVdzKmwOBDjATd548+IE+mBo7ttgatqNDR7VG7GqIuZPtRWlMLHbhTXhcnFZiGER8iIYl1n/imtsg==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.8.3.tgz", + "integrity": "sha512-e3RvdvS4qPJVTe288DlXjwKflpfy1hr0j5dz5WpIYYeP7vQZg2WfAEIp8k5/Lwis/m5REXEteIz6rrcDtXXG7w==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-decorators": "^7.7.4" + "@babel/helper-create-class-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-decorators": "^7.8.3" } }, "@babel/plugin-proposal-dynamic-import": { @@ -386,12 +434,12 @@ } }, "@babel/plugin-proposal-numeric-separator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.7.4.tgz", - "integrity": "sha512-CG605v7lLpVgVldSY6kxsN9ui1DxFOyepBfuX2AzU2TNriMAYApoU55mrGw9Jr4TlrTzPCG10CL8YXyi+E/iPw==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz", + "integrity": "sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ==", "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-numeric-separator": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3" } }, "@babel/plugin-proposal-object-rest-spread": { @@ -570,16 +618,16 @@ } }, "@babel/plugin-transform-classes": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.8.3.tgz", - "integrity": "sha512-SjT0cwFJ+7Rbr1vQsvphAHwUHvSUPmMjMU/0P59G8U2HLFqSa082JO7zkbDNWs9kH/IUqpHI6xWNesGf8haF1w==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.8.6.tgz", + "integrity": "sha512-k9r8qRay/R6v5aWZkrEclEhKO6mc1CCQr2dLsVHBmOQiMpN6I2bpjX3vgnldUWeEI1GHVNByULVxZ4BdP4Hmdg==", "requires": { "@babel/helper-annotate-as-pure": "^7.8.3", "@babel/helper-define-map": "^7.8.3", "@babel/helper-function-name": "^7.8.3", "@babel/helper-optimise-call-expression": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", "@babel/helper-split-export-declaration": "^7.8.3", "globals": "^11.1.0" } @@ -627,18 +675,18 @@ } }, "@babel/plugin-transform-flow-strip-types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.7.4.tgz", - "integrity": "sha512-w9dRNlHY5ElNimyMYy0oQowvQpwt/PRHI0QS98ZJCTZU2bvSnKXo5zEiD5u76FBPigTm8TkqzmnUTg16T7qbkA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.8.3.tgz", + "integrity": "sha512-g/6WTWG/xbdd2exBBzMfygjX/zw4eyNC4X8pRaq7aRHRoDUCzAIu3kGYIXviOv8BjCuWm8vDBwjHcjiRNgXrPA==", "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-flow": "^7.8.3" } }, "@babel/plugin-transform-for-of": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.3.tgz", - "integrity": "sha512-ZjXznLNTxhpf4Q5q3x1NsngzGA38t9naWH8Gt+0qYZEJAcvPI9waSStSh56u19Ofjr7QmD0wUsQ8hw8s/p1VnA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.6.tgz", + "integrity": "sha512-M0pw4/1/KI5WAxPsdcUL/w2LJ7o89YHN3yLkzNjg7Yl15GlVGgzHyCU+FMeAxevHGsLVmUqbirlUIKTafPmzdw==", "requires": { "@babel/helper-plugin-utils": "^7.8.3" } @@ -735,11 +783,11 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.3.tgz", - "integrity": "sha512-/pqngtGb54JwMBZ6S/D3XYylQDFtGjWrnoCF4gXZOUpFV/ujbxnoNGNvDGu6doFWRPBveE72qTx/RRU44j5I/Q==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.7.tgz", + "integrity": "sha512-brYWaEPTRimOctz2NDA3jnBbDi7SVN2T4wYuu0aqSzxC3nozFZngGaw29CJ9ZPweB7k+iFmZuoG3IVPIcXmD2g==", "requires": { - "@babel/helper-call-delegate": "^7.8.3", + "@babel/helper-call-delegate": "^7.8.7", "@babel/helper-get-function-arity": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3" } @@ -798,11 +846,11 @@ } }, "@babel/plugin-transform-regenerator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.3.tgz", - "integrity": "sha512-qt/kcur/FxrQrzFR432FGZznkVAjiyFtCOANjkAKwCbt465L6ZCiUQh2oMYGU3Wo8LRFJxNDFwWn106S5wVUNA==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz", + "integrity": "sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA==", "requires": { - "regenerator-transform": "^0.14.0" + "regenerator-transform": "^0.14.2" } }, "@babel/plugin-transform-reserved-words": { @@ -814,12 +862,12 @@ } }, "@babel/plugin-transform-runtime": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.7.4.tgz", - "integrity": "sha512-O8kSkS5fP74Ad/8pfsCMGa8sBRdLxYoSReaARRNSz3FbFQj3z/QUvoUmJ28gn9BO93YfnXc3j+Xyaqe8cKDNBQ==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.8.3.tgz", + "integrity": "sha512-/vqUt5Yh+cgPZXXjmaG9NT8aVfThKk7G4OqkVhrXqwsC5soMn/qTCxs36rZ2QFhpfTJcjw4SNDIZ4RUb8OL4jQ==", "requires": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", "resolve": "^1.8.1", "semver": "^5.5.1" }, @@ -866,17 +914,17 @@ } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.3.tgz", - "integrity": "sha512-3TrkKd4LPqm4jHs6nPtSDI/SV9Cm5PRJkHLUgTcqRQQTMAZ44ZaAdDZJtvWFSaRcvT0a1rTmJ5ZA5tDKjleF3g==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", + "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", "requires": { "@babel/helper-plugin-utils": "^7.8.3" } }, "@babel/plugin-transform-typescript": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.8.3.tgz", - "integrity": "sha512-Ebj230AxcrKGZPKIp4g4TdQLrqX95TobLUWKd/CwG7X1XHUH1ZpkpFvXuXqWbtGRWb7uuEWNlrl681wsOArAdQ==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.8.7.tgz", + "integrity": "sha512-7O0UsPQVNKqpHeHLpfvOG4uXmlw+MOxYvUv6Otc9uH5SYMIxvF6eBdjkWvC3f9G+VXe0RsNExyAQBeTRug/wqQ==", "requires": { "@babel/helper-create-class-features-plugin": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3", @@ -893,12 +941,12 @@ } }, "@babel/preset-env": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.3.tgz", - "integrity": "sha512-Rs4RPL2KjSLSE2mWAx5/iCH+GC1ikKdxPrhnRS6PfFVaiZeom22VFKN4X8ZthyN61kAaR05tfXTbCvatl9WIQg==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.7.tgz", + "integrity": "sha512-BYftCVOdAYJk5ASsznKAUl53EMhfBbr8CJ1X+AJLfGPscQkwJFiaV/Wn9DPH/7fzm2v6iRYJKYHSqyynTGw0nw==", "requires": { - "@babel/compat-data": "^7.8.0", - "@babel/helper-compilation-targets": "^7.8.3", + "@babel/compat-data": "^7.8.6", + "@babel/helper-compilation-targets": "^7.8.7", "@babel/helper-module-imports": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3", "@babel/plugin-proposal-async-generator-functions": "^7.8.3", @@ -921,13 +969,13 @@ "@babel/plugin-transform-async-to-generator": "^7.8.3", "@babel/plugin-transform-block-scoped-functions": "^7.8.3", "@babel/plugin-transform-block-scoping": "^7.8.3", - "@babel/plugin-transform-classes": "^7.8.3", + "@babel/plugin-transform-classes": "^7.8.6", "@babel/plugin-transform-computed-properties": "^7.8.3", "@babel/plugin-transform-destructuring": "^7.8.3", "@babel/plugin-transform-dotall-regex": "^7.8.3", "@babel/plugin-transform-duplicate-keys": "^7.8.3", "@babel/plugin-transform-exponentiation-operator": "^7.8.3", - "@babel/plugin-transform-for-of": "^7.8.3", + "@babel/plugin-transform-for-of": "^7.8.6", "@babel/plugin-transform-function-name": "^7.8.3", "@babel/plugin-transform-literals": "^7.8.3", "@babel/plugin-transform-member-expression-literals": "^7.8.3", @@ -938,21 +986,21 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", "@babel/plugin-transform-new-target": "^7.8.3", "@babel/plugin-transform-object-super": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.8.7", "@babel/plugin-transform-property-literals": "^7.8.3", - "@babel/plugin-transform-regenerator": "^7.8.3", + "@babel/plugin-transform-regenerator": "^7.8.7", "@babel/plugin-transform-reserved-words": "^7.8.3", "@babel/plugin-transform-shorthand-properties": "^7.8.3", "@babel/plugin-transform-spread": "^7.8.3", "@babel/plugin-transform-sticky-regex": "^7.8.3", "@babel/plugin-transform-template-literals": "^7.8.3", - "@babel/plugin-transform-typeof-symbol": "^7.8.3", + "@babel/plugin-transform-typeof-symbol": "^7.8.4", "@babel/plugin-transform-unicode-regex": "^7.8.3", - "@babel/types": "^7.8.3", - "browserslist": "^4.8.2", + "@babel/types": "^7.8.7", + "browserslist": "^4.8.5", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", - "levenary": "^1.1.0", + "levenary": "^1.1.1", "semver": "^5.5.0" }, "dependencies": { @@ -976,52 +1024,43 @@ } }, "@babel/preset-typescript": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.7.4.tgz", - "integrity": "sha512-rqrjxfdiHPsnuPur0jKrIIGQCIgoTWMTjlbWE69G4QJ6TIOVnnRnIJhUxNTL/VwDmEAVX08Tq3B1nirer5341w==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.8.3.tgz", + "integrity": "sha512-qee5LgPGui9zQ0jR1TeU5/fP9L+ovoArklEqY12ek8P/wV5ZeM/VYSQYwICeoT6FfpJTekG9Ilay5PhwsOpMHA==", "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-transform-typescript": "^7.8.3" } }, "@babel/runtime": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.3.tgz", - "integrity": "sha512-fVHx1rzEmwB130VTkLnxR+HmxcTjGzH12LYQcFFoBwakMd3aOMD4OsRN7tGG/UOYE2ektgFrS8uACAoRk1CY0w==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.7.tgz", + "integrity": "sha512-+AATMUFppJDw6aiR5NVPHqIQBlV/Pj8wY/EZH+lmvRdUo9xBaz/rF3alAwFJQavvKfeOlPE7oaaDHVbcySbCsg==", "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "@babel/runtime-corejs3": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.8.3.tgz", - "integrity": "sha512-lrIU4aVbmlM/wQPzhEvzvNJskKyYptuXb0fGC0lTQTupTOYtR2Vqbu6/jf8vTr4M8Wt1nIzxVrSvPI5qESa/xA==", - "requires": { - "core-js-pure": "^3.0.0", - "regenerator-runtime": "^0.13.2" + "regenerator-runtime": "^0.13.4" } }, "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", "requires": { "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.6.tgz", + "integrity": "sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A==", "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.6", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" @@ -1043,9 +1082,9 @@ } }, "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.7.tgz", + "integrity": "sha512-k2TreEHxFA4CjGkL+GYjRyx35W0Mr7DP5+9q6WMkyKXB+904bYmG40syjMFV0oLlhhFCwWl0vA0DyzTDkwAiJw==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -1053,9 +1092,9 @@ } }, "@cnakazawa/watch": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz", - "integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", + "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", "requires": { "exec-sh": "^0.3.2", "minimist": "^1.2.0" @@ -1072,9 +1111,9 @@ "integrity": "sha512-6It2EVfGskxZCQhuykrfnALg7oVeiI6KclWSmGDqB0AiInVrTGB9Jp9i4/Ad21u9Jde/voVQz6eFX/eSg/UsPA==" }, "@emotion/is-prop-valid": { - "version": "0.8.6", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.6.tgz", - "integrity": "sha512-mnZMho3Sq8BfzkYYRVc8ilQTnc8U02Ytp6J1AwM6taQStZ3AhsEJBX2LzhA/LJirNCwM2VtHL3VFIZ+sNJUgUQ==", + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.7.tgz", + "integrity": "sha512-OPkKzUeiid0vEKjZqnGcy2mzxjIlCffin+L2C02pdz/bVlt5zZZE2VzO0D3XOPnH0NEeF21QNKSXiZphjr4xiQ==", "requires": { "@emotion/memoize": "0.7.4" } @@ -1090,32 +1129,32 @@ "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "@fortawesome/fontawesome-common-types": { - "version": "0.2.26", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.26.tgz", - "integrity": "sha512-CcM/fIFwZlRdiWG/25xE/wHbtyUuCtqoCTrr6BsWw7hH072fR++n4L56KPydAr3ANgMJMjT8v83ZFIsDc7kE+A==" + "version": "0.2.27", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.27.tgz", + "integrity": "sha512-97GaByGaXDGMkzcJX7VmR/jRJd8h1mfhtA7RsxDBN61GnWE/PPCZhOdwG/8OZYktiRUF0CvFOr+VgRkJrt6TWg==" }, "@fortawesome/fontawesome-svg-core": { - "version": "1.2.26", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.26.tgz", - "integrity": "sha512-3Dfd/v2IztP1TxKOxZiB5+4kaOZK9mNy0KU1vVK7nFlPWz3gzxrCWB+AloQhQUoJ8HhGqbzjliK89Vl7PExGbw==", + "version": "1.2.27", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.27.tgz", + "integrity": "sha512-sOD3DKynocnHYpuw2sLPnTunDj7rLk91LYhi2axUYwuGe9cPCw7Bsu9EWtVdNJP+IYgTCZIbyARKXuy5K/nv+Q==", "requires": { - "@fortawesome/fontawesome-common-types": "^0.2.26" + "@fortawesome/fontawesome-common-types": "^0.2.27" } }, "@fortawesome/free-solid-svg-icons": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.12.0.tgz", - "integrity": "sha512-CnpsWs6GhTs9ekNB3d8rcO5HYqRkXbYKf2YNiAlTWbj5eVlPqsd/XH1F9If8jkcR1aegryAbln/qYeKVZzpM0g==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.12.1.tgz", + "integrity": "sha512-k3MwRFFUhyL4cuCJSaHDA0YNYMELDXX0h8JKtWYxO5XD3Dn+maXOMrVAAiNGooUyM2v/wz/TOaM0jxYVKeXX7g==", "requires": { - "@fortawesome/fontawesome-common-types": "^0.2.26" + "@fortawesome/fontawesome-common-types": "^0.2.27" } }, "@fortawesome/react-fontawesome": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.8.tgz", - "integrity": "sha512-I5h9YQg/ePA3Br9ISS18fcwOYmzQYDSM1ftH03/8nHkiqIVHtUyQBw482+60dnzvlr82gHt3mGm+nDUp159FCw==", + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.9.tgz", + "integrity": "sha512-49V3WNysLZU5fZ3sqSuys4nGRytsrxJktbv3vuaXkEoxv22C6T7TEG0TW6+nqVjMnkfCQd5xOnmJoZHMF78tOw==", "requires": { - "prop-types": "^15.5.10" + "prop-types": "^15.7.2" } }, "@hapi/address": { @@ -1129,9 +1168,9 @@ "integrity": "sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA==" }, "@hapi/hoek": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.0.tgz", - "integrity": "sha512-7XYT10CZfPsH7j9F1Jmg1+d0ezOux2oM2GfArAzLwWe4mE2Dr3hVjsAL6+TFY49RRJlCdJDMw3nJsLFroTc8Kw==" + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.1.tgz", + "integrity": "sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow==" }, "@hapi/joi": { "version": "15.1.1", @@ -1160,6 +1199,52 @@ "@jest/source-map": "^24.9.0", "chalk": "^2.0.1", "slash": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@jest/core": { @@ -1197,11 +1282,37 @@ "strip-ansi": "^5.0.0" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==" }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -1229,6 +1340,29 @@ } } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -1250,6 +1384,11 @@ } } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -1293,6 +1432,14 @@ "to-regex": "^3.0.2" } }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -1313,6 +1460,26 @@ "@jest/transform": "^24.9.0", "@jest/types": "^24.9.0", "jest-mock": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "@jest/fake-timers": { @@ -1323,6 +1490,26 @@ "@jest/types": "^24.9.0", "jest-message-util": "^24.9.0", "jest-mock": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "@jest/reporters": { @@ -1353,10 +1540,72 @@ "string-length": "^2.0.0" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -1390,6 +1639,26 @@ "@jest/console": "^24.9.0", "@jest/types": "^24.9.0", "@types/istanbul-lib-coverage": "^2.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "@jest/test-sequencer": { @@ -1426,6 +1695,32 @@ "write-file-atomic": "2.4.1" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -1453,6 +1748,29 @@ } } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -1474,6 +1792,11 @@ } } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -1522,6 +1845,14 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -1534,13 +1865,14 @@ } }, "@jest/types": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", - "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.1.0.tgz", + "integrity": "sha512-VpOtt7tCrgvamWZh1reVsGADujKigBUFTi19mlRjqEGsE8qH4r3s+skY33dNdXOwyZIvuftZ5tqdF1IgsMejMA==", "requires": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^13.0.0" + "@types/yargs": "^15.0.0", + "chalk": "^3.0.0" } }, "@mrmlnc/readdir-enhanced": { @@ -1667,47 +1999,39 @@ } }, "@taquito/http-utils": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-5.1.0-beta.1.tgz", - "integrity": "sha512-/UvE61t9j5CR94vy8Dtb+/6oJERE0P9LmHBbkESKUxNC9SAlETCEntSNiHha+vuwgCoOj0pXsHkBtAZkWAaEeg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-6.1.0-beta.0.tgz", + "integrity": "sha512-qQg/siOh3Vrj4lYbRGuHXKLgd8Or/5upJ2LgP8Y+i6X0n/uBsE6lnwGD8JCHWt644tvhEuf53j7DJI13blLaKg==", "requires": { "xhr2-cookies": "^1.1.0" } }, - "@taquito/indexer": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/indexer/-/indexer-5.1.0-beta.1.tgz", - "integrity": "sha512-NDWK7XQGgUP0YkEWhJklF9uhKHZDWtRaAPSsSfxSDYiQzol4iAUn7ru7+TQPNqfsXq0NjpvzGHBysQ8HTeb0Gg==", - "requires": { - "@taquito/http-utils": "^5.1.0-beta.1", - "bignumber.js": "^9.0.0" - } - }, "@taquito/michelson-encoder": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/michelson-encoder/-/michelson-encoder-5.1.0-beta.1.tgz", - "integrity": "sha512-kBpHDfsvsxzsIXbM4dOZs0nklY7CjCunSJ2sABUdBu4SmXDM06F5NDzg0166q7VBhFZgOhq/NNM9g7hcgn5qJg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/michelson-encoder/-/michelson-encoder-6.1.0-beta.0.tgz", + "integrity": "sha512-02CHk0Ag7pBLCDIJnAKXPp4Owcl3qLkIKB8pQa5uOT1fxefaT2EadMnxQEpbXPiFp4tcBRJq16Bd4JtogO+/CQ==", "requires": { - "@taquito/utils": "^5.1.0-beta.1", - "bignumber.js": "^9.0.0" + "@taquito/utils": "^6.1.0-beta.0", + "bignumber.js": "^9.0.0", + "fast-json-stable-stringify": "^2.1.0" } }, "@taquito/rpc": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-5.1.0-beta.1.tgz", - "integrity": "sha512-ZbqpJVZw1ljAS92Xs9t/1BAgPEMzOv3qk7ubWU7AGZOKDLREjOqI4EAZQfq4gL9hP2KIgqgLubTvPF3GsmTADg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-6.1.0-beta.0.tgz", + "integrity": "sha512-umpiFpasPIVNuRUkrlOi2Z3tOHQ1p6MU0AI3xRUdoUf2Hhn7tWN1CsFzQzm87LekVz1kW7Dogkwc5hD4gsIPZg==", "requires": { - "@taquito/http-utils": "^5.1.0-beta.1", + "@taquito/http-utils": "^6.1.0-beta.0", "bignumber.js": "^9.0.0", "lodash": "^4.17.15" } }, "@taquito/signer": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/signer/-/signer-5.1.0-beta.1.tgz", - "integrity": "sha512-N7ZteHnXv2kS+CCxbmQ+Br21aIf8cwP/WGAjwOh0uMUcXg2qsmKE/0XnRYnLhftVaJolNo85oBckYnA6U48uCg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/signer/-/signer-6.1.0-beta.0.tgz", + "integrity": "sha512-/N5X+e029r5xJ8/LCdRqzBMh3or0n3BL2m15CRsZdhH21n8I1SHRh7vqXG/jDHLqB7i47lWW6rb5V2Pql2q0og==", "requires": { - "@taquito/utils": "^5.1.0-beta.1", + "@taquito/utils": "^6.1.0-beta.0", "bignumber.js": "^9.0.0", "bip39": "^3.0.2", "elliptic": "^6.5.1", @@ -1717,32 +2041,31 @@ } }, "@taquito/taquito": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/taquito/-/taquito-5.1.0-beta.1.tgz", - "integrity": "sha512-hLV7vZiraMlx+Not3dRdELNSwxd0ZLndRGGDBh+uexpo1aH7xX5IQbIgQBREaR1F7fqHswxBBCKcBbrGhP5EWQ==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/taquito/-/taquito-6.1.0-beta.0.tgz", + "integrity": "sha512-gln8L2w4jYPj5PY2sCld5J8b5i+so7qUnGbVtoWIvqURfLSxIzLhhGDCMoSqJaJnjWWDQcsE88398TbCLjZJxQ==", "requires": { - "@taquito/indexer": "^5.1.0-beta.1", - "@taquito/michelson-encoder": "^5.1.0-beta.1", - "@taquito/rpc": "^5.1.0-beta.1", - "@taquito/signer": "^5.1.0-beta.1", - "@taquito/utils": "^5.1.0-beta.1", + "@taquito/michelson-encoder": "^6.1.0-beta.0", + "@taquito/rpc": "^6.1.0-beta.0", + "@taquito/signer": "^6.1.0-beta.0", + "@taquito/utils": "^6.1.0-beta.0", "bignumber.js": "^9.0.0", "rxjs": "^6.5.3" } }, "@taquito/tezbridge-signer": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/tezbridge-signer/-/tezbridge-signer-5.1.0-beta.1.tgz", - "integrity": "sha512-Q/bjRjMgYjIcrdW4h2JUAajYuck0wxxb27k7ElINVEtV3qdP3g+0Ubls1YXPMnb5MG4NlDJ4H3xGWiy1dnfrdQ==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/tezbridge-signer/-/tezbridge-signer-6.1.0-beta.0.tgz", + "integrity": "sha512-diVlbdJTqrw23xZ86E3NqfKDLrJSdg6sNQ1tZkQUvinEwYUGCUTTu7+kDM9vOM/loEH0vfyUUBE+cf27uJ7j1w==", "requires": { - "@taquito/utils": "^5.1.0-beta.1", + "@taquito/utils": "^6.1.0-beta.0", "typedarray-to-buffer": "^3.1.5" } }, "@taquito/utils": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-5.1.0-beta.1.tgz", - "integrity": "sha512-3Qk+RLYKNYUW3jj1HYH0KymQQjWXdMcsp08eG+Cc0LKDvwzC5ewd4tfeUwq/jfHsd1fQ9LsG5FJ3NZg93W0H6w==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-6.1.0-beta.0.tgz", + "integrity": "sha512-RaqVw1F7tR9RV71wuDs2Qn1DSH5qwcVVQc/JZMwQS92YUGyFGM5Sp3d+TivBaMhcjgESJNPUNijKj2xNCLd1aQ==", "requires": { "blakejs": "^1.1.0", "bs58check": "^2.1.2", @@ -1750,9 +2073,9 @@ } }, "@types/babel__core": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz", - "integrity": "sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.6.tgz", + "integrity": "sha512-tTnhWszAqvXnhW7m5jQU9PomXSiKXk2sFxpahXvI20SZKu9ylPi8WtIxueZ6ehDWikPT0jeFujMj3X4ZHuf3Tg==", "requires": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0", @@ -1779,13 +2102,18 @@ } }, "@types/babel__traverse": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.8.tgz", - "integrity": "sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.9.tgz", + "integrity": "sha512-jEFQ8L1tuvPjOI8lnpaf73oCJe+aoxL6ygqSy6c8LcW98zaC+4mzWuQIRCEvKeCOu+lbqdXcg4Uqmm1S8AP1tw==", "requires": { "@babel/types": "^7.3.0" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" + }, "@types/eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -1905,12 +2233,11 @@ } }, "@types/react-native": { - "version": "0.61.2", - "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.61.2.tgz", - "integrity": "sha512-z15qGoBmZD6KIx3ZRYsqjelwBYXRMylPqz34swCH2exEk1EwOcPG2cp/TIpiN72lpByHlPvoMKbu8v1lzQrayw==", + "version": "0.61.20", + "resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.61.20.tgz", + "integrity": "sha512-EEtaP15gpDhpB1N8G3a+nWAzSa3HiLAZvfFkvczCluQXiB2vXAVJyxWls1i3Q9TERVWE3JbOuufgCY6bV1qTzw==", "dev": true, "requires": { - "@types/prop-types": "*", "@types/react": "*" } }, @@ -1923,9 +2250,9 @@ } }, "@types/react-redux": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.6.tgz", - "integrity": "sha512-OjIrYtOg+j7MwNURIZ1BHoxWEzX3lDS/5169JqXUE+1XcOHGRVZirnnsexBDl5ykjxXlNHi4AS0aOismP3DaIA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.7.tgz", + "integrity": "sha512-U+WrzeFfI83+evZE2dkZ/oF/1vjIYgqrb5dGgedkqVV8HEfDFujNgWCwHL89TDuWKb47U0nTBT6PLGq4IIogWg==", "dev": true, "requires": { "@types/hoist-non-react-statics": "^3.3.0", @@ -1940,9 +2267,9 @@ "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==" }, "@types/styled-components": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-4.4.2.tgz", - "integrity": "sha512-dngFx2PuGoy0MGE68eHayAmJvLSqWrnTe9w+DnQruu8PS+waWEsKmoBRhkzL2h2pK1OJhzJhVfuiz+oZa4etpA==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-4.4.3.tgz", + "integrity": "sha512-U0udeNOZBfUkJycmGJwmzun0FBt11rZy08weVQmE2xfUNAbX8AGOEWxWna2d+qAUKxKgMlcG+TZT0+K2FfDcnQ==", "dev": true, "requires": { "@types/hoist-non-react-statics": "*", @@ -1952,9 +2279,9 @@ } }, "@types/yargs": { - "version": "13.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.5.tgz", - "integrity": "sha512-CF/+sxTO7FOwbIRL4wMv0ZYLCRfMid2HQpzDRyViH7kSpfoAFiMdGqKIxb1PxWfjtQXQhnQuD33lvRHNwr809Q==", + "version": "15.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz", + "integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==", "requires": { "@types/yargs-parser": "*" } @@ -1965,11 +2292,11 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==" }, "@typescript-eslint/eslint-plugin": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.17.0.tgz", - "integrity": "sha512-tg/OMOtPeXlvk0ES8mZzEZ4gd1ruSE03nsKcK+teJhxYv5CPCXK6Mb/OK6NpB4+CqGTHs4MVeoSZXNFqpT1PyQ==", + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.22.0.tgz", + "integrity": "sha512-BvxRLaTDVQ3N+Qq8BivLiE9akQLAOUfxNHIEhedOcg8B2+jY8Rc4/D+iVprvuMX1AdezFYautuGDwr9QxqSxBQ==", "requires": { - "@typescript-eslint/experimental-utils": "2.17.0", + "@typescript-eslint/experimental-utils": "2.22.0", "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -1977,30 +2304,30 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.17.0.tgz", - "integrity": "sha512-2bNf+mZ/3mj5/3CP56v+ldRK3vFy9jOvmCPs/Gr2DeSJh+asPZrhFniv4QmQsHWQFPJFWhFHgkGgJeRmK4m8iQ==", + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.22.0.tgz", + "integrity": "sha512-sJt1GYBe6yC0dWOQzXlp+tiuGglNhJC9eXZeC8GBVH98Zv9jtatccuhz0OF5kC/DwChqsNfghHx7OlIDQjNYAQ==", "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.17.0", + "@typescript-eslint/typescript-estree": "2.22.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/parser": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.17.0.tgz", - "integrity": "sha512-k1g3gRQ4fwfJoIfgUpz78AovicSWKFANmvTfkAHP24MgJHjWfZI6ya7tsQZt1sLczvP4G9BE5G5MgADHdmJB/w==", + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.22.0.tgz", + "integrity": "sha512-FaZKC1X+nvD7qMPqKFUYHz3H0TAioSVFGvG29f796Nc5tBluoqfHgLbSFKsh7mKjRoeTm8J9WX2Wo9EyZWjG7w==", "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.17.0", - "@typescript-eslint/typescript-estree": "2.17.0", + "@typescript-eslint/experimental-utils": "2.22.0", + "@typescript-eslint/typescript-estree": "2.22.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.17.0.tgz", - "integrity": "sha512-g0eVRULGnEEUakxRfJO0s0Hr1LLQqsI6OrkiCLpdHtdJJek+wyd8mb00vedqAoWldeDcOcP8plqw8/jx9Gr3Lw==", + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.22.0.tgz", + "integrity": "sha512-2HFZW2FQc4MhIBB8WhDm9lVFaBDy6h9jGrJ4V2Uzxe/ON29HCHBTj3GkgcsgMWfsl2U5as+pTOr30Nibaw7qRQ==", "requires": { "debug": "^4.1.1", "eslint-visitor-keys": "^1.1.0", @@ -2215,9 +2542,9 @@ } }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" }, "acorn-globals": { "version": "4.3.4", @@ -2236,9 +2563,9 @@ } }, "acorn-jsx": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", - "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==" }, "acorn-walk": { "version": "6.2.0", @@ -2266,6 +2593,29 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + } } } }, @@ -2287,9 +2637,9 @@ } }, "ajv": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", - "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2324,11 +2674,18 @@ "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==" }, "ansi-escapes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz", - "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==" + } } }, "ansi-html": { @@ -2337,16 +2694,17 @@ "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=" }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "requires": { - "color-convert": "^1.9.0" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, "anymatch": { @@ -2589,12 +2947,12 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "array.prototype.find": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.0.tgz", - "integrity": "sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.1.tgz", + "integrity": "sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA==", "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.13.0" + "es-abstract": "^1.17.4" } }, "arrify": { @@ -2701,10 +3059,54 @@ "postcss-value-parser": "^4.0.2" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "postcss-value-parser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz", - "integrity": "sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz", + "integrity": "sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -2719,21 +3121,17 @@ "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" }, "axios": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.1.tgz", - "integrity": "sha512-Yl+7nfreYKaLRvAvjNPkvfjnQHJM1yLBY3zhqAwcJSwR/6ETkanUgylgtIvkvz0xJ+p/vZuNw8X7Hnb7Whsbpw==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", "requires": { "follow-redirects": "1.5.10" } }, "axobject-query": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.1.1.tgz", - "integrity": "sha512-lF98xa/yvy6j3fBHAgQXIYl+J4eZadOSqsPojemUqClzNbBV38wWGpUbQbVEyf4eUF5yF7eHmGgGA2JiHyjeqw==", - "requires": { - "@babel/runtime": "^7.7.4", - "@babel/runtime-corejs3": "^7.7.4" - } + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.1.2.tgz", + "integrity": "sha512-ICt34ZmrVt8UQnvPl6TVyDTkmhXmAyAT4Jh5ugfGUX4MOrZ+U/ZY6/sdylRw3qGNr9Ub5AJsaHeDMzNLehRdOQ==" }, "babel-code-frame": { "version": "6.26.0", @@ -2820,6 +3218,70 @@ "babel-preset-jest": "^24.9.0", "chalk": "^2.4.2", "slash": "^2.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "babel-loader": { @@ -2868,9 +3330,9 @@ } }, "babel-plugin-macros": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.7.1.tgz", - "integrity": "sha512-HNM284amlKSQ6FddI4jLXD+XTqF0cTYOe5uemOIZxHJHnamC+OhFQ57rMF9sgnYhkJQptVl9U1SKVZsV9/GLQQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", + "integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==", "requires": { "@babel/runtime": "^7.7.2", "cosmiconfig": "^6.0.0", @@ -2922,14 +3384,14 @@ } }, "babel-plugin-named-asset-import": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.5.tgz", - "integrity": "sha512-sGhfINU+AuMw9oFAdIn/nD5sem3pn/WgxAfDZ//Q3CnF+5uaho7C7shh2rKLk6sKE/XkfmyibghocwKdVjLIKg==" + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.6.tgz", + "integrity": "sha512-1aGDUfL1qOOIoqk9QKGIo2lANk+C7ko/fqH0uIyC71x3PEGz0uVP8ISgfEsFuG+FKmjHTvFK/nNM8dowpmUxLA==" }, "babel-plugin-styled-components": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.6.tgz", - "integrity": "sha512-gyQj/Zf1kQti66100PhrCRjI5ldjaze9O0M3emXRPAN80Zsf8+e1thpTpaXJXVHXtaM4/+dJEgZHyS9Its+8SA==", + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.7.tgz", + "integrity": "sha512-MBMHGcIA22996n9hZRf/UJLVVgkEOITuR2SvjHLb5dSTUyR4ZRGn+ngITapes36FI3WLxZHfRhkA1ffHxihOrg==", "requires": { "@babel/helper-annotate-as-pure": "^7.0.0", "@babel/helper-module-imports": "^7.0.0", @@ -2971,45 +3433,40 @@ } }, "babel-preset-react-app": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/babel-preset-react-app/-/babel-preset-react-app-9.1.0.tgz", - "integrity": "sha512-0qMOv/pCcCQWxX1eNyKD9GlzZTdzZIK/Pq3O6TGe65tZSJTSplw1pFlaPujm0GjBj4g3GeCQbP08vvzlH7OGHg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/babel-preset-react-app/-/babel-preset-react-app-9.1.1.tgz", + "integrity": "sha512-YkWP2UwY//TLltNlEBRngDOrYhvSLb+CA330G7T9M5UhGEMWe+JK/8IXJc5p2fDTSfSiETf+PY0+PYXFMix81Q==", "requires": { - "@babel/core": "7.7.4", - "@babel/plugin-proposal-class-properties": "7.7.4", - "@babel/plugin-proposal-decorators": "7.7.4", - "@babel/plugin-proposal-nullish-coalescing-operator": "7.7.4", - "@babel/plugin-proposal-numeric-separator": "7.7.4", - "@babel/plugin-proposal-object-rest-spread": "7.7.4", - "@babel/plugin-proposal-optional-chaining": "7.7.4", - "@babel/plugin-syntax-dynamic-import": "7.7.4", - "@babel/plugin-transform-destructuring": "7.7.4", - "@babel/plugin-transform-flow-strip-types": "7.7.4", - "@babel/plugin-transform-react-display-name": "7.7.4", - "@babel/plugin-transform-runtime": "7.7.4", - "@babel/preset-env": "7.7.4", - "@babel/preset-react": "7.7.4", - "@babel/preset-typescript": "7.7.4", - "@babel/runtime": "7.7.4", - "babel-plugin-dynamic-import-node": "2.3.0", - "babel-plugin-macros": "2.7.1", + "@babel/core": "7.8.4", + "@babel/plugin-proposal-class-properties": "7.8.3", + "@babel/plugin-proposal-decorators": "7.8.3", + "@babel/plugin-proposal-numeric-separator": "7.8.3", + "@babel/plugin-transform-flow-strip-types": "7.8.3", + "@babel/plugin-transform-react-display-name": "7.8.3", + "@babel/plugin-transform-runtime": "7.8.3", + "@babel/preset-env": "7.8.4", + "@babel/preset-react": "7.8.3", + "@babel/preset-typescript": "7.8.3", + "@babel/runtime": "7.8.4", + "babel-plugin-macros": "2.8.0", "babel-plugin-transform-react-remove-prop-types": "0.4.24" }, "dependencies": { "@babel/core": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz", - "integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.4.tgz", + "integrity": "sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA==", "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.8.4", + "@babel/helpers": "^7.8.4", + "@babel/parser": "^7.8.4", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.4", + "@babel/types": "^7.8.3", "convert-source-map": "^1.7.0", "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", "json5": "^2.1.0", "lodash": "^4.17.13", "resolve": "^1.3.2", @@ -3017,131 +3474,74 @@ "source-map": "^0.5.0" } }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.7.4.tgz", - "integrity": "sha512-TbYHmr1Gl1UC7Vo2HVuj/Naci5BEGNZ0AJhzqD2Vpr6QPFWpUmBRLrIDjedzx7/CShq0bRDS2gI4FIs77VHLVQ==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz", - "integrity": "sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.7.4.tgz", - "integrity": "sha512-JmgaS+ygAWDR/STPe3/7y0lNlHgS+19qZ9aC06nYLwQ/XB7c0q5Xs+ksFU3EDnp9EiEsO0dnRAOKeyLHTZuW3A==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-chaining": "^7.7.4" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz", - "integrity": "sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz", - "integrity": "sha512-4jFMXI1Cu2aXbcXXl8Lr6YubCn6Oc7k9lLsu8v61TZh+1jny2BWmdtvY9zSUlLdGUvcy9DMAWyZEOqjsbeg/wA==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-react-display-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.7.4.tgz", - "integrity": "sha512-sBbIvqYkthai0X0vkD2xsAwluBp+LtNHH+/V4a5ydifmTtb8KOVOlrMIk/MYmIc4uTYDnjZUHQildYNo36SRJw==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/preset-env": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.7.4.tgz", - "integrity": "sha512-Dg+ciGJjwvC1NIe/DGblMbcGq1HOtKbw8RLl4nIjlfcILKEOkWT/vRqPpumswABEBVudii6dnVwrBtzD7ibm4g==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.4.tgz", + "integrity": "sha512-HihCgpr45AnSOHRbS5cWNTINs0TwaR8BS8xIIH+QwiW8cKL0llV91njQMpeMReEPVs+1Ao0x3RLEBLtt1hOq4w==", "requires": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.7.4", - "@babel/plugin-proposal-dynamic-import": "^7.7.4", - "@babel/plugin-proposal-json-strings": "^7.7.4", - "@babel/plugin-proposal-object-rest-spread": "^7.7.4", - "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.4", - "@babel/plugin-syntax-async-generators": "^7.7.4", - "@babel/plugin-syntax-dynamic-import": "^7.7.4", - "@babel/plugin-syntax-json-strings": "^7.7.4", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4", - "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", - "@babel/plugin-syntax-top-level-await": "^7.7.4", - "@babel/plugin-transform-arrow-functions": "^7.7.4", - "@babel/plugin-transform-async-to-generator": "^7.7.4", - "@babel/plugin-transform-block-scoped-functions": "^7.7.4", - "@babel/plugin-transform-block-scoping": "^7.7.4", - "@babel/plugin-transform-classes": "^7.7.4", - "@babel/plugin-transform-computed-properties": "^7.7.4", - "@babel/plugin-transform-destructuring": "^7.7.4", - "@babel/plugin-transform-dotall-regex": "^7.7.4", - "@babel/plugin-transform-duplicate-keys": "^7.7.4", - "@babel/plugin-transform-exponentiation-operator": "^7.7.4", - "@babel/plugin-transform-for-of": "^7.7.4", - "@babel/plugin-transform-function-name": "^7.7.4", - "@babel/plugin-transform-literals": "^7.7.4", - "@babel/plugin-transform-member-expression-literals": "^7.7.4", - "@babel/plugin-transform-modules-amd": "^7.7.4", - "@babel/plugin-transform-modules-commonjs": "^7.7.4", - "@babel/plugin-transform-modules-systemjs": "^7.7.4", - "@babel/plugin-transform-modules-umd": "^7.7.4", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", - "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/plugin-transform-object-super": "^7.7.4", - "@babel/plugin-transform-parameters": "^7.7.4", - "@babel/plugin-transform-property-literals": "^7.7.4", - "@babel/plugin-transform-regenerator": "^7.7.4", - "@babel/plugin-transform-reserved-words": "^7.7.4", - "@babel/plugin-transform-shorthand-properties": "^7.7.4", - "@babel/plugin-transform-spread": "^7.7.4", - "@babel/plugin-transform-sticky-regex": "^7.7.4", - "@babel/plugin-transform-template-literals": "^7.7.4", - "@babel/plugin-transform-typeof-symbol": "^7.7.4", - "@babel/plugin-transform-unicode-regex": "^7.7.4", - "@babel/types": "^7.7.4", - "browserslist": "^4.6.0", - "core-js-compat": "^3.1.1", + "@babel/compat-data": "^7.8.4", + "@babel/helper-compilation-targets": "^7.8.4", + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-proposal-async-generator-functions": "^7.8.3", + "@babel/plugin-proposal-dynamic-import": "^7.8.3", + "@babel/plugin-proposal-json-strings": "^7.8.3", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-proposal-object-rest-spread": "^7.8.3", + "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", + "@babel/plugin-proposal-optional-chaining": "^7.8.3", + "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.8.3", + "@babel/plugin-transform-arrow-functions": "^7.8.3", + "@babel/plugin-transform-async-to-generator": "^7.8.3", + "@babel/plugin-transform-block-scoped-functions": "^7.8.3", + "@babel/plugin-transform-block-scoping": "^7.8.3", + "@babel/plugin-transform-classes": "^7.8.3", + "@babel/plugin-transform-computed-properties": "^7.8.3", + "@babel/plugin-transform-destructuring": "^7.8.3", + "@babel/plugin-transform-dotall-regex": "^7.8.3", + "@babel/plugin-transform-duplicate-keys": "^7.8.3", + "@babel/plugin-transform-exponentiation-operator": "^7.8.3", + "@babel/plugin-transform-for-of": "^7.8.4", + "@babel/plugin-transform-function-name": "^7.8.3", + "@babel/plugin-transform-literals": "^7.8.3", + "@babel/plugin-transform-member-expression-literals": "^7.8.3", + "@babel/plugin-transform-modules-amd": "^7.8.3", + "@babel/plugin-transform-modules-commonjs": "^7.8.3", + "@babel/plugin-transform-modules-systemjs": "^7.8.3", + "@babel/plugin-transform-modules-umd": "^7.8.3", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", + "@babel/plugin-transform-new-target": "^7.8.3", + "@babel/plugin-transform-object-super": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.8.4", + "@babel/plugin-transform-property-literals": "^7.8.3", + "@babel/plugin-transform-regenerator": "^7.8.3", + "@babel/plugin-transform-reserved-words": "^7.8.3", + "@babel/plugin-transform-shorthand-properties": "^7.8.3", + "@babel/plugin-transform-spread": "^7.8.3", + "@babel/plugin-transform-sticky-regex": "^7.8.3", + "@babel/plugin-transform-template-literals": "^7.8.3", + "@babel/plugin-transform-typeof-symbol": "^7.8.4", + "@babel/plugin-transform-unicode-regex": "^7.8.3", + "@babel/types": "^7.8.3", + "browserslist": "^4.8.5", + "core-js-compat": "^3.6.2", "invariant": "^2.2.2", - "js-levenshtein": "^1.1.3", + "levenary": "^1.1.1", "semver": "^5.5.0" } }, - "@babel/preset-react": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.7.4.tgz", - "integrity": "sha512-j+vZtg0/8pQr1H8wKoaJyGL2IEk3rG/GIvua7Sec7meXVIvGycihlGMx5xcU00kqCJbwzHs18xTu3YfREOqQ+g==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-react-display-name": "^7.7.4", - "@babel/plugin-transform-react-jsx": "^7.7.4", - "@babel/plugin-transform-react-jsx-self": "^7.7.4", - "@babel/plugin-transform-react-jsx-source": "^7.7.4" - } - }, "@babel/runtime": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.4.tgz", - "integrity": "sha512-r24eVUUr0QqNZa+qrImUk8fn5SPhHq+IfYvIoIMg0do3GdK9sMdiLKP3GYVVaxpPKORgm8KRKaNTEhAjgIpLMw==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz", + "integrity": "sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==", "requires": { "regenerator-runtime": "^0.13.2" } @@ -3253,9 +3653,9 @@ } }, "base-x": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.7.tgz", - "integrity": "sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", "requires": { "safe-buffer": "^5.0.1" } @@ -3422,9 +3822,9 @@ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==" }, "browser-resolve": { "version": "1.11.3", @@ -3507,13 +3907,13 @@ } }, "browserslist": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.5.tgz", - "integrity": "sha512-4LMHuicxkabIB+n9874jZX/az1IaZ5a+EUuvD7KFOu9x/Bd5YHyO0DIz2ls/Kl8g0ItS4X/ilEgf4T1Br0lgSg==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.9.1.tgz", + "integrity": "sha512-Q0DnKq20End3raFulq6Vfp1ecB9fh8yUNV55s8sekaDDeqBaCtWlRHCUdaWyUeSSBJM7IbM6HcsyaeYqgeDhnw==", "requires": { - "caniuse-lite": "^1.0.30001022", - "electron-to-chromium": "^1.3.338", - "node-releases": "^1.1.46" + "caniuse-lite": "^1.0.30001030", + "electron-to-chromium": "^1.3.363", + "node-releases": "^1.1.50" } }, "bs58": { @@ -3543,9 +3943,9 @@ } }, "buffer": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", - "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.5.0.tgz", + "integrity": "sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww==", "requires": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" @@ -3689,9 +4089,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001022", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001022.tgz", - "integrity": "sha512-FjwPPtt/I07KyLPkBQ0g7/XuZg6oUkYBVnPHNj3VHJbOjmmJ/GdSo/GUY6MwINEQvjhP6WZVbX8Tvms8xh0D5A==" + "version": "1.0.30001032", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001032.tgz", + "integrity": "sha512-8joOm7BwcpEN4BfVHtfh0hBXSAPVYk+eUIcNntGtMkUWy/6AKRCDZINCLe3kB1vHhT2vBxBF85Hh9VlPXi/qjA==" }, "capture-exit": { "version": "2.0.0", @@ -3712,13 +4112,12 @@ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, "chardet": { @@ -4315,9 +4714,9 @@ } }, "chownr": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", - "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, "chrome-trace-event": { "version": "1.0.2", @@ -4363,9 +4762,9 @@ } }, "clean-css": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz", - "integrity": "sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", + "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", "requires": { "source-map": "~0.6.0" }, @@ -4447,6 +4846,52 @@ "@types/q": "^1.5.1", "chalk": "^2.4.1", "q": "^1.1.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "code-point-at": { @@ -4470,20 +4915,35 @@ "requires": { "color-convert": "^1.9.1", "color-string": "^1.5.2" + }, + "dependencies": { + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + } } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "color-string": { "version": "1.5.3", @@ -4737,11 +5197,6 @@ } } }, - "core-js-pure": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.4.tgz", - "integrity": "sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==" - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -4975,11 +5430,6 @@ } } }, - "css-unit-converter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz", - "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=" - }, "css-what": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.2.1.tgz", @@ -5088,9 +5538,9 @@ } }, "csstype": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.8.tgz", - "integrity": "sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA==" + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.9.tgz", + "integrity": "sha512-xz39Sb4+OaTsULgUERcCk+TJj8ylkL4aSVDQiX/ksxbELSqwkgt4d4RD7fovIdgJGSuNYqwZEiVjYY5l0ask+Q==" }, "currently-unhandled": { "version": "0.4.1", @@ -5116,9 +5566,9 @@ } }, "damerau-levenshtein": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz", - "integrity": "sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz", + "integrity": "sha512-JVrozIeElnj3QzfUIt8tB8YMluBJom4Vw9qTPpjGYQ9fYlB3D/rb6OordUxf3xeFB35LKWs0xqcO5U6ySvBtug==" }, "dashdash": { "version": "1.14.1", @@ -5339,9 +5789,9 @@ } }, "diff-sequences": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz", - "integrity": "sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==" + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.1.0.tgz", + "integrity": "sha512-nFIfVk5B/NStCsJ+zaPO4vYuLjlzQ6uFvPxzYyHlejNZ/UGa7G/n7peOXVrVNvRuyfstt+mZQYGpjxg9Z6N8Kw==" }, "diffie-hellman": { "version": "5.0.3", @@ -5460,11 +5910,11 @@ } }, "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", + "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", "requires": { - "is-obj": "^1.0.0" + "is-obj": "^2.0.0" } }, "dotenv": { @@ -5537,9 +5987,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.338", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.338.tgz", - "integrity": "sha512-wlmfixuHEc9CkfOKgcqdtzBmRW4NStM9ptl5oPILY2UDyHuSXb3Yit+yLVyLObTgGuMMU36hhnfs2GDJId7ctA==" + "version": "1.3.372", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.372.tgz", + "integrity": "sha512-77a4jYC52OdisHM+Tne7dgWEvQT1FoNu/jYl279pP88ZtG4ZRIPyhQwAKxj6C2rzsyC1OwsOds9JlZtNncSz6g==" }, "elliptic": { "version": "6.5.2", @@ -5561,9 +6011,9 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" }, "encodeurl": { "version": "1.0.2", @@ -5715,9 +6165,9 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.13.0.tgz", - "integrity": "sha512-eYk2dCkxR07DsHA/X2hRBj0CFAZeri/LyDMc0C8JT1Hqi6JnVpMhJ7XFITbb0+yZS3lVkaPL2oCkZ3AVmeVbMw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", + "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", "requires": { "esprima": "^4.0.1", "estraverse": "^4.2.0", @@ -5778,6 +6228,37 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -5794,6 +6275,11 @@ "type-fest": "^0.8.1" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "import-fresh": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", @@ -5817,13 +6303,21 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, "eslint-config-react-app": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-5.1.0.tgz", - "integrity": "sha512-hBaxisHC6HXRVvxX+/t1n8mOdmCVIKgkXsf2WoUkJi7upHJTwYTsdCmx01QPOjKNT34QMQQ9sL0tVBlbiMFjxA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-5.2.0.tgz", + "integrity": "sha512-WrHjoGpKr1kLLiWDD81tme9jMM0hk5cMxasLSdyno6DdPt+IfLOrDJBVo6jN7tn4y1nzhs43TmUaZWO6Sf0blw==", "requires": { "confusing-browser-globals": "^1.0.9" } @@ -5846,9 +6340,9 @@ } }, "resolve": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.2.tgz", - "integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", "requires": { "path-parse": "^1.0.6" } @@ -6164,12 +6658,12 @@ "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==" }, "espree": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", - "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.0.tgz", + "integrity": "sha512-Xs8airJ7RQolnDIbLtRutmfvSsAe0xqMMAantCN/GMoqf81TFbeI1T7Jpd56qYu1uuh32dOG5W/X9uO+ghPXzA==", "requires": { "acorn": "^7.1.0", - "acorn-jsx": "^5.1.0", + "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.1.0" } }, @@ -6179,9 +6673,9 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.1.0.tgz", + "integrity": "sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q==", "requires": { "estraverse": "^4.0.0" } @@ -6311,6 +6805,52 @@ "jest-matcher-utils": "^24.9.0", "jest-message-util": "^24.9.0", "jest-regex-util": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + } } }, "express": { @@ -6664,9 +7204,9 @@ "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==" }, "figures": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", - "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "requires": { "escape-string-regexp": "^1.0.5" } @@ -6848,6 +7388,14 @@ "worker-rpc": "^0.1.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -6875,6 +7423,29 @@ } } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -6896,6 +7467,11 @@ } } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -6944,6 +7520,14 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -7181,6 +7765,11 @@ "globule": "^1.0.0" } }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==" + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -7301,13 +7890,13 @@ } }, "globule": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.0.tgz", - "integrity": "sha512-YlD4kdMqRCQHrhVdonet4TdRtv1/sZKepvoxNT4Nrhrp5HI8XFfc8kFlGlBn2myBo80aGp8Eft259mbcUJhgSg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.1.tgz", + "integrity": "sha512-OVyWOHgw29yosRHCHo7NncwR1hW5ew0W/UrvtwvjefVJeQ26q4/8r8FmPsSF1hJ93IgWkyv16pCTz6WblMzm/g==", "dev": true, "requires": { "glob": "~7.1.1", - "lodash": "~4.17.10", + "lodash": "~4.17.12", "minimatch": "~3.0.2" } }, @@ -7385,9 +7974,9 @@ } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "has-symbols": { "version": "1.0.1", @@ -7486,17 +8075,17 @@ } }, "hoist-non-react-statics": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", - "integrity": "sha512-wbg3bpgA/ZqWrZuMOeJi8+SKMhr7X9TesL/rXMjTzh0p0JUBo3II8DHboYbuIXWRlttrUFxwcu/5kygrCw8fJw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", "requires": { "react-is": "^16.7.0" } }, "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" }, "hpack.js": { "version": "2.1.6", @@ -7834,23 +8423,33 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "inquirer": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.3.tgz", - "integrity": "sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.6.tgz", + "integrity": "sha512-7SVO4h+QIdMq6XcqIqrNte3gS5MzCCKZdsq9DO4PJziBFNYzP3PGFbDjgadDb//MCahzgjCxvQ/O2wa7kx9o4w==", "requires": { "ansi-escapes": "^4.2.1", - "chalk": "^2.4.2", + "chalk": "^3.0.0", "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", "figures": "^3.0.0", "lodash": "^4.17.15", "mute-stream": "0.0.8", - "run-async": "^2.2.0", + "run-async": "^2.4.0", "rxjs": "^6.5.3", "string-width": "^4.1.0", - "strip-ansi": "^5.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "internal-ip": { @@ -7886,9 +8485,9 @@ "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" }, "ipaddr.js": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", - "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, "is-absolute-url": { "version": "2.1.0", @@ -7998,13 +8597,10 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -8030,9 +8626,9 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" }, "is-path-cwd": { "version": "1.0.0", @@ -8134,9 +8730,9 @@ "dev": true }, "is-what": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.5.1.tgz", - "integrity": "sha512-NHeqazf97ZVerGNEDmYG4+J4UY3uDQOjaJNMIMXw2i/tFfMconSgSK8Z27Y4VWMbM96E9ylroUSnD7jXRjzBwA==" + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.6.0.tgz", + "integrity": "sha512-2rMAWmuDACWgcy5Cp4eDXHRf4GlNjXKp3e/0etFzE5HZhCgPw8u5zeKDyLIUmtE2GP9mGK3jS7jvXYFc6qk/ZA==" }, "is-windows": { "version": "1.0.2", @@ -8197,6 +8793,11 @@ "supports-color": "^6.1.0" }, "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -8256,6 +8857,60 @@ "jest-cli": "^24.9.0" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "jest-cli": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.9.0.tgz", @@ -8275,6 +8930,14 @@ "realpath-native": "^1.1.0", "yargs": "^13.3.0" } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -8286,6 +8949,26 @@ "@jest/types": "^24.9.0", "execa": "^1.0.0", "throat": "^4.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "jest-config": { @@ -8312,6 +8995,37 @@ "realpath-native": "^1.1.0" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -8339,6 +9053,29 @@ } } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -8360,6 +9097,11 @@ } } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -8378,6 +9120,11 @@ } } }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -8403,6 +9150,25 @@ "to-regex": "^3.0.2" } }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -8415,14 +9181,14 @@ } }, "jest-diff": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz", - "integrity": "sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==", + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.1.0.tgz", + "integrity": "sha512-nepXgajT+h017APJTreSieh4zCqnSHEJ1iT8HDlewu630lSJ4Kjjr9KNzm+kzGwwcpsDE6Snx1GJGzzsefaEHw==", "requires": { - "chalk": "^2.0.1", - "diff-sequences": "^24.9.0", - "jest-get-type": "^24.9.0", - "pretty-format": "^24.9.0" + "chalk": "^3.0.0", + "diff-sequences": "^25.1.0", + "jest-get-type": "^25.1.0", + "pretty-format": "^25.1.0" } }, "jest-docblock": { @@ -8443,6 +9209,91 @@ "jest-get-type": "^24.9.0", "jest-util": "^24.9.0", "pretty-format": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-environment-jsdom": { @@ -8456,6 +9307,26 @@ "jest-mock": "^24.9.0", "jest-util": "^24.9.0", "jsdom": "^11.5.1" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "jest-environment-jsdom-fourteen": { @@ -8541,12 +9412,32 @@ "@jest/types": "^24.9.0", "jest-mock": "^24.9.0", "jest-util": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "jest-get-type": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", - "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.1.0.tgz", + "integrity": "sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw==" }, "jest-haste-map": { "version": "24.9.0", @@ -8567,6 +9458,24 @@ "walker": "^1.0.7" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -9180,6 +10089,86 @@ "jest-util": "^24.9.0", "pretty-format": "^24.9.0", "throat": "^4.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-leak-detector": { @@ -9189,6 +10178,68 @@ "requires": { "jest-get-type": "^24.9.0", "pretty-format": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + } } }, "jest-matcher-utils": { @@ -9200,6 +10251,107 @@ "jest-diff": "^24.9.0", "jest-get-type": "^24.9.0", "pretty-format": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "diff-sequences": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz", + "integrity": "sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "jest-diff": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz", + "integrity": "sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==", + "requires": { + "chalk": "^2.0.1", + "diff-sequences": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-message-util": { @@ -9217,6 +10369,32 @@ "stack-utils": "^1.0.1" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -9244,6 +10422,29 @@ } } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -9265,6 +10466,11 @@ } } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -9308,6 +10514,14 @@ "to-regex": "^3.0.2" } }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -9325,6 +10539,26 @@ "integrity": "sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w==", "requires": { "@jest/types": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "jest-pnp-resolver": { @@ -9347,6 +10581,70 @@ "chalk": "^2.0.1", "jest-pnp-resolver": "^1.2.1", "realpath-native": "^1.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-resolve-dependencies": { @@ -9357,6 +10655,26 @@ "@jest/types": "^24.9.0", "jest-regex-util": "^24.3.0", "jest-snapshot": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + } } }, "jest-runner": { @@ -9383,6 +10701,70 @@ "jest-worker": "^24.6.0", "source-map-support": "^0.5.6", "throat": "^4.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-runtime": { @@ -9413,6 +10795,70 @@ "slash": "^2.0.0", "strip-bom": "^3.0.0", "yargs": "^13.3.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-serializer": { @@ -9438,6 +10884,107 @@ "natural-compare": "^1.4.0", "pretty-format": "^24.9.0", "semver": "^6.2.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "diff-sequences": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz", + "integrity": "sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "jest-diff": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz", + "integrity": "sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==", + "requires": { + "chalk": "^2.0.1", + "diff-sequences": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-util": { @@ -9459,15 +11006,77 @@ "source-map": "^0.6.0" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -9482,6 +11091,91 @@ "jest-get-type": "^24.9.0", "leven": "^3.1.0", "pretty-format": "^24.9.0" + }, + "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "jest-watch-typeahead": { @@ -9497,6 +11191,42 @@ "strip-ansi": "^5.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -9510,6 +11240,14 @@ "astral-regex": "^1.0.0", "strip-ansi": "^5.2.0" } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -9527,10 +11265,72 @@ "string-length": "^2.0.0" }, "dependencies": { + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/yargs": { + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", + "requires": { + "@types/yargs-parser": "*" + } + }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -9543,6 +11343,11 @@ "supports-color": "^6.1.0" }, "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -9554,16 +11359,11 @@ } }, "js-base64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", - "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz", + "integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==", "dev": true }, - "js-levenshtein": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", - "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -9758,9 +11558,9 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==" }, "levenary": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.0.tgz", - "integrity": "sha512-VHcwhO0UTpUW7rLPN2/OiWJdgA1e9BqEDALhrgCe/F+uUJnep6CoUsTzMeP8Rh0NGr9uKquXxqe7lwLZo509nQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", + "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", "requires": { "leven": "^3.1.0" } @@ -9855,12 +11655,12 @@ "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==" }, "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", "requires": { "big.js": "^5.2.2", - "emojis-list": "^2.0.0", + "emojis-list": "^3.0.0", "json5": "^1.0.1" }, "dependencies": { @@ -9926,9 +11726,9 @@ "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, "loglevel": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.6.tgz", - "integrity": "sha512-Sgr5lbboAUBo3eXCSPL4/KoVz3ROKquOjcctxmHIt+vol2DrqTQe3SwkKKuYhEiWB5kYa13YyopJ69deJ1irzQ==" + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.7.tgz", + "integrity": "sha512-cY2eLFrQSAfVPhCgH1s7JI73tMbg9YC3v3+ZHVW67sBS7UxWzNEk/ZBbSfLykBWHp33dqqtOv82gjhKEi81T/A==" }, "loose-envify": { "version": "1.4.0", @@ -10647,9 +12447,9 @@ } }, "node-releases": { - "version": "1.1.47", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.47.tgz", - "integrity": "sha512-k4xjVPx5FpwBUj0Gw7uvFOTF4Ep8Hok1I6qjwL3pLfwe7Y0REQSAqOwwv9TWBCUtMHxcXfY4PgRLRozcChvTcA==", + "version": "1.1.50", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.50.tgz", + "integrity": "sha512-lgAmPv9eYZ0bGwUYAKlr8MG6K4CvWliWqnkcT2P8mMAgVrH3lqfBPorFlxiG1pHQnqmavJZ9vbMXUTNyMLbrgQ==", "requires": { "semver": "^6.3.0" } @@ -11136,9 +12936,9 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", - "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==" + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "parallel-transform": { "version": "1.2.0", @@ -11440,15 +13240,61 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", + "version": "7.0.27", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.27.tgz", + "integrity": "sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", "supports-color": "^6.1.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11465,29 +13311,12 @@ } }, "postcss-attribute-case-insensitive": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.1.tgz", - "integrity": "sha512-L2YKB3vF4PetdTIthQVeT+7YiSzMoNMLLYxPXXppOOP7NoazEAy45sh2LvJ8leCQjfBcfkYQs8TtCcQjeZTp8A==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.2.tgz", + "integrity": "sha512-clkFxk/9pcdb4Vkn0hAHq3YnxBQ2p0CGD1dy24jN+reBck+EWxMbxSUqN4Yj7t0w8csl87K6p0gxBe1utkJsYA==", "requires": { "postcss": "^7.0.2", - "postcss-selector-parser": "^5.0.0" - }, - "dependencies": { - "cssesc": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", - "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" - }, - "postcss-selector-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", - "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", - "requires": { - "cssesc": "^2.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } + "postcss-selector-parser": "^6.0.2" } }, "postcss-browser-comments": { @@ -11499,30 +13328,19 @@ } }, "postcss-calc": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.1.tgz", - "integrity": "sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.2.tgz", + "integrity": "sha512-rofZFHUg6ZIrvRwPeFktv06GdbDYLcGqh9EwiMutZg+a0oePCCw1zHOEiji6LCpyRcjTREtPASuUqeAvYlEVvQ==", "requires": { - "css-unit-converter": "^1.1.1", - "postcss": "^7.0.5", - "postcss-selector-parser": "^5.0.0-rc.4", - "postcss-value-parser": "^3.3.1" + "postcss": "^7.0.27", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.0.2" }, "dependencies": { - "cssesc": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", - "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" - }, - "postcss-selector-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", - "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", - "requires": { - "cssesc": "^2.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } + "postcss-value-parser": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz", + "integrity": "sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg==" } } }, @@ -11842,11 +13660,11 @@ }, "dependencies": { "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", "requires": { - "dot-prop": "^4.1.1", + "dot-prop": "^5.2.0", "indexes-of": "^1.0.1", "uniq": "^1.0.1" } @@ -11898,11 +13716,11 @@ }, "dependencies": { "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", "requires": { - "dot-prop": "^4.1.1", + "dot-prop": "^5.2.0", "indexes-of": "^1.0.1", "uniq": "^1.0.1" } @@ -12293,14 +14111,14 @@ } }, "pretty-format": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", - "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.1.0.tgz", + "integrity": "sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ==", "requires": { - "@jest/types": "^24.9.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" + "@jest/types": "^25.1.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" } }, "private": { @@ -12324,9 +14142,9 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" }, "promise": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/promise/-/promise-8.0.3.tgz", - "integrity": "sha512-HeRDUL1RJiLhyA0/grn+PTShlBAcLuh/1BJGtrvjwbvRDCTLLMEz9rOGCV+R3vHY4MixIuoMEd9Yq/XvsTPcjw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.1.0.tgz", + "integrity": "sha512-W04AqnILOL/sPRXziNicCjSNRruLAuIHEOVBazepu0545DDNGYHz7ar9ZgZ1fMU8/MA4mVxp5rkBWRi6OXIy3Q==", "requires": { "asap": "~2.0.6" } @@ -12337,12 +14155,12 @@ "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" }, "prompts": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.0.tgz", - "integrity": "sha512-NfbbPPg/74fT7wk2XYQ7hAIp9zJyZp5Fu19iRbORqqy1BhtrkZ0fPafBU+7bmn8ie69DpT0R6QpJIN2oisYjJg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.1.tgz", + "integrity": "sha512-qIP2lQyCwYbdzcqHIUi2HAxiWixhoM9OdLCWf8txXsapC/X9YdsCoeyRIXE/GP+Q0J37Q7+XN/MFqbUa7IzXNA==", "requires": { "kleur": "^3.0.3", - "sisteransi": "^1.0.3" + "sisteransi": "^1.0.4" } }, "prop-types": { @@ -12366,12 +14184,12 @@ } }, "proxy-addr": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", - "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.9.0" + "ipaddr.js": "1.9.1" } }, "prr": { @@ -12521,9 +14339,9 @@ } }, "react": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react/-/react-16.12.0.tgz", - "integrity": "sha512-fglqy3k5E+81pA8s+7K0/T3DBCF0ZDOher1elBFzF7O6arXJgzyu/FW+COxFvAWXJoJN9KIZbT2LXlukwphYTA==", + "version": "16.13.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.13.0.tgz", + "integrity": "sha512-TSavZz2iSLkq5/oiE7gnFzmURKZMltmi193rm5HEoUDAXpzT9Kzw6oNZnGoai/4+fUnm7FqS5dwgUL34TujcWQ==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -12531,11 +14349,11 @@ } }, "react-app-polyfill": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/react-app-polyfill/-/react-app-polyfill-1.0.5.tgz", - "integrity": "sha512-RcbV6+msbvZJZUIK/LX3UafPtoaDSJgUWu4sqBxHKTVmBsnlU2QWCKJRBRmgjxu+ivW/GPINbPWRM4Ppa6Lbgw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/react-app-polyfill/-/react-app-polyfill-1.0.6.tgz", + "integrity": "sha512-OfBnObtnGgLGfweORmdZbyEz+3dgVePQBb3zipiaDsMHV1NpWm0rDFYIVXFV/AK+x4VIIfWHhrdMIeoTLyRr2g==", "requires": { - "core-js": "^3.4.1", + "core-js": "^3.5.0", "object-assign": "^4.1.1", "promise": "^8.0.3", "raf": "^3.4.1", @@ -12593,6 +14411,14 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "browserslist": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.0.tgz", @@ -12603,6 +14429,16 @@ "node-releases": "^1.1.29" } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -12611,6 +14447,24 @@ "restore-cursor": "^2.0.0" } }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -12619,6 +14473,11 @@ "escape-string-regexp": "^1.0.5" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "inquirer": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz", @@ -12644,6 +14503,24 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + } + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -12689,29 +14566,37 @@ } } } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } } } }, "react-dom": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.12.0.tgz", - "integrity": "sha512-LMxFfAGrcS3kETtQaCkTKjMiifahaMySFDn71fZUNpPHZQEzmk/GiAeIT8JSOrHB23fnuCOMruL2a8NYlw+8Gw==", + "version": "16.13.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.0.tgz", + "integrity": "sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.18.0" + "scheduler": "^0.19.0" } }, "react-error-overlay": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.4.tgz", - "integrity": "sha512-ueZzLmHltszTshDMwyfELDq8zOA803wQ1ZuzCccXa1m57k1PxSHfflPD5W9YIiTXLs0JTLzoj6o1LuM5N6zzNA==" + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.6.tgz", + "integrity": "sha512-Yzpno3enVzSrSCnnljmr4b/2KUQSMZaPuqmS26t9k4nW7uwJk6STWmH9heNjPuvqUTO3jOSPkHoKgO4+Dw7uIw==" }, "react-is": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", - "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==" + "version": "16.13.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.0.tgz", + "integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==" }, "react-outside-click-handler": { "version": "1.3.0", @@ -12726,13 +14611,12 @@ } }, "react-redux": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.1.3.tgz", - "integrity": "sha512-uI1wca+ECG9RoVkWQFF4jDMqmaw0/qnvaSvOoL/GA4dNxf6LoV8sUAcNDvE5NWKs4hFpn0t6wswNQnY3f7HT3w==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz", + "integrity": "sha512-EvCAZYGfOLqwV7gh849xy9/pt55rJXPwmYvI4lilPM5rUT/1NxuuN59ipdBksRVSvz0KInbPnp4IfoXJXCqiDA==", "requires": { "@babel/runtime": "^7.5.5", "hoist-non-react-statics": "^3.3.0", - "invariant": "^2.2.4", "loose-envify": "^1.4.0", "prop-types": "^15.7.2", "react-is": "^16.9.0" @@ -12831,9 +14715,9 @@ } }, "readable-stream": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", - "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -13014,6 +14898,25 @@ "symbol-observable": "^1.2.0" } }, + "redux-devtools": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/redux-devtools/-/redux-devtools-3.5.0.tgz", + "integrity": "sha512-pGU8TZNvWxPaCCE432AGm6H6alQbAz80gQM5CzM3SjX9/oSNu/HPF17xFdPQJOXasqyih1Gv167kZDTRe7r0iQ==", + "requires": { + "lodash": "^4.2.0", + "prop-types": "^15.5.7", + "redux-devtools-instrument": "^1.9.0" + } + }, + "redux-devtools-instrument": { + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/redux-devtools-instrument/-/redux-devtools-instrument-1.9.6.tgz", + "integrity": "sha512-MwvY4cLEB2tIfWWBzrUR02UM9qRG2i7daNzywRvabOSVdvAY7s9BxSwMmVRH1Y/7QWjplNtOwgT0apKhHg2Qew==", + "requires": { + "lodash": "^4.2.0", + "symbol-observable": "^1.0.2" + } + }, "redux-thunk": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz", @@ -13038,16 +14941,17 @@ } }, "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==" + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.4.tgz", + "integrity": "sha512-plpwicqEzfEyTQohIKktWigcLzmNStMGwbOUbykx51/29Z3JOGYldaaNGK7ngNXV+UcoqvIMmloZ48Sr74sd+g==" }, "regenerator-transform": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz", - "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==", + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.2.tgz", + "integrity": "sha512-V4+lGplCM/ikqi5/mkkpJ06e9Bujq1NFmNLvsCs56zg3ZbzrnUzAtizZ24TXxtRX/W2jcdScwQCnbL0CICTFkQ==", "requires": { - "private": "^0.1.6" + "@babel/runtime": "^7.8.4", + "private": "^0.1.8" } }, "regex-not": { @@ -13097,9 +15001,9 @@ "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==" }, "regjsparser": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.2.tgz", - "integrity": "sha512-E9ghzUtoLwDekPT0DYCp+c4h+bvuUpe6rRHCTYn6eGoqj1LgKXxT6I0Il4WbjhQkOghzi/V+y03bPKvbllL93Q==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.3.tgz", + "integrity": "sha512-8uZvYbnfAtEm9Ab8NTb3hdLwL4g/LQzEYP7Xs27T96abJCCE2d6r3cPZPQEsLKy0vRSGVNG+/zVGtLr86HQduA==", "requires": { "jsesc": "~0.5.0" }, @@ -13193,9 +15097,9 @@ } }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -13204,7 +15108,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -13214,25 +15118,9 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - } } }, "request-promise-core": { @@ -13311,11 +15199,52 @@ "source-map": "0.6.1" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "convert-source-map": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", @@ -13324,6 +15253,34 @@ "safe-buffer": "~5.1.1" } }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + } + }, "postcss": { "version": "7.0.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.14.tgz", @@ -13422,9 +15379,9 @@ "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==" }, "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", "requires": { "is-promise": "^2.1.0" } @@ -13884,9 +15841,9 @@ } }, "scheduler": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.18.0.tgz", - "integrity": "sha512-agTSHR1Nbfi6ulI0kYNK0203joW2Y5W4po4l+v03tOoiJKpTBbxpNhWDvqc/4IcOw+KLmSiQLTasZ4cab2/UWQ==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.0.tgz", + "integrity": "sha512-xowbVaTPe9r7y7RUejcK73/j8tt2jfiyTednOvHbA8JoClvMYCp+r8QegLwK/n8zWQAtZb1fFnER4XLBZXrCxA==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -14183,6 +16140,27 @@ "is-fullwidth-code-point": "^2.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -14720,11 +16698,6 @@ "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", @@ -14769,6 +16742,13 @@ "get-own-enumerable-property-symbols": "^3.0.0", "is-obj": "^1.0.1", "is-regexp": "^1.0.0" + }, + "dependencies": { + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + } } }, "strip-ansi": { @@ -14777,6 +16757,13 @@ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "requires": { "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + } } }, "strip-bom": { @@ -14850,6 +16837,21 @@ "stylis": "^3.5.0", "stylis-rule-sheet": "^0.0.10", "supports-color": "^5.5.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "stylehacks": { @@ -14863,11 +16865,11 @@ }, "dependencies": { "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz", + "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==", "requires": { - "dot-prop": "^4.1.1", + "dot-prop": "^5.2.0", "indexes-of": "^1.0.1", "uniq": "^1.0.1" } @@ -14885,17 +16887,17 @@ "integrity": "sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw==" }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, "svg-parser": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.3.tgz", - "integrity": "sha512-fnCWiifNhK8i2Z7b9R5tbNahpxrRdAaQbnoxKlT2KrSCj9Kq/yBSgulCRgBJRhy1dPnSY5slg5ehPUnzpEcHlg==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", + "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "svgo": { "version": "1.3.2", @@ -14915,6 +16917,52 @@ "stable": "^0.1.8", "unquote": "~1.1.1", "util.promisify": "~1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "symbol-observable": { @@ -14977,9 +17025,9 @@ } }, "terser": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz", - "integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==", + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.6.tgz", + "integrity": "sha512-4lYPyeNmstjIIESr/ysHg2vUPRGf2tzF9z2yYwnowXVuVzLEamPN1Gfrz7f8I9uEPuHcbFlW4PLIAsJoxXyJ1g==", "requires": { "commander": "^2.20.0", "source-map": "~0.6.1", @@ -15191,9 +17239,9 @@ "integrity": "sha512-1J/vefLC+BWSo+qe8OnJQfWTYRS6ingxjwqmHMqaMxXMj7kFtKLgAaYW3JeX3mktjgUL+etlU8/B4VUAUI9QGw==" }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" }, "tsutils": { "version": "3.17.1", @@ -15539,9 +17587,9 @@ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, "vendors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.3.tgz", - "integrity": "sha512-fOi47nsJP5Wqefa43kyWSg80qF+Q3XA6MUkgi7Hp1HQaKDQW4cQrK2D0P7mmbFtsV1N89am55Yru/nyEwRubcw==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz", + "integrity": "sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w==" }, "verror": { "version": "1.10.0", @@ -15559,11 +17607,11 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "requires": { - "browser-process-hrtime": "^0.1.2" + "browser-process-hrtime": "^1.0.0" } }, "w3c-xmlserializer": { @@ -15906,6 +17954,11 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, "http-proxy-middleware": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", @@ -16436,6 +18489,27 @@ "strip-ansi": "^5.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -16528,11 +18602,11 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yaml": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.7.2.tgz", - "integrity": "sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.8.0.tgz", + "integrity": "sha512-6qI/tTx7OVtA4qNqD0OyutbM6Z9EKu4rxWm/2Y3FDEBQ4/2X2XAnyuRXMzAE2+1BPyqzksJZtrIwblOHg0IEzA==", "requires": { - "@babel/runtime": "^7.6.3" + "@babel/runtime": "^7.8.7" } }, "yamljs": { diff --git a/tools/webide/packages/server/package-lock.json b/tools/webide/packages/server/package-lock.json index d700b73d3..ca7ad506b 100644 --- a/tools/webide/packages/server/package-lock.json +++ b/tools/webide/packages/server/package-lock.json @@ -14,18 +14,18 @@ } }, "@babel/core": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.3.tgz", - "integrity": "sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.7.tgz", + "integrity": "sha512-rBlqF3Yko9cynC5CCFy6+K/w2N+Sq/ff2BPy+Krp7rHlABIr5epbA7OxVeKoMHB39LZOp1UY5SuLjy6uWi35yA==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", - "@babel/helpers": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/generator": "^7.8.7", + "@babel/helpers": "^7.8.4", + "@babel/parser": "^7.8.7", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -51,12 +51,12 @@ } }, "@babel/generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.3.tgz", - "integrity": "sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.7.tgz", + "integrity": "sha512-DQwjiKJqH4C3qGiyQCAExJHoZssn49JTMJgZ8SANGgVFdkupcUhLOdkAeoC6kmHZCPfoDG5M0b6cFlSN5wW7Ew==", "dev": true, "requires": { - "@babel/types": "^7.8.3", + "@babel/types": "^7.8.7", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -106,13 +106,13 @@ } }, "@babel/helpers": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.3.tgz", - "integrity": "sha512-LmU3q9Pah/XyZU89QvBgGt+BCsTPoQa+73RxAQh8fb8qkDyIfeQnmgs+hvzhTCKTzqOyk7JTkS3MS1S8Mq5yrQ==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", + "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", "dev": true, "requires": { "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", + "@babel/traverse": "^7.8.4", "@babel/types": "^7.8.3" } }, @@ -128,9 +128,9 @@ } }, "@babel/parser": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.3.tgz", - "integrity": "sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.7.tgz", + "integrity": "sha512-9JWls8WilDXFGxs0phaXAZgpxTZhSk/yOYH2hTHC0X1yC7Z78IJfvR1vJ+rmJKq3I35td2XzXzN6ZLYlna+r/A==", "dev": true }, "@babel/plugin-syntax-object-rest-spread": { @@ -143,37 +143,37 @@ } }, "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" } }, "@babel/traverse": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.3.tgz", - "integrity": "sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.6.tgz", + "integrity": "sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.3", + "@babel/generator": "^7.8.6", "@babel/helper-function-name": "^7.8.3", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.7.tgz", + "integrity": "sha512-k2TreEHxFA4CjGkL+GYjRyx35W0Mr7DP5+9q6WMkyKXB+904bYmG40syjMFV0oLlhhFCwWl0vA0DyzTDkwAiJw==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -182,9 +182,9 @@ } }, "@cnakazawa/watch": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz", - "integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", + "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", "dev": true, "requires": { "exec-sh": "^0.3.2", @@ -192,9 +192,9 @@ } }, "@google-cloud/common": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.3.0.tgz", - "integrity": "sha512-nmIyi3q/FL2j6ZJ61xK/863DoJEZayI2/W/iCgwrCYUYsem277XO45MBTAimjgiKBCA0c9InmQyfT48h/IK4jg==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.4.0.tgz", + "integrity": "sha512-zWFjBS35eI9leAHhjfeOYlK5Plcuj/77EzstnrJIZbKgF/nkqjcQuGiMCpzCwOfPyUbz8ZaEOYgbHa759AKbjg==", "requires": { "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", @@ -227,9 +227,9 @@ "integrity": "sha512-VccZDcOql77obTnFh0TbNED/6ZbbmHDf8UMNnzO1d5g9V0Htfm4k5cllY8P1tJsRKC3zWYGRLaViiupcgVjBoQ==" }, "@google-cloud/storage": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-4.3.0.tgz", - "integrity": "sha512-ph0jsUsZ9FPtN40V5eIkKPLUmxnTpxqBDkWxStW/kbQZgoNVGW9vJcbsYSyE4ath7jQIpM4OHu6aqmPFX1OnGw==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-4.5.0.tgz", + "integrity": "sha512-ZLFcR6CiP1AnYBA9eTtASF9Dy3wjYmGx+HZiy/LsIPN41wyBTn9yAjIOxRHiteqzX3uQzZ+VJNCB/DmTU33CeQ==", "requires": { "@google-cloud/common": "^2.1.1", "@google-cloud/paginator": "^2.0.0", @@ -266,9 +266,9 @@ "integrity": "sha512-UFbtbGPjstz0eWHb+ga/GM3Z9EzqKXFWIbSOFURU0A/Gku0Bky4bCk9/h//K2Xr3IrCfjFNhMm4jyZ5dbCewGA==" }, "@hapi/hoek": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.0.tgz", - "integrity": "sha512-7XYT10CZfPsH7j9F1Jmg1+d0ezOux2oM2GfArAzLwWe4mE2Dr3hVjsAL6+TFY49RRJlCdJDMw3nJsLFroTc8Kw==" + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.1.tgz", + "integrity": "sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow==" }, "@hapi/joi": { "version": "16.1.7", @@ -477,36 +477,21 @@ } }, "@taquito/http-utils": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-5.1.0-beta.1.tgz", - "integrity": "sha512-/UvE61t9j5CR94vy8Dtb+/6oJERE0P9LmHBbkESKUxNC9SAlETCEntSNiHha+vuwgCoOj0pXsHkBtAZkWAaEeg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-6.1.0-beta.0.tgz", + "integrity": "sha512-qQg/siOh3Vrj4lYbRGuHXKLgd8Or/5upJ2LgP8Y+i6X0n/uBsE6lnwGD8JCHWt644tvhEuf53j7DJI13blLaKg==", "requires": { "xhr2-cookies": "^1.1.0" } }, - "@taquito/indexer": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/indexer/-/indexer-5.1.0-beta.1.tgz", - "integrity": "sha512-NDWK7XQGgUP0YkEWhJklF9uhKHZDWtRaAPSsSfxSDYiQzol4iAUn7ru7+TQPNqfsXq0NjpvzGHBysQ8HTeb0Gg==", - "requires": { - "@taquito/http-utils": "^5.1.0-beta.1", - "bignumber.js": "^9.0.0" - }, - "dependencies": { - "bignumber.js": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", - "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" - } - } - }, "@taquito/michelson-encoder": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/michelson-encoder/-/michelson-encoder-5.1.0-beta.1.tgz", - "integrity": "sha512-kBpHDfsvsxzsIXbM4dOZs0nklY7CjCunSJ2sABUdBu4SmXDM06F5NDzg0166q7VBhFZgOhq/NNM9g7hcgn5qJg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/michelson-encoder/-/michelson-encoder-6.1.0-beta.0.tgz", + "integrity": "sha512-02CHk0Ag7pBLCDIJnAKXPp4Owcl3qLkIKB8pQa5uOT1fxefaT2EadMnxQEpbXPiFp4tcBRJq16Bd4JtogO+/CQ==", "requires": { - "@taquito/utils": "^5.1.0-beta.1", - "bignumber.js": "^9.0.0" + "@taquito/utils": "^6.1.0-beta.0", + "bignumber.js": "^9.0.0", + "fast-json-stable-stringify": "^2.1.0" }, "dependencies": { "bignumber.js": { @@ -517,11 +502,11 @@ } }, "@taquito/rpc": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-5.1.0-beta.1.tgz", - "integrity": "sha512-ZbqpJVZw1ljAS92Xs9t/1BAgPEMzOv3qk7ubWU7AGZOKDLREjOqI4EAZQfq4gL9hP2KIgqgLubTvPF3GsmTADg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-6.1.0-beta.0.tgz", + "integrity": "sha512-umpiFpasPIVNuRUkrlOi2Z3tOHQ1p6MU0AI3xRUdoUf2Hhn7tWN1CsFzQzm87LekVz1kW7Dogkwc5hD4gsIPZg==", "requires": { - "@taquito/http-utils": "^5.1.0-beta.1", + "@taquito/http-utils": "^6.1.0-beta.0", "bignumber.js": "^9.0.0", "lodash": "^4.17.15" }, @@ -534,11 +519,11 @@ } }, "@taquito/signer": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/signer/-/signer-5.1.0-beta.1.tgz", - "integrity": "sha512-N7ZteHnXv2kS+CCxbmQ+Br21aIf8cwP/WGAjwOh0uMUcXg2qsmKE/0XnRYnLhftVaJolNo85oBckYnA6U48uCg==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/signer/-/signer-6.1.0-beta.0.tgz", + "integrity": "sha512-/N5X+e029r5xJ8/LCdRqzBMh3or0n3BL2m15CRsZdhH21n8I1SHRh7vqXG/jDHLqB7i47lWW6rb5V2Pql2q0og==", "requires": { - "@taquito/utils": "^5.1.0-beta.1", + "@taquito/utils": "^6.1.0-beta.0", "bignumber.js": "^9.0.0", "bip39": "^3.0.2", "elliptic": "^6.5.1", @@ -555,15 +540,14 @@ } }, "@taquito/taquito": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/taquito/-/taquito-5.1.0-beta.1.tgz", - "integrity": "sha512-hLV7vZiraMlx+Not3dRdELNSwxd0ZLndRGGDBh+uexpo1aH7xX5IQbIgQBREaR1F7fqHswxBBCKcBbrGhP5EWQ==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/taquito/-/taquito-6.1.0-beta.0.tgz", + "integrity": "sha512-gln8L2w4jYPj5PY2sCld5J8b5i+so7qUnGbVtoWIvqURfLSxIzLhhGDCMoSqJaJnjWWDQcsE88398TbCLjZJxQ==", "requires": { - "@taquito/indexer": "^5.1.0-beta.1", - "@taquito/michelson-encoder": "^5.1.0-beta.1", - "@taquito/rpc": "^5.1.0-beta.1", - "@taquito/signer": "^5.1.0-beta.1", - "@taquito/utils": "^5.1.0-beta.1", + "@taquito/michelson-encoder": "^6.1.0-beta.0", + "@taquito/rpc": "^6.1.0-beta.0", + "@taquito/signer": "^6.1.0-beta.0", + "@taquito/utils": "^6.1.0-beta.0", "bignumber.js": "^9.0.0", "rxjs": "^6.5.3" }, @@ -576,15 +560,20 @@ } }, "@taquito/utils": { - "version": "5.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-5.1.0-beta.1.tgz", - "integrity": "sha512-3Qk+RLYKNYUW3jj1HYH0KymQQjWXdMcsp08eG+Cc0LKDvwzC5ewd4tfeUwq/jfHsd1fQ9LsG5FJ3NZg93W0H6w==", + "version": "6.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-6.1.0-beta.0.tgz", + "integrity": "sha512-RaqVw1F7tR9RV71wuDs2Qn1DSH5qwcVVQc/JZMwQS92YUGyFGM5Sp3d+TivBaMhcjgESJNPUNijKj2xNCLd1aQ==", "requires": { "blakejs": "^1.1.0", "bs58check": "^2.1.2", "buffer": "^5.2.1" } }, + "@tootallnate/once": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.0.0.tgz", + "integrity": "sha512-KYyTT/T6ALPkIRd2Ge080X/BsXvy9O0hcWTtMWkPvwAwF99+vn6Dv4GzrFT/Nn1LePr+FFDbRXXlqmsy9lw2zA==" + }, "@ts-tools/node": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@ts-tools/node/-/node-1.1.3.tgz", @@ -602,9 +591,9 @@ "dev": true }, "@types/babel__core": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz", - "integrity": "sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.6.tgz", + "integrity": "sha512-tTnhWszAqvXnhW7m5jQU9PomXSiKXk2sFxpahXvI20SZKu9ylPi8WtIxueZ6ehDWikPT0jeFujMj3X4ZHuf3Tg==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -634,18 +623,18 @@ } }, "@types/babel__traverse": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.8.tgz", - "integrity": "sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.9.tgz", + "integrity": "sha512-jEFQ8L1tuvPjOI8lnpaf73oCJe+aoxL6ygqSy6c8LcW98zaC+4mzWuQIRCEvKeCOu+lbqdXcg4Uqmm1S8AP1tw==", "dev": true, "requires": { "@babel/types": "^7.3.0" } }, "@types/body-parser": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz", - "integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ==", "dev": true, "requires": { "@types/connect": "*", @@ -662,9 +651,9 @@ } }, "@types/express": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.2.tgz", - "integrity": "sha512-5mHFNyavtLoJmnusB8OKJ5bshSzw+qkMIBAobLrIM48HJvunFva9mOa6aBwh64lBFyNwBbs0xiEFuj4eU/NjCA==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.3.tgz", + "integrity": "sha512-I8cGRJj3pyOLs/HndoP+25vOqhqWkAZsWMEmq1qXy/b/M3ppufecUwaK2/TVDVxcV61/iSdhykUjQQ2DLSrTdg==", "dev": true, "requires": { "@types/body-parser": "*", @@ -694,9 +683,9 @@ } }, "@types/hapi__joi": { - "version": "16.0.8", - "resolved": "https://registry.npmjs.org/@types/hapi__joi/-/hapi__joi-16.0.8.tgz", - "integrity": "sha512-13I2m/eIoKF8JwLkeibJjsu2EKui18Vug7cOtzuUbWtF7mHyBgFCzSxnthHQ77z9S3T68ZldsGZpK1qXbinQjw==", + "version": "16.0.12", + "resolved": "https://registry.npmjs.org/@types/hapi__joi/-/hapi__joi-16.0.12.tgz", + "integrity": "sha512-xJYifuz59jXdWY5JMS15uvA3ycS3nQYOGqoIIE0+fwQ0qI3/4CxBc6RHsOTp6wk9M0NWEdpcTl02lOQOKMifbQ==", "dev": true }, "@types/istanbul-lib-coverage": { @@ -766,11 +755,12 @@ "integrity": "sha512-nuFlRdBiqbF+PJIEVxm2jLFcQWN7q7iWEJGsBV4n7v1dbI9qXB8im2pMMKMCUZe092sQb5SQft2DHfuQGK5hqQ==" }, "@types/node-fetch": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.4.tgz", - "integrity": "sha512-Oz6id++2qAOFuOlE1j0ouk1dzl3mmI1+qINPNBhi9nt/gVOz0G+13Ao6qjhdF0Ys+eOkhu6JnFmt38bR3H0POQ==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.5.tgz", + "integrity": "sha512-IWwjsyYjGw+em3xTvWVQi5MgYKbRs0du57klfTaZkv/B24AEQ/p/IopNeqIYNy3EsfHOpg8ieQSDomPcsYMHpA==", "requires": { - "@types/node": "*" + "@types/node": "*", + "form-data": "^3.0.0" } }, "@types/range-parser": { @@ -811,9 +801,9 @@ } }, "@types/yargs": { - "version": "13.0.7", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.7.tgz", - "integrity": "sha512-Sg9kNeJz+V+W+0fugcVhHC+mNHnydDR1RJrW5Qn2jVrDQARF8wfPVqIqwEzZp+bneuEBIm2ClsJ1/je42ZBzSg==", + "version": "13.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.8.tgz", + "integrity": "sha512-XAvHLwG7UQ+8M4caKIH0ZozIOYay5fQkAgyIXegXT9jPtdIGdhga+sUEdAr1CiG46aB+c64xQEYyEzlwWVTNzA==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -885,14 +875,17 @@ "dev": true }, "agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==" + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", + "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", + "requires": { + "debug": "4" + } }, "ajv": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", - "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -968,9 +961,9 @@ } }, "arg": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz", - "integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "arr-diff": { @@ -1002,11 +995,6 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" - }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -1068,8 +1056,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { "version": "2.1.2", @@ -1196,9 +1183,9 @@ } }, "base-x": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.7.tgz", - "integrity": "sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", "requires": { "safe-buffer": "^5.0.1" } @@ -1390,9 +1377,9 @@ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, "browser-resolve": { @@ -1449,9 +1436,9 @@ } }, "buffer": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", - "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.5.0.tgz", + "integrity": "sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww==", "requires": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" @@ -1685,7 +1672,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -1721,11 +1707,11 @@ } }, "configstore": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.0.tgz", - "integrity": "sha512-eE/hvMs7qw7DlcB5JPRnthmrITuHMmACUJAp89v6PT6iOqzoLS7HRWhBtuHMlhNHo2AhUSA/3Dh1bKNJHcublQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", "requires": { - "dot-prop": "^5.1.0", + "dot-prop": "^5.2.0", "graceful-fs": "^4.1.2", "make-dir": "^3.0.0", "unique-string": "^2.0.0", @@ -1979,8 +1965,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "depd": { "version": "1.1.2", @@ -2027,24 +2012,12 @@ "requires": { "domelementtype": "^2.0.1", "entities": "^2.0.0" - }, - "dependencies": { - "domelementtype": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", - "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" - }, - "entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", - "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==" - } } }, "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" }, "domexception": { "version": "1.0.1", @@ -2056,20 +2029,21 @@ } }, "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.0.0.tgz", + "integrity": "sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw==", "requires": { - "domelementtype": "1" + "domelementtype": "^2.0.1" } }, "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.0.0.tgz", + "integrity": "sha512-n5SelJ1axbO636c2yUtOGia/IcJtVtlhQbFiVDBZHKV5ReJO1ViX7sFEemtuyoAnBxk5meNSYgA8V4s0271efg==", "requires": { - "dom-serializer": "0", - "domelementtype": "1" + "dom-serializer": "^0.2.1", + "domelementtype": "^2.0.1", + "domhandler": "^3.0.0" } }, "dot-prop": { @@ -2183,9 +2157,9 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=" }, "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==" }, "env-variable": { "version": "0.0.6", @@ -2250,9 +2224,9 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.13.0.tgz", - "integrity": "sha512-eYk2dCkxR07DsHA/X2hRBj0CFAZeri/LyDMc0C8JT1Hqi6JnVpMhJ7XFITbb0+yZS3lVkaPL2oCkZ3AVmeVbMw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", + "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", "dev": true, "requires": { "esprima": "^4.0.1", @@ -2442,12 +2416,12 @@ } }, "express-winston": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/express-winston/-/express-winston-4.0.2.tgz", - "integrity": "sha512-Dt2VRkIekVZQT4F8CiKsFm7dWhD7Hx32vyO62p9TIcOb9AdZ58HiX21b+2P2qrxTsOzYYA2N3mXu2vj+RTq8cQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/express-winston/-/express-winston-4.0.3.tgz", + "integrity": "sha512-qzLLaTYAhajzfbR1d/hKT+N4kEoqDXC9wBqth0ygPg+DrM4QRipXDHLkIkaKSeiQ1L/ulezrT+T7lrKS+OcT7g==", "requires": { "chalk": "^2.4.1", - "lodash": "^4.17.10" + "lodash": "^4.17.15" } }, "extend": { @@ -2556,8 +2530,7 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", @@ -2571,9 +2544,9 @@ "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" }, "fast-text-encoding": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz", - "integrity": "sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.1.tgz", + "integrity": "sha512-x4FEgaz3zNRtJfLFqJmHWxkMDDvXVtaznj2V9jiP8ACUJrUgist4bP9FmDL2Vew2Y9mEQI/tG4GqabaitYp9CQ==" }, "fb-watchman": { "version": "2.0.1", @@ -2670,13 +2643,12 @@ "dev": true }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -3269,21 +3241,21 @@ "dev": true }, "gaxios": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.2.2.tgz", - "integrity": "sha512-fzttYsjvZxCaN+bQK7FtAMgoIlPtHkMwlz7vHD+aNRcU7I7gHgnp6hvGJksoo+dO1TDxaog+dSBycbYhHIStaA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.3.2.tgz", + "integrity": "sha512-K/+py7UvKRDaEwEKlLiRKrFr+wjGjsMz5qH7Vs549QJS7cpSCOT/BbWL7pzqECflc46FcNPipjSfB+V1m8PAhw==", "requires": { "abort-controller": "^3.0.0", "extend": "^3.0.2", - "https-proxy-agent": "^4.0.0", + "https-proxy-agent": "^5.0.0", "is-stream": "^2.0.0", "node-fetch": "^2.3.0" } }, "gcp-metadata": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.3.0.tgz", - "integrity": "sha512-uO3P/aByOQmoDu5bOYBODHmD1oDCZw7/R8SYY0MdmMQSZVEmeTSxmiM1vwde+YHYSpkaQnAAMAIZuOqLvgfp/Q==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.5.0.tgz", + "integrity": "sha512-ZQf+DLZ5aKcRpLzYUyBS3yo3N0JSa82lNDO8rj3nMSlovLcz2riKFBsYgDzeXcv75oo5eqB2lx+B14UvPoCRnA==", "requires": { "gaxios": "^2.1.0", "json-bigint": "^0.3.0" @@ -3388,15 +3360,16 @@ "dev": true }, "google-auth-library": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.9.2.tgz", - "integrity": "sha512-rBE1YTOZ3/Hu6Mojkr+UUmbdc/F28hyMGYEGxjyfVA9ZFmq12oqS3AeftX4h9XpdVIcxPooSo8hECYGT6B9XqQ==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.10.1.tgz", + "integrity": "sha512-rOlaok5vlpV9rSiUu5EpR0vVpc+PhN62oF4RyX/6++DG1VsaulAFEMlDYBLjJDDPI6OcNOCGAKy9UVB/3NIDXg==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", "fast-text-encoding": "^1.0.0", "gaxios": "^2.1.0", - "gcp-metadata": "^3.3.0", + "gcp-metadata": "^3.4.0", "gtoken": "^4.1.0", "jws": "^4.0.0", "lru-cache": "^5.0.0" @@ -3595,9 +3568,9 @@ } }, "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "html-encoding-sniffer": { @@ -3616,16 +3589,14 @@ "dev": true }, "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", + "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" + "domelementtype": "^2.0.1", + "domhandler": "^3.0.0", + "domutils": "^2.0.0", + "entities": "^2.0.0" } }, "http-errors": { @@ -3648,22 +3619,13 @@ } }, "http-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.0.tgz", - "integrity": "sha512-GX0FA6+IcDf4Oxc/FBWgYj4zKgo/DnZrksaG9jyuQLExs6xlX+uI5lcA8ymM3JaZTRrF/4s2UX19wJolyo7OBA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "requires": { + "@tootallnate/once": "1", "agent-base": "6", "debug": "4" - }, - "dependencies": { - "agent-base": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", - "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", - "requires": { - "debug": "4" - } - } } }, "http-signature": { @@ -3678,11 +3640,11 @@ } }, "https-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", - "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", "requires": { - "agent-base": "5", + "agent-base": "6", "debug": "4" } }, @@ -3756,9 +3718,9 @@ } }, "ipaddr.js": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", - "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, "is-accessor-descriptor": { "version": "0.1.6", @@ -4844,17 +4806,17 @@ } }, "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", + "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", "requires": { "semver": "^6.0.0" } }, "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "makeerror": { @@ -5191,11 +5153,6 @@ "path-key": "^2.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -5528,9 +5485,9 @@ "dev": true }, "postcss": { - "version": "7.0.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.26.tgz", - "integrity": "sha512-IY4oRjpXWYshuTDFxMVkJDtWIk2LhsTlu8bZnbEJA4+bYT16Lvpo8Qv6EvDumhYRgzjZl489pmsY3qVgJQ08nA==", + "version": "7.0.27", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.27.tgz", + "integrity": "sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -5577,22 +5534,22 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "prompts": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.0.tgz", - "integrity": "sha512-NfbbPPg/74fT7wk2XYQ7hAIp9zJyZp5Fu19iRbORqqy1BhtrkZ0fPafBU+7bmn8ie69DpT0R6QpJIN2oisYjJg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.1.tgz", + "integrity": "sha512-qIP2lQyCwYbdzcqHIUi2HAxiWixhoM9OdLCWf8txXsapC/X9YdsCoeyRIXE/GP+Q0J37Q7+XN/MFqbUa7IzXNA==", "dev": true, "requires": { "kleur": "^3.0.3", - "sisteransi": "^1.0.3" + "sisteransi": "^1.0.4" } }, "proxy-addr": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", - "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.9.0" + "ipaddr.js": "1.9.1" } }, "pseudomap": { @@ -5693,9 +5650,9 @@ } }, "react-is": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", - "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==", + "version": "16.13.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.0.tgz", + "integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==", "dev": true }, "read-pkg": { @@ -5720,9 +5677,9 @@ } }, "readable-stream": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", - "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -5814,9 +5771,9 @@ "dev": true }, "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -5826,7 +5783,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -5836,32 +5793,27 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" }, "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } } } }, @@ -5898,9 +5850,9 @@ "dev": true }, "resolve": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz", - "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -6010,19 +5962,19 @@ } }, "sanitize-html": { - "version": "1.21.1", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.21.1.tgz", - "integrity": "sha512-W6enXSVphVaVbmVbzVngBthR5f5sMmhq3EfPfBlzBzp2WnX8Rnk7NGpP7KmHUc0Y3MVk9tv/+CbpdHchX9ai7g==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.22.0.tgz", + "integrity": "sha512-3RPo65mbTKpOAdAYWU496MSty1YbB3Y5bjwL5OclgaSSMtv65xvM7RW/EHRumzaZ1UddEJowCbSdK0xl5sAu0A==", "requires": { "chalk": "^2.4.1", - "htmlparser2": "^3.10.0", + "htmlparser2": "^4.1.0", "lodash.clonedeep": "^4.5.0", "lodash.escaperegexp": "^4.1.2", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", "lodash.mergewith": "^4.6.1", - "postcss": "^7.0.5", - "srcset": "^1.0.0", + "postcss": "^7.0.27", + "srcset": "^2.0.1", "xtend": "^4.0.1" } }, @@ -6410,13 +6362,9 @@ } }, "srcset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", - "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", - "requires": { - "array-uniq": "^1.0.2", - "number-is-nan": "^1.0.0" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/srcset/-/srcset-2.0.1.tgz", + "integrity": "sha512-00kZI87TdRKwt+P8jj8UZxbfp7mK2ufxcIMWvhAOZNJTRROimpHeruWrGvCZneiuVDLqdyHefVp748ECTnyUBQ==" }, "sshpk": { "version": "1.16.1", @@ -6604,12 +6552,12 @@ "dev": true }, "teeny-request": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-6.0.1.tgz", - "integrity": "sha512-TAK0c9a00ELOqLrZ49cFxvPVogMUFaWY8dUsQc/0CuQPGF+BOxOQzXfE413BAk2kLomwNplvdtMpeaeGWmoc2g==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-6.0.2.tgz", + "integrity": "sha512-B6fxA0fSnY/bul06NggdN1nywtr5U5Uvt96pHfTi8pi4MNe6++VUWcAAFBrcMeha94s+gULwA5WvagoSZ+AcYg==", "requires": { "http-proxy-agent": "^4.0.0", - "https-proxy-agent": "^4.0.0", + "https-proxy-agent": "^5.0.0", "node-fetch": "^2.2.0", "stream-events": "^1.0.5", "uuid": "^3.3.2" @@ -6895,9 +6843,9 @@ } }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" }, "tunnel-agent": { "version": "0.6.0", @@ -6952,9 +6900,9 @@ "dev": true }, "undefsafe": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", - "integrity": "sha1-Il9rngM3Zj4Njnz9aG/Cg2zKznY=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", + "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", "dev": true, "requires": { "debug": "^2.2.0" @@ -7243,12 +7191,12 @@ } }, "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dev": true, "requires": { - "browser-process-hrtime": "^0.1.2" + "browser-process-hrtime": "^1.0.0" } }, "walker": { @@ -7414,9 +7362,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", - "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "requires": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", From 550e6b084b8c5da36628884e835954185d963bd5 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Tue, 25 Feb 2020 15:23:28 +0100 Subject: [PATCH 29/40] new constant : add self (michelson SELF) --- src/passes/operators/operators.ml | 12 ++++++++++-- src/stages/common/PP.ml | 1 + src/stages/common/types.ml | 1 + src/stages/mini_c/PP.ml | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index 9fd521087..bcb0ce691 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -66,7 +66,6 @@ module Simplify = struct module Pascaligo = struct let constants = function (* Tezos module (ex-Michelson) *) - | "Tezos.chain_id" -> ok C_CHAIN_ID | "chain_id" -> ok C_CHAIN_ID (* Deprecated *) | "get_chain_id" -> ok C_CHAIN_ID (* Deprecated *) @@ -79,7 +78,8 @@ module Simplify = struct | "Tezos.sender" -> ok C_SENDER | "sender" -> ok C_SENDER (* Deprecated *) | "Tezos.address" -> ok C_ADDRESS - | "address" -> ok C_ADDRESS (* Deprecated *) + | "address" -> ok C_ADDRESS (* Deprecated *) + | "Tezos.self" -> ok C_SELF | "Tezos.self_address" -> ok C_SELF_ADDRESS | "self_address" -> ok C_SELF_ADDRESS (* Deprecated *) | "Tezos.implicit_account" -> ok C_IMPLICIT_ACCOUNT @@ -267,6 +267,7 @@ module Simplify = struct | "sender" -> ok C_SENDER (* Deprecated *) | "Tezos.address" -> ok C_ADDRESS | "Current.address" -> ok C_ADDRESS (* Deprecated *) + | "Tezos.self" -> ok C_SELF | "Tezos.self_address" -> ok C_SELF_ADDRESS | "Current.self_address" -> ok C_SELF_ADDRESS (* Deprecated *) | "Tezos.implicit_account" -> ok C_IMPLICIT_ACCOUNT @@ -791,6 +792,11 @@ module Typer = struct let self_address = typer_0 "SELF_ADDRESS" @@ fun _ -> ok @@ t_address () + let self = typer_0 "SELF" @@ fun tv_opt -> + match tv_opt with + | None -> simple_fail "untyped SELF" + | Some t -> ok @@ t + let implicit_account = typer_1 "IMPLICIT_ACCOUNT" @@ fun key_hash -> let%bind () = assert_t_key_hash key_hash in ok @@ t_contract (t_unit () ) () @@ -1228,6 +1234,7 @@ module Typer = struct | C_SENDER -> ok @@ sender ; | C_SOURCE -> ok @@ source ; | C_ADDRESS -> ok @@ address ; + | C_SELF -> ok @@ self; | C_SELF_ADDRESS -> ok @@ self_address; | C_IMPLICIT_ACCOUNT -> ok @@ implicit_account; | C_SET_DELEGATE -> ok @@ set_delegate ; @@ -1303,6 +1310,7 @@ module Compiler = struct | C_AMOUNT -> ok @@ simple_constant @@ prim I_AMOUNT | C_ADDRESS -> ok @@ simple_unary @@ prim I_ADDRESS | C_SELF_ADDRESS -> ok @@ simple_constant @@ seq [prim I_SELF; prim I_ADDRESS] + | C_SELF -> ok @@ simple_constant @@ seq [prim I_SELF] | C_IMPLICIT_ACCOUNT -> ok @@ simple_unary @@ prim I_IMPLICIT_ACCOUNT | C_SET_DELEGATE -> ok @@ simple_unary @@ prim I_SET_DELEGATE | C_NOW -> ok @@ simple_constant @@ prim I_NOW diff --git a/src/stages/common/PP.ml b/src/stages/common/PP.ml index 14cde83d5..ee232f044 100644 --- a/src/stages/common/PP.ml +++ b/src/stages/common/PP.ml @@ -143,6 +143,7 @@ let constant ppf : constant' -> unit = function | C_SOURCE -> fprintf ppf "SOURCE" | C_SENDER -> fprintf ppf "SENDER" | C_ADDRESS -> fprintf ppf "ADDRESS" + | C_SELF -> fprintf ppf "SELF" | C_SELF_ADDRESS -> fprintf ppf "SELF_ADDRESS" | C_IMPLICIT_ACCOUNT -> fprintf ppf "IMPLICIT_ACCOUNT" | C_SET_DELEGATE -> fprintf ppf "SET_DELEGATE" diff --git a/src/stages/common/types.ml b/src/stages/common/types.ml index d6b0839fd..1eacb7f7c 100644 --- a/src/stages/common/types.ml +++ b/src/stages/common/types.ml @@ -285,6 +285,7 @@ and constant' = | C_SOURCE | C_SENDER | C_ADDRESS + | C_SELF | C_SELF_ADDRESS | C_IMPLICIT_ACCOUNT | C_SET_DELEGATE diff --git a/src/stages/mini_c/PP.ml b/src/stages/mini_c/PP.ml index bb0ff6476..7626081cc 100644 --- a/src/stages/mini_c/PP.ml +++ b/src/stages/mini_c/PP.ml @@ -237,6 +237,7 @@ and constant ppf : constant' -> unit = function | C_SOURCE -> fprintf ppf "SOURCE" | C_SENDER -> fprintf ppf "SENDER" | C_ADDRESS -> fprintf ppf "ADDRESS" + | C_SELF -> fprintf ppf "SELF" | C_SELF_ADDRESS -> fprintf ppf "SELF_ADDRESS" | C_IMPLICIT_ACCOUNT -> fprintf ppf "IMPLICIT_ACCOUNT" | C_SET_DELEGATE -> fprintf ppf "SET_DELEGATE" From f0ad2fed04b5bfe0ea21e952927fec09f0900ad3 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Mon, 2 Mar 2020 19:26:23 +0100 Subject: [PATCH 30/40] new pass : self_ast_typed --- src/main/compile/dune | 1 + src/main/compile/of_simplified.ml | 7 +- src/passes/5-self_ast_typed/dune | 12 + src/passes/5-self_ast_typed/helpers.ml | 311 ++++++++++++++++++ src/passes/5-self_ast_typed/self_ast_typed.ml | 17 + 5 files changed, 346 insertions(+), 2 deletions(-) create mode 100644 src/passes/5-self_ast_typed/dune create mode 100644 src/passes/5-self_ast_typed/helpers.ml create mode 100644 src/passes/5-self_ast_typed/self_ast_typed.ml diff --git a/src/main/compile/dune b/src/main/compile/dune index e59679ba5..7629e3d2b 100644 --- a/src/main/compile/dune +++ b/src/main/compile/dune @@ -9,6 +9,7 @@ interpreter ast_simplified self_ast_simplified + self_ast_typed typer_new typer ast_typed diff --git a/src/main/compile/of_simplified.ml b/src/main/compile/of_simplified.ml index 488e809ac..f5271382c 100644 --- a/src/main/compile/of_simplified.ml +++ b/src/main/compile/of_simplified.ml @@ -3,12 +3,15 @@ open Trace let compile (program : Ast_simplified.program) : (Ast_typed.program * Typer.Solver.state) result = let%bind (prog_typed , state) = Typer.type_program program in let () = Typer.Solver.discard_state state in - ok @@ (prog_typed, state) + let%bind prog_typed' = Self_ast_typed.all_program prog_typed in + ok @@ (prog_typed', state) let compile_expression ?(env = Ast_typed.Environment.full_empty) ~(state : Typer.Solver.state) (ae : Ast_simplified.expression) : (Ast_typed.expression * Typer.Solver.state) result = + let%bind (ae_typed,state) = Typer.type_expression_subst env state ae in let () = Typer.Solver.discard_state state in - Typer.type_expression_subst env state ae + let%bind ae_typed' = Self_ast_typed.all_expression ae_typed in + ok @@ (ae_typed',state) let apply (entry_point : string) (param : Ast_simplified.expression) : Ast_simplified.expression result = let name = Var.of_name entry_point in diff --git a/src/passes/5-self_ast_typed/dune b/src/passes/5-self_ast_typed/dune new file mode 100644 index 000000000..0fc22a1d3 --- /dev/null +++ b/src/passes/5-self_ast_typed/dune @@ -0,0 +1,12 @@ +(library + (name self_ast_typed) + (public_name ligo.self_ast_typed) + (libraries + simple-utils + ast_typed + ) + (preprocess + (pps ppx_let bisect_ppx --conditional) + ) + (flags (:standard -w +1..62-4-9-44-40-42-48-30@39@33 -open Simple_utils )) +) diff --git a/src/passes/5-self_ast_typed/helpers.ml b/src/passes/5-self_ast_typed/helpers.ml new file mode 100644 index 000000000..e65d497d9 --- /dev/null +++ b/src/passes/5-self_ast_typed/helpers.ml @@ -0,0 +1,311 @@ +open Ast_typed +open Trace +open Stage_common.Helpers + +type 'a folder = 'a -> expression -> 'a result +let rec fold_expression : 'a folder -> 'a -> expression -> 'a result = fun f init e -> + let self = fold_expression f in + let%bind init' = f init e in + match e.expression_content with + | E_literal _ | E_variable _ -> ok init' + | E_list lst | E_set lst | E_constant {arguments=lst} -> ( + let%bind res = bind_fold_list self init' lst in + ok res + ) + | E_map lst | E_big_map lst -> ( + let%bind res = bind_fold_list (bind_fold_pair self) init' lst in + ok res + ) + | E_look_up ab -> + let%bind res = bind_fold_pair self init' ab in + ok res + | E_loop {condition;body} -> + let ab = (condition,body) in + let%bind res = bind_fold_pair self init' ab in + ok res + | E_application {expr1;expr2} -> ( + let ab = (expr1,expr2) in + let%bind res = bind_fold_pair self init' ab in + ok res + ) + | E_lambda { binder = _ ; result = e } + | E_constructor {element=e} -> ( + let%bind res = self init' e in + ok res + ) + | E_matching {matchee=e; cases} -> ( + let%bind res = self init' e in + let%bind res = fold_cases f res cases in + ok res + ) + | E_record m -> ( + let aux init'' _ expr = + let%bind res = fold_expression self init'' expr in + ok res + in + let%bind res = bind_fold_lmap aux (ok init') m in + ok res + ) + | E_record_update {record;update} -> ( + let%bind res = self init' record in + let%bind res = fold_expression self res update in + ok res + ) + | E_record_accessor {expr} -> ( + let%bind res = self init' expr in + ok res + ) + | E_let_in { let_binder = _ ; rhs ; let_result } -> ( + let%bind res = self init' rhs in + let%bind res = self res let_result in + ok res + ) + +and fold_cases : 'a folder -> 'a -> matching_expr -> 'a result = fun f init m -> + match m with + | Match_bool { match_true ; match_false } -> ( + let%bind res = fold_expression f init match_true in + let%bind res = fold_expression f res match_false in + ok res + ) + | Match_list { match_nil ; match_cons = (_ , _ , cons, _) } -> ( + let%bind res = fold_expression f init match_nil in + let%bind res = fold_expression f res cons in + ok res + ) + | Match_option { match_none ; match_some = (_ , some, _) } -> ( + let%bind res = fold_expression f init match_none in + let%bind res = fold_expression f res some in + ok res + ) + | Match_tuple ((_ , e), _) -> ( + let%bind res = fold_expression f init e in + ok res + ) + | Match_variant (lst, _) -> ( + let aux init' ((_ , _) , e) = + let%bind res' = fold_expression f init' e in + ok res' in + let%bind res = bind_fold_list aux init lst in + ok res + ) + +type mapper = expression -> expression result +let rec map_expression : mapper -> expression -> expression result = fun f e -> + let self = map_expression f in + let%bind e' = f e in + let return expression_content = ok { e' with expression_content } in + match e'.expression_content with + | E_list lst -> ( + let%bind lst' = bind_map_list self lst in + return @@ E_list lst' + ) + | E_set lst -> ( + let%bind lst' = bind_map_list self lst in + return @@ E_set lst' + ) + | E_map lst -> ( + let%bind lst' = bind_map_list (bind_map_pair self) lst in + return @@ E_map lst' + ) + | E_big_map lst -> ( + let%bind lst' = bind_map_list (bind_map_pair self) lst in + return @@ E_big_map lst' + ) + | E_look_up ab -> ( + let%bind ab' = bind_map_pair self ab in + return @@ E_look_up ab' + ) + | E_loop {condition;body} -> ( + let ab = (condition,body) in + let%bind (a,b) = bind_map_pair self ab in + return @@ E_loop {condition = a; body = b} + ) + | E_matching {matchee=e;cases} -> ( + let%bind e' = self e in + let%bind cases' = map_cases f cases in + return @@ E_matching {matchee=e';cases=cases'} + ) + | E_record_accessor acc -> ( + let%bind e' = self acc.expr in + return @@ E_record_accessor {acc with expr = e'} + ) + | E_record m -> ( + let%bind m' = bind_map_lmap self m in + return @@ E_record m' + ) + | E_record_update {record; path; update} -> ( + let%bind record = self record in + let%bind update = self update in + return @@ E_record_update {record;path;update} + ) + | E_constructor c -> ( + let%bind e' = self c.element in + return @@ E_constructor {c with element = e'} + ) + | E_application {expr1;expr2} -> ( + let ab = (expr1,expr2) in + let%bind (a,b) = bind_map_pair self ab in + return @@ E_application {expr1=a;expr2=b} + ) + | E_let_in { let_binder ; rhs ; let_result; inline } -> ( + let%bind rhs = self rhs in + let%bind let_result = self let_result in + return @@ E_let_in { let_binder ; rhs ; let_result; inline } + ) + | E_lambda { binder ; result } -> ( + let%bind result = self result in + return @@ E_lambda { binder ; result } + ) + | E_constant c -> ( + let%bind args = bind_map_list self c.arguments in + return @@ E_constant {c with arguments=args} + ) + | E_literal _ | E_variable _ as e' -> return e' + + +and map_cases : mapper -> matching_expr -> matching_expr result = fun f m -> + match m with + | Match_bool { match_true ; match_false } -> ( + let%bind match_true = map_expression f match_true in + let%bind match_false = map_expression f match_false in + ok @@ Match_bool { match_true ; match_false } + ) + | Match_list { match_nil ; match_cons = (hd , tl , cons, te) } -> ( + let%bind match_nil = map_expression f match_nil in + let%bind cons = map_expression f cons in + ok @@ Match_list { match_nil ; match_cons = (hd , tl , cons, te) } + ) + | Match_option { match_none ; match_some = (name , some, te) } -> ( + let%bind match_none = map_expression f match_none in + let%bind some = map_expression f some in + ok @@ Match_option { match_none ; match_some = (name , some, te) } + ) + | Match_tuple ((names , e), _) -> ( + let%bind e' = map_expression f e in + ok @@ Match_tuple ((names , e'), []) + ) + | Match_variant (lst, te) -> ( + let aux ((a , b) , e) = + let%bind e' = map_expression f e in + ok ((a , b) , e') + in + let%bind lst' = bind_map_list aux lst in + ok @@ Match_variant (lst', te) + ) + +and map_program : mapper -> program -> program result = fun m p -> + let aux = fun (x : declaration) -> + match x with + | Declaration_constant (v , e , i, env) -> ( + let%bind e' = map_expression m e in + ok (Declaration_constant (v , e' , i, env)) + ) + in + bind_map_list (bind_map_location aux) p + +type 'a fold_mapper = 'a -> expression -> (bool * 'a * expression) result +let rec fold_map_expression : 'a fold_mapper -> 'a -> expression -> ('a * expression) result = fun f a e -> + let self = fold_map_expression f in + let%bind (continue, init',e') = f a e in + if (not continue) then ok(init',e') + else + let return expression_content = { e' with expression_content } in + match e'.expression_content with + | E_list lst -> ( + let%bind (res, lst') = bind_fold_map_list self init' lst in + ok (res, return @@ E_list lst') + ) + | E_set lst -> ( + let%bind (res, lst') = bind_fold_map_list self init' lst in + ok (res, return @@ E_set lst') + ) + | E_map lst -> ( + let%bind (res, lst') = bind_fold_map_list (bind_fold_map_pair self) init' lst in + ok (res, return @@ E_map lst') + ) + | E_big_map lst -> ( + let%bind (res, lst') = bind_fold_map_list (bind_fold_map_pair self) init' lst in + ok (res, return @@ E_big_map lst') + ) + | E_look_up ab -> ( + let%bind (res, ab') = bind_fold_map_pair self init' ab in + ok (res, return @@ E_look_up ab') + ) + | E_loop {condition;body} -> ( + let ab = (condition,body) in + let%bind (res,(a,b)) = bind_fold_map_pair self init' ab in + ok (res, return @@ E_loop {condition = a; body = b}) + ) + | E_matching {matchee=e;cases} -> ( + let%bind (res, e') = self init' e in + let%bind (res,cases') = fold_map_cases f res cases in + ok (res, return @@ E_matching {matchee=e';cases=cases'}) + ) + | E_record_accessor acc -> ( + let%bind (res, e') = self init' acc.expr in + ok (res, return @@ E_record_accessor {acc with expr = e'}) + ) + | E_record m -> ( + let%bind (res, lst') = bind_fold_map_list (fun res (k,e) -> let%bind (res,e) = self res e in ok (res,(k,e))) init' (LMap.to_kv_list m) in + let m' = LMap.of_list lst' in + ok (res, return @@ E_record m') + ) + | E_record_update {record; path; update} -> ( + let%bind (res, record) = self init' record in + let%bind (res, update) = self res update in + ok (res, return @@ E_record_update {record;path;update}) + ) + | E_constructor c -> ( + let%bind (res,e') = self init' c.element in + ok (res, return @@ E_constructor {c with element = e'}) + ) + | E_application {expr1;expr2} -> ( + let ab = (expr1,expr2) in + let%bind (res,(a,b)) = bind_fold_map_pair self init' ab in + ok (res, return @@ E_application {expr1=a;expr2=b}) + ) + | E_let_in { let_binder ; rhs ; let_result; inline } -> ( + let%bind (res,rhs) = self init' rhs in + let%bind (res,let_result) = self res let_result in + ok (res, return @@ E_let_in { let_binder ; rhs ; let_result ; inline }) + ) + | E_lambda { binder ; result } -> ( + let%bind (res,result) = self init' result in + ok ( res, return @@ E_lambda { binder ; result }) + ) + | E_constant c -> ( + let%bind (res,args) = bind_fold_map_list self init' c.arguments in + ok (res, return @@ E_constant {c with arguments=args}) + ) + | E_literal _ | E_variable _ as e' -> ok (init', return e') + +and fold_map_cases : 'a fold_mapper -> 'a -> matching_expr -> ('a * matching_expr) result = fun f init m -> + match m with + | Match_bool { match_true ; match_false } -> ( + let%bind (init, match_true) = fold_map_expression f init match_true in + let%bind (init, match_false) = fold_map_expression f init match_false in + ok @@ (init, Match_bool { match_true ; match_false }) + ) + | Match_list { match_nil ; match_cons = (hd , tl , cons, te) } -> ( + let%bind (init, match_nil) = fold_map_expression f init match_nil in + let%bind (init, cons) = fold_map_expression f init cons in + ok @@ (init, Match_list { match_nil ; match_cons = (hd , tl , cons, te) }) + ) + | Match_option { match_none ; match_some = (name , some, te) } -> ( + let%bind (init, match_none) = fold_map_expression f init match_none in + let%bind (init, some) = fold_map_expression f init some in + ok @@ (init, Match_option { match_none ; match_some = (name , some, te) }) + ) + | Match_tuple ((names , e), _) -> ( + let%bind (init, e') = fold_map_expression f init e in + ok @@ (init, Match_tuple ((names , e'), [])) + ) + | Match_variant (lst, te) -> ( + let aux init ((a , b) , e) = + let%bind (init,e') = fold_map_expression f init e in + ok (init, ((a , b) , e')) + in + let%bind (init,lst') = bind_fold_map_list aux init lst in + ok @@ (init, Match_variant (lst', te)) + ) diff --git a/src/passes/5-self_ast_typed/self_ast_typed.ml b/src/passes/5-self_ast_typed/self_ast_typed.ml new file mode 100644 index 000000000..bfe730244 --- /dev/null +++ b/src/passes/5-self_ast_typed/self_ast_typed.ml @@ -0,0 +1,17 @@ +open Trace + +let all = [] + +let all_program = + let all_p = List.map Helpers.map_program all in + bind_chain all_p + +let all_expression = + let all_p = List.map Helpers.map_expression all in + bind_chain all_p + +let map_expression = Helpers.map_expression + +let fold_expression = Helpers.fold_expression + +let fold_map_expression = Helpers.fold_map_expression From e2776e9849314ec024ccc539aeb2a79811569b48 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Wed, 4 Mar 2020 15:38:10 +0100 Subject: [PATCH 31/40] New checks in the self_ast_typed pass: * Ast_typed stage is now aware of the main function name * main function type is checked against expected contract types * Tezos.self (returning contract type) is checked against main function type * In general, Ast_typed.compile signature has been changed to enable/disable contract-related checks --- src/bin/cli.ml | 22 ++--- src/bin/expect_tests/contract_tests.ml | 60 ++++++++++++++ src/main/compile/of_simplified.ml | 10 ++- src/main/compile/wrapper.ml | 12 --- .../5-self_ast_typed/contract_passes.ml | 34 ++++++++ src/passes/5-self_ast_typed/helpers.ml | 83 +++++++++++++++++++ src/passes/5-self_ast_typed/self_ast_typed.ml | 23 +++-- src/stages/common/helpers.ml | 6 ++ src/stages/common/helpers.mli | 3 + src/test/coase_tests.ml | 4 +- .../contracts/negative/bad_contract.mligo | 5 ++ .../contracts/negative/bad_contract2.mligo | 6 ++ .../contracts/negative/bad_contract3.mligo | 6 ++ .../contracts/negative/self_in_lambda.mligo | 6 +- .../negative/self_type_annotation.ligo | 10 +++ src/test/contracts/self_type_annotation.ligo | 10 +++ src/test/contracts/subtle_nontail_fail.mligo | 6 +- src/test/hash_lock_tests.ml | 4 +- src/test/id_tests.ml | 4 +- src/test/integration_tests.ml | 6 +- src/test/md_file_tests.ml | 2 +- src/test/multisig_tests.ml | 2 +- src/test/multisig_v2_tests.ml | 4 +- src/test/pledge_tests.ml | 4 +- src/test/replaceable_id_tests.ml | 4 +- src/test/time_lock_repeat_tests.ml | 4 +- src/test/time_lock_tests.ml | 4 +- src/test/vote_tests.ml | 2 +- vendors/ligo-utils/simple-utils/trace.ml | 10 +++ 29 files changed, 295 insertions(+), 61 deletions(-) delete mode 100644 src/main/compile/wrapper.ml create mode 100644 src/passes/5-self_ast_typed/contract_passes.ml create mode 100644 src/test/contracts/negative/bad_contract.mligo create mode 100644 src/test/contracts/negative/bad_contract2.mligo create mode 100644 src/test/contracts/negative/bad_contract3.mligo create mode 100644 src/test/contracts/negative/self_type_annotation.ligo create mode 100644 src/test/contracts/self_type_annotation.ligo diff --git a/src/bin/cli.ml b/src/bin/cli.ml index 1ad68d049..a35e5d91c 100644 --- a/src/bin/cli.ml +++ b/src/bin/cli.ml @@ -134,7 +134,7 @@ let compile_file = let f source_file entry_point syntax display_format michelson_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed,_ = Compile.Of_simplified.compile simplified in + let%bind typed,_ = Compile.Of_simplified.compile (Contract entry_point) simplified in let%bind mini_c = Compile.Of_typed.compile typed in let%bind michelson = Compile.Of_mini_c.aggregate_and_compile_contract mini_c entry_point in let%bind contract = Compile.Of_michelson.build_contract michelson in @@ -174,7 +174,7 @@ let print_typed_ast = let f source_file syntax display_format = ( toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed,_ = Compile.Of_simplified.compile simplified in + let%bind typed,_ = Compile.Of_simplified.compile Env simplified in ok @@ Format.asprintf "%a\n" Compile.Of_typed.pretty_print typed ) in @@ -187,7 +187,7 @@ let print_mini_c = let f source_file syntax display_format = ( toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed,_ = Compile.Of_simplified.compile simplified in + let%bind typed,_ = Compile.Of_simplified.compile Env simplified in let%bind mini_c = Compile.Of_typed.compile typed in ok @@ Format.asprintf "%a\n" Compile.Of_mini_c.pretty_print mini_c ) @@ -201,7 +201,7 @@ let measure_contract = let f source_file entry_point syntax display_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed,_ = Compile.Of_simplified.compile simplified in + let%bind typed,_ = Compile.Of_simplified.compile (Contract entry_point) simplified in let%bind mini_c = Compile.Of_typed.compile typed in let%bind michelson = Compile.Of_mini_c.aggregate_and_compile_contract mini_c entry_point in let%bind contract = Compile.Of_michelson.build_contract michelson in @@ -218,7 +218,7 @@ let compile_parameter = let f source_file entry_point expression syntax amount balance sender source predecessor_timestamp display_format michelson_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed_prg,state = Compile.Of_simplified.compile simplified in + let%bind typed_prg,state = Compile.Of_simplified.compile (Contract entry_point) simplified in let%bind mini_c_prg = Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg entry_point in let env = Ast_typed.program_environment typed_prg in @@ -249,7 +249,7 @@ let interpret = let%bind (decl_list,state,env) = match init_file with | Some init_file -> let%bind simplified = Compile.Of_source.compile init_file (Syntax_name syntax) in - let%bind typed_prg,state = Compile.Of_simplified.compile simplified in + let%bind typed_prg,state = Compile.Of_simplified.compile Env simplified in let%bind mini_c_prg = Compile.Of_typed.compile typed_prg in let env = Ast_typed.program_environment typed_prg in ok (mini_c_prg,state,env) @@ -280,7 +280,7 @@ let temp_ligo_interpreter = let f source_file syntax display_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed,_ = Compile.Of_simplified.compile simplified in + let%bind typed,_ = Compile.Of_simplified.compile Env simplified in let%bind res = Compile.Of_typed.some_interpret typed in ok @@ Format.asprintf "%s\n" res in @@ -294,7 +294,7 @@ let compile_storage = let f source_file entry_point expression syntax amount balance sender source predecessor_timestamp display_format michelson_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed_prg,state = Compile.Of_simplified.compile simplified in + let%bind typed_prg,state = Compile.Of_simplified.compile (Contract entry_point) simplified in let%bind mini_c_prg = Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg entry_point in let env = Ast_typed.program_environment typed_prg in @@ -323,7 +323,7 @@ let dry_run = let f source_file entry_point storage input amount balance sender source predecessor_timestamp syntax display_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed_prg,state = Compile.Of_simplified.compile simplified in + let%bind typed_prg,state = Compile.Of_simplified.compile (Contract entry_point) simplified in let env = Ast_typed.program_environment typed_prg in let%bind mini_c_prg = Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg entry_point in @@ -359,7 +359,7 @@ let run_function = toplevel ~display_format @@ let%bind v_syntax = Helpers.syntax_to_variant (Syntax_name syntax) (Some source_file) in let%bind simplified_prg = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed_prg,state = Compile.Of_simplified.compile simplified_prg in + let%bind typed_prg,state = Compile.Of_simplified.compile Env simplified_prg in let env = Ast_typed.program_environment typed_prg in let%bind mini_c_prg = Compile.Of_typed.compile typed_prg in @@ -390,7 +390,7 @@ let evaluate_value = let f source_file entry_point amount balance sender source predecessor_timestamp syntax display_format = toplevel ~display_format @@ let%bind simplified = Compile.Of_source.compile source_file (Syntax_name syntax) in - let%bind typed_prg,_ = Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Compile.Of_simplified.compile Env simplified in let%bind mini_c = Compile.Of_typed.compile typed_prg in let%bind (exp,_) = Mini_c.get_entry mini_c entry_point in let%bind compiled = Compile.Of_mini_c.aggregate_and_compile_expression mini_c exp in diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index d570c96ef..6bb8326f7 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -1218,3 +1218,63 @@ ligo: in file "create_contract_var.mligo", line 6, character 35 to line 10, char DIP { DIP { DUP } ; SWAP ; CDR } ; PAIR ; DIP { DROP 2 } } } |}] + +let%expect_test _ = + run_ligo_bad [ "compile-contract" ; bad_contract "self_type_annotation.ligo" ; "main" ] ; + [%expect {| + ligo: in file "self_type_annotation.ligo", line 8, characters 41-51. bad self type: expected (TO_Contract (int)) but got (TO_Contract (nat)) {"location":"in file \"self_type_annotation.ligo\", line 8, characters 41-51"} + + + If you're not sure how to fix this error, you can + do one of the following: + + * Visit our documentation: https://ligolang.org/docs/intro/what-and-why/ + * Ask a question on our Discord: https://discord.gg/9rhYaEt + * Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new + * Check the changelog by running 'ligo changelog' |}] ; + + run_ligo_good [ "compile-contract" ; contract "self_type_annotation.ligo" ; "main" ] ; + [%expect {| + { parameter nat ; + storage int ; + code { DUP ; SELF ; SWAP ; CDR ; NIL operation ; PAIR ; DIP { DROP 2 } } } |}] + +let%expect_test _ = + run_ligo_bad [ "compile-contract" ; bad_contract "bad_contract.mligo" ; "main" ] ; + [%expect {| + ligo: in file "", line 0, characters 0-0. badly typed contract: unexpected entrypoint type {"location":"in file \"\", line 0, characters 0-0","entrypoint":"main","entrypoint_type":"( nat * int ) -> int"} + + + If you're not sure how to fix this error, you can + do one of the following: + + * Visit our documentation: https://ligolang.org/docs/intro/what-and-why/ + * Ask a question on our Discord: https://discord.gg/9rhYaEt + * Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new + * Check the changelog by running 'ligo changelog' |}] ; + + run_ligo_bad [ "compile-contract" ; bad_contract "bad_contract2.mligo" ; "main" ] ; + [%expect {| + ligo: in file "", line 0, characters 0-0. bad return type: expected (TO_list(operation)), got string {"location":"in file \"\", line 0, characters 0-0","entrypoint":"main"} + + + If you're not sure how to fix this error, you can + do one of the following: + + * Visit our documentation: https://ligolang.org/docs/intro/what-and-why/ + * Ask a question on our Discord: https://discord.gg/9rhYaEt + * Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new + * Check the changelog by running 'ligo changelog' |}] ; + + run_ligo_bad [ "compile-contract" ; bad_contract "bad_contract3.mligo" ; "main" ] ; + [%expect {| + ligo: in file "", line 0, characters 0-0. badly typed contract: expected {int} and {string} to be the same in the entrypoint type {"location":"in file \"\", line 0, characters 0-0","entrypoint":"main","entrypoint_type":"( nat * int ) -> ( (TO_list(operation)) * string )"} + + + If you're not sure how to fix this error, you can + do one of the following: + + * Visit our documentation: https://ligolang.org/docs/intro/what-and-why/ + * Ask a question on our Discord: https://discord.gg/9rhYaEt + * Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new + * Check the changelog by running 'ligo changelog' |}] \ No newline at end of file diff --git a/src/main/compile/of_simplified.ml b/src/main/compile/of_simplified.ml index f5271382c..6a948e6d5 100644 --- a/src/main/compile/of_simplified.ml +++ b/src/main/compile/of_simplified.ml @@ -1,9 +1,15 @@ open Trace -let compile (program : Ast_simplified.program) : (Ast_typed.program * Typer.Solver.state) result = +type form = + | Contract of string + | Env + +let compile (cform: form) (program : Ast_simplified.program) : (Ast_typed.program * Typer.Solver.state) result = let%bind (prog_typed , state) = Typer.type_program program in let () = Typer.Solver.discard_state state in - let%bind prog_typed' = Self_ast_typed.all_program prog_typed in + let%bind prog_typed' = match cform with + | Contract entrypoint -> Self_ast_typed.all_contract entrypoint prog_typed + | Env -> ok prog_typed in ok @@ (prog_typed', state) let compile_expression ?(env = Ast_typed.Environment.full_empty) ~(state : Typer.Solver.state) (ae : Ast_simplified.expression) diff --git a/src/main/compile/wrapper.ml b/src/main/compile/wrapper.ml deleted file mode 100644 index ae8f9043e..000000000 --- a/src/main/compile/wrapper.ml +++ /dev/null @@ -1,12 +0,0 @@ -open Trace - -let source_to_typed syntax source_file = - let%bind simplified = Of_source.compile source_file syntax in - let%bind typed,state = Of_simplified.compile simplified in - let env = Ast_typed.program_environment typed in - ok (typed,state,env) - -let source_to_typed_expression ~env ~state parameter syntax = - let%bind simplified = Of_source.compile_expression syntax parameter in - let%bind (typed,_) = Of_simplified.compile_expression ~env ~state simplified in - ok typed diff --git a/src/passes/5-self_ast_typed/contract_passes.ml b/src/passes/5-self_ast_typed/contract_passes.ml new file mode 100644 index 000000000..9f2e980da --- /dev/null +++ b/src/passes/5-self_ast_typed/contract_passes.ml @@ -0,0 +1,34 @@ +open Ast_typed +open Trace + +type contract_pass_data = { + contract_type : Helpers.contract_type ; + main_name : string ; +} + +module Errors = struct + let bad_self_type expected got loc () = + let title = thunk "bad self type" in + let message () = Format.asprintf "expected %a but got %a" Ast_typed.PP.type_expression expected Ast_typed.PP.type_expression got in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp loc) + ] in + error ~data title message () + +end + +let self_typing : contract_pass_data -> expression -> (bool * contract_pass_data * expression) result = fun dat e -> + let bad_self_err () = Errors.bad_self_type + e.type_expression + {e.type_expression with type_content = T_operator (TC_contract dat.contract_type.parameter)} + e.location + in + match e.expression_content , e.type_expression with + | E_constant {cons_name=C_SELF ; arguments=[]}, {type_content = T_operator (TC_contract t) ; type_meta=_} -> + let%bind () = + trace_strong (bad_self_err ()) @@ + Ast_typed.assert_type_expression_eq (dat.contract_type.parameter,t) in + ok (true, dat, e) + | E_constant {cons_name=C_SELF ; arguments=[]}, {type_content=_ ; type_meta=_} -> + fail (bad_self_err ()) + | _ -> ok (true,dat,e) diff --git a/src/passes/5-self_ast_typed/helpers.ml b/src/passes/5-self_ast_typed/helpers.ml index e65d497d9..f7d38302a 100644 --- a/src/passes/5-self_ast_typed/helpers.ml +++ b/src/passes/5-self_ast_typed/helpers.ml @@ -309,3 +309,86 @@ and fold_map_cases : 'a fold_mapper -> 'a -> matching_expr -> ('a * matching_exp let%bind (init,lst') = bind_fold_map_list aux init lst in ok @@ (init, Match_variant (lst', te)) ) + +and fold_map_program : 'a fold_mapper -> 'a -> program -> ('a * program) result = fun m init p -> + let aux = fun (acc,acc_prg) (x : declaration Location.wrap) -> + match Location.unwrap x with + | Declaration_constant (v , e , i, env) -> ( + let%bind (acc',e') = fold_map_expression m acc e in + let wrap_content = Declaration_constant (v , e' , i, env) in + ok (acc', List.append acc_prg [{x with wrap_content}]) + ) + in + bind_fold_list aux (init,[]) p + +module Errors = struct + let bad_contract_io entrypoint e () = + let title = thunk "badly typed contract" in + let message () = Format.asprintf "unexpected entrypoint type" in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp e.location); + ("entrypoint" , fun () -> entrypoint); + ("entrypoint_type" , fun () -> Format.asprintf "%a" Ast_typed.PP.type_expression e.type_expression) + ] in + error ~data title message () + + let expected_list_operation entrypoint got e () = + let title = thunk "bad return type" in + let message () = Format.asprintf "expected %a, got %a" + Ast_typed.PP.type_expression {got with type_content= T_operator (TC_list {got with type_content=T_constant TC_operation})} + Ast_typed.PP.type_expression got + in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp e.location); + ("entrypoint" , fun () -> entrypoint) + ] in + error ~data title message () + + let expected_same entrypoint t1 t2 e () = + let title = thunk "badly typed contract" in + let message () = Format.asprintf "expected {%a} and {%a} to be the same in the entrypoint type" + Ast_typed.PP.type_expression t1 + Ast_typed.PP.type_expression t2 + in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp e.location); + ("entrypoint" , fun () -> entrypoint); + ("entrypoint_type" , fun () -> Format.asprintf "%a" Ast_typed.PP.type_expression e.type_expression) + ] in + error ~data title message () + +end + +type contract_type = { + parameter : Ast_typed.type_expression ; + storage : Ast_typed.type_expression ; +} + +let fetch_contract_type : string -> program -> contract_type result = fun main_fname program -> + let main_decl = List.rev @@ List.filter + (fun declt -> + let (Declaration_constant (v , _ , _ , _)) = Location.unwrap declt in + String.equal (Var.to_name v) main_fname + ) + program + in + match main_decl with + | (hd::_) -> ( + let (Declaration_constant (_,e,_,_)) = Location.unwrap hd in + match e.type_expression.type_content with + | T_arrow {type1 ; type2} -> ( + match type1.type_content , type2.type_content with + | T_record tin , T_record tout when (is_tuple_lmap tin) && (is_tuple_lmap tout) -> + let%bind (parameter,storage) = Stage_common.Helpers.get_pair tin in + let%bind (listop,storage') = Stage_common.Helpers.get_pair tout in + let%bind () = trace_strong (Errors.expected_list_operation main_fname listop e) @@ + Ast_typed.assert_t_list_operation listop in + let%bind () = trace_strong (Errors.expected_same main_fname storage storage' e) @@ + Ast_typed.assert_type_expression_eq (storage,storage') in + (* TODO: on storage/parameter : assert_storable, assert_passable ? *) + ok { parameter ; storage } + | _ -> fail @@ Errors.bad_contract_io main_fname e + ) + | _ -> fail @@ Errors.bad_contract_io main_fname e + ) + | [] -> simple_fail ("Entrypoint '"^main_fname^"' does not exist") \ No newline at end of file diff --git a/src/passes/5-self_ast_typed/self_ast_typed.ml b/src/passes/5-self_ast_typed/self_ast_typed.ml index bfe730244..165a1825f 100644 --- a/src/passes/5-self_ast_typed/self_ast_typed.ml +++ b/src/passes/5-self_ast_typed/self_ast_typed.ml @@ -1,17 +1,24 @@ open Trace -let all = [] +let all_passes = [] + +let contract_passes = [ + Contract_passes.self_typing ; +] let all_program = - let all_p = List.map Helpers.map_program all in + let all_p = List.map Helpers.map_program all_passes in bind_chain all_p let all_expression = - let all_p = List.map Helpers.map_expression all in + let all_p = List.map Helpers.map_expression all_passes in bind_chain all_p -let map_expression = Helpers.map_expression - -let fold_expression = Helpers.fold_expression - -let fold_map_expression = Helpers.fold_map_expression +let all_contract main_name prg = + let%bind contract_type = Helpers.fetch_contract_type main_name prg in + let data : Contract_passes.contract_pass_data = { + contract_type = contract_type ; + main_name = main_name ; + } in + let all_p = List.map (fun pass -> Helpers.fold_map_program pass data) contract_passes in + bind_chain_ignore_acc all_p prg diff --git a/src/stages/common/helpers.ml b/src/stages/common/helpers.ml index 9a930215a..d498a1712 100644 --- a/src/stages/common/helpers.ml +++ b/src/stages/common/helpers.ml @@ -38,3 +38,9 @@ let label_range i j = let is_tuple_lmap m = List.for_all (fun i -> LMap.mem i m) @@ (label_range 0 (LMap.cardinal m)) + +let get_pair m = + let open Trace in + match (LMap.find_opt (Label "0") m , LMap.find_opt (Label "1") m) with + | Some e1, Some e2 -> ok (e1,e2) + | _ -> simple_fail "not a pair" diff --git a/src/stages/common/helpers.mli b/src/stages/common/helpers.mli index f35f9a33c..69efa24eb 100644 --- a/src/stages/common/helpers.mli +++ b/src/stages/common/helpers.mli @@ -16,3 +16,6 @@ val bind_map_cmap : 'a Types.constructor_map -> ('b Types.constructor_map * 'c list, 'd) result val is_tuple_lmap : 'a Types.label_map -> bool +val get_pair : + 'a Types.label_map -> + (('a * 'a) * 'b list, unit -> Trace.error) result diff --git a/src/test/coase_tests.ml b/src/test/coase_tests.ml index be36603c7..5df29091f 100644 --- a/src/test/coase_tests.ml +++ b/src/test/coase_tests.ml @@ -5,7 +5,7 @@ open Test_helpers let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program = @@ -21,7 +21,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/coase.ligo" (Syntax_name "pascaligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/contracts/negative/bad_contract.mligo b/src/test/contracts/negative/bad_contract.mligo new file mode 100644 index 000000000..28e5506f3 --- /dev/null +++ b/src/test/contracts/negative/bad_contract.mligo @@ -0,0 +1,5 @@ +type storage = int +type parameter = nat + +let main (action, store : parameter * storage) : storage = + store + 1 \ No newline at end of file diff --git a/src/test/contracts/negative/bad_contract2.mligo b/src/test/contracts/negative/bad_contract2.mligo new file mode 100644 index 000000000..7e95f7175 --- /dev/null +++ b/src/test/contracts/negative/bad_contract2.mligo @@ -0,0 +1,6 @@ +type storage = int +type parameter = nat +type return = string * storage + +let main (action, store : parameter * storage) : return = + ("bad",store + 1) \ No newline at end of file diff --git a/src/test/contracts/negative/bad_contract3.mligo b/src/test/contracts/negative/bad_contract3.mligo new file mode 100644 index 000000000..5c5c71a66 --- /dev/null +++ b/src/test/contracts/negative/bad_contract3.mligo @@ -0,0 +1,6 @@ +type storage = int +type parameter = nat +type return = operation list * string + +let main (action, store : parameter * storage) : return = + (([]: operation list),"bad") \ No newline at end of file diff --git a/src/test/contracts/negative/self_in_lambda.mligo b/src/test/contracts/negative/self_in_lambda.mligo index 4c497e268..b059189da 100644 --- a/src/test/contracts/negative/self_in_lambda.mligo +++ b/src/test/contracts/negative/self_in_lambda.mligo @@ -1,5 +1,5 @@ let foo (u : unit) : address = Tezos.self_address -let main (ps : unit * address) : (operation list * address) = - let dummy = foo () in - ([] : operation list), foo () +let main (ps: unit * address): (operation list * address) = + let dummy = foo () in (* force not to inline foo *) + ( ([] : operation list) , foo ()) diff --git a/src/test/contracts/negative/self_type_annotation.ligo b/src/test/contracts/negative/self_type_annotation.ligo new file mode 100644 index 000000000..1dcab5a61 --- /dev/null +++ b/src/test/contracts/negative/self_type_annotation.ligo @@ -0,0 +1,10 @@ +type parameter is nat +type storage is int +type return is list (operation) * storage + + +function main (const p : parameter; const s : storage) : return is + block { + const self_contract: contract(int) = Tezos.self; + } + with ((nil: list(operation)), s) \ No newline at end of file diff --git a/src/test/contracts/self_type_annotation.ligo b/src/test/contracts/self_type_annotation.ligo new file mode 100644 index 000000000..95c1ce3f2 --- /dev/null +++ b/src/test/contracts/self_type_annotation.ligo @@ -0,0 +1,10 @@ +type parameter is nat +type storage is int +type return is list (operation) * storage + + +function main (const p : parameter; const s : storage) : return is + block { + const self_contract: contract(parameter) = Tezos.self ; + } + with ((nil: list(operation)), s) \ No newline at end of file diff --git a/src/test/contracts/subtle_nontail_fail.mligo b/src/test/contracts/subtle_nontail_fail.mligo index 6b3c52b9b..c285b14a1 100644 --- a/src/test/contracts/subtle_nontail_fail.mligo +++ b/src/test/contracts/subtle_nontail_fail.mligo @@ -1,4 +1,4 @@ -let main (_ : unit * unit) = +let main (ps : unit * unit) : operation list * unit = if true - then failwith "This contract always fails" - else failwith "This contract still always fails" + then (failwith "This contract always fails" : operation list * unit) + else (failwith "This contract still always fails" : operation list * unit) diff --git a/src/test/hash_lock_tests.ml b/src/test/hash_lock_tests.ml index 7da1882ab..7a6db1ea8 100644 --- a/src/test/hash_lock_tests.ml +++ b/src/test/hash_lock_tests.ml @@ -4,7 +4,7 @@ open Ast_simplified let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program = @@ -19,7 +19,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/hashlock.mligo" (Syntax_name "cameligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/id_tests.ml b/src/test/id_tests.ml index db8b78960..294cd08ff 100644 --- a/src/test/id_tests.ml +++ b/src/test/id_tests.ml @@ -5,7 +5,7 @@ open Ast_simplified let mtype_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok (typed,state) let get_program = @@ -20,7 +20,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/id.mligo" (Syntax_name "cameligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index e6de67651..ffac8e299 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -5,18 +5,18 @@ open Ast_simplified.Combinators let retype_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "reasonligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in let () = Typer.Solver.discard_state state in let () = Typer.Solver.discard_state state in ok typed let mtype_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in let () = Typer.Solver.discard_state state in ok typed let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in let () = Typer.Solver.discard_state state in ok typed diff --git a/src/test/md_file_tests.ml b/src/test/md_file_tests.ml index ca3eb65e3..14748f9c8 100644 --- a/src/test/md_file_tests.ml +++ b/src/test/md_file_tests.ml @@ -69,7 +69,7 @@ let compile_groups _filename grp_list = trace (failed_to_compile_md_file _filename (s,grp,contents)) @@ let%bind v_syntax = Compile.Helpers.syntax_to_variant (Syntax_name s) None in let%bind simplified = Compile.Of_source.compile_string contents v_syntax in - let%bind typed,_ = Compile.Of_simplified.compile simplified in + let%bind typed,_ = Compile.Of_simplified.compile Env simplified in let%bind mini_c = Compile.Of_typed.compile typed in bind_map_list (fun ((_, _, exp),_) -> Compile.Of_mini_c.aggregate_and_compile_expression mini_c exp) diff --git a/src/test/multisig_tests.ml b/src/test/multisig_tests.ml index e71c5ce99..704171e01 100644 --- a/src/test/multisig_tests.ml +++ b/src/test/multisig_tests.ml @@ -7,7 +7,7 @@ let refile = "./contracts/multisig.religo" let type_file f s = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name s) in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program f st = diff --git a/src/test/multisig_v2_tests.ml b/src/test/multisig_v2_tests.ml index 0ed619c1d..391be83d2 100644 --- a/src/test/multisig_v2_tests.ml +++ b/src/test/multisig_v2_tests.ml @@ -3,7 +3,7 @@ open Test_helpers let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program = @@ -18,7 +18,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/multisig-v2.ligo" (Syntax_name "pascaligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/pledge_tests.ml b/src/test/pledge_tests.ml index 189e45a82..d6af4f369 100644 --- a/src/test/pledge_tests.ml +++ b/src/test/pledge_tests.ml @@ -5,7 +5,7 @@ open Ast_simplified let retype_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "reasonligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile Env simplified in ok (typed,state) let get_program = @@ -20,7 +20,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/pledge.religo" (Syntax_name "reasonligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile Env simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/replaceable_id_tests.ml b/src/test/replaceable_id_tests.ml index 54d7d1a64..60bcb203e 100644 --- a/src/test/replaceable_id_tests.ml +++ b/src/test/replaceable_id_tests.ml @@ -3,7 +3,7 @@ open Test_helpers let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program = @@ -18,7 +18,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/replaceable_id.ligo" (Syntax_name "pascaligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/time_lock_repeat_tests.ml b/src/test/time_lock_repeat_tests.ml index 4405948bf..b5a3f7427 100644 --- a/src/test/time_lock_repeat_tests.ml +++ b/src/test/time_lock_repeat_tests.ml @@ -4,7 +4,7 @@ open Ast_simplified let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program = @@ -19,7 +19,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/timelock_repeat.mligo" (Syntax_name "cameligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/time_lock_tests.ml b/src/test/time_lock_tests.ml index a3437461a..eb3001f49 100644 --- a/src/test/time_lock_tests.ml +++ b/src/test/time_lock_tests.ml @@ -3,7 +3,7 @@ open Test_helpers let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "pascaligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program = @@ -18,7 +18,7 @@ let get_program = let compile_main () = let%bind simplified = Ligo.Compile.Of_source.compile "./contracts/time-lock.ligo" (Syntax_name "pascaligo") in - let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed_prg,_ = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in let%bind mini_c_prg = Ligo.Compile.Of_typed.compile typed_prg in let%bind michelson_prg = Ligo.Compile.Of_mini_c.aggregate_and_compile_contract mini_c_prg "main" in let%bind (_contract: Tezos_utils.Michelson.michelson) = diff --git a/src/test/vote_tests.ml b/src/test/vote_tests.ml index 3a0a95021..ddc3d620d 100644 --- a/src/test/vote_tests.ml +++ b/src/test/vote_tests.ml @@ -3,7 +3,7 @@ open Test_helpers let type_file f = let%bind simplified = Ligo.Compile.Of_source.compile f (Syntax_name "cameligo") in - let%bind typed,state = Ligo.Compile.Of_simplified.compile simplified in + let%bind typed,state = Ligo.Compile.Of_simplified.compile (Contract "main") simplified in ok @@ (typed,state) let get_program = diff --git a/vendors/ligo-utils/simple-utils/trace.ml b/vendors/ligo-utils/simple-utils/trace.ml index 6b7cdde70..0c3bcbcdd 100644 --- a/vendors/ligo-utils/simple-utils/trace.ml +++ b/vendors/ligo-utils/simple-utils/trace.ml @@ -699,6 +699,16 @@ let rec bind_chain : ('a -> 'a result) list -> 'a -> 'a result = fun fs x -> bind aux (ok x) ) +let rec bind_chain_ignore_acc : ('a -> ('b * 'a) result) list -> 'a -> 'a result = fun fs x -> + match fs with + | [] -> ok x + | hd :: tl -> ( + let aux : 'a -> 'a result = fun x -> + hd x >>? fun (_,aa) -> + bind (bind_chain_ignore_acc tl) (ok aa) in + bind aux (ok x) + ) + (** Wraps a call that might trigger an exception in a result. *) From b7c08b78d5611c13cbe1fd340d6e4dc7c19ff826 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Fri, 6 Mar 2020 18:25:28 +0100 Subject: [PATCH 32/40] self operator now takes an entrypoint annotation as parameter --- src/bin/expect_tests/contract_tests.ml | 58 ++++++++++++++++++- .../5-self_ast_typed/contract_passes.ml | 48 ++++++++++++++- src/passes/8-compiler/compiler_program.ml | 14 +++++ src/passes/operators/operators.ml | 4 +- src/stages/ast_typed/combinators.ml | 4 ++ src/stages/ast_typed/combinators.mli | 1 + .../negative/self_bad_entrypoint_format.ligo | 11 ++++ .../negative/self_type_annotation.ligo | 2 +- src/test/contracts/self_type_annotation.ligo | 2 +- src/test/contracts/self_with_entrypoint.ligo | 12 ++++ .../contracts/self_without_entrypoint.ligo | 11 ++++ 11 files changed, 158 insertions(+), 9 deletions(-) create mode 100644 src/test/contracts/negative/self_bad_entrypoint_format.ligo create mode 100644 src/test/contracts/self_with_entrypoint.ligo create mode 100644 src/test/contracts/self_without_entrypoint.ligo diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index 6bb8326f7..fa784525d 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -1222,7 +1222,7 @@ ligo: in file "create_contract_var.mligo", line 6, character 35 to line 10, char let%expect_test _ = run_ligo_bad [ "compile-contract" ; bad_contract "self_type_annotation.ligo" ; "main" ] ; [%expect {| - ligo: in file "self_type_annotation.ligo", line 8, characters 41-51. bad self type: expected (TO_Contract (int)) but got (TO_Contract (nat)) {"location":"in file \"self_type_annotation.ligo\", line 8, characters 41-51"} + ligo: in file "self_type_annotation.ligo", line 8, characters 41-64. bad self type: expected (TO_Contract (int)) but got (TO_Contract (nat)) {"location":"in file \"self_type_annotation.ligo\", line 8, characters 41-64"} If you're not sure how to fix this error, you can @@ -1237,7 +1237,13 @@ let%expect_test _ = [%expect {| { parameter nat ; storage int ; - code { DUP ; SELF ; SWAP ; CDR ; NIL operation ; PAIR ; DIP { DROP 2 } } } |}] + code { DUP ; + SELF %default ; + SWAP ; + CDR ; + NIL operation ; + PAIR ; + DIP { DROP 2 } } } |}] let%expect_test _ = run_ligo_bad [ "compile-contract" ; bad_contract "bad_contract.mligo" ; "main" ] ; @@ -1271,6 +1277,54 @@ let%expect_test _ = ligo: in file "", line 0, characters 0-0. badly typed contract: expected {int} and {string} to be the same in the entrypoint type {"location":"in file \"\", line 0, characters 0-0","entrypoint":"main","entrypoint_type":"( nat * int ) -> ( (TO_list(operation)) * string )"} + If you're not sure how to fix this error, you can + do one of the following: + + * Visit our documentation: https://ligolang.org/docs/intro/what-and-why/ + * Ask a question on our Discord: https://discord.gg/9rhYaEt + * Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new + * Check the changelog by running 'ligo changelog' |}] + +let%expect_test _ = + run_ligo_good [ "compile-contract" ; contract "self_with_entrypoint.ligo" ; "main" ] ; + [%expect {| + { parameter (or (unit %default) (int %toto)) ; + storage nat ; + code { SELF %toto ; + DUP ; + PUSH mutez 300000000 ; + PUSH int 2 ; + TRANSFER_TOKENS ; + DUP ; + NIL operation ; + SWAP ; + CONS ; + DIP { DIP 2 { DUP } ; DIG 2 ; CDR } ; + PAIR ; + DIP { DROP 3 } } } |}] ; + + run_ligo_good [ "compile-contract" ; contract "self_without_entrypoint.ligo" ; "main" ] ; + [%expect {| + { parameter int ; + storage nat ; + code { SELF %default ; + DUP ; + PUSH mutez 300000000 ; + PUSH int 2 ; + TRANSFER_TOKENS ; + DUP ; + NIL operation ; + SWAP ; + CONS ; + DIP { DIP 2 { DUP } ; DIG 2 ; CDR } ; + PAIR ; + DIP { DROP 3 } } } |}] ; + + run_ligo_bad [ "compile-contract" ; bad_contract "self_bad_entrypoint_format.ligo" ; "main" ] ; + [%expect {| + ligo: in file "self_bad_entrypoint_format.ligo", line 8, characters 52-58. bad entrypoint format: entrypoint "Toto" is badly formatted. We expect "%Bar" for entrypoint Bar and "%Default" when no entrypoint used {"location":"in file \"self_bad_entrypoint_format.ligo\", line 8, characters 52-58","hint":"try %Toto"} + + If you're not sure how to fix this error, you can do one of the following: diff --git a/src/passes/5-self_ast_typed/contract_passes.ml b/src/passes/5-self_ast_typed/contract_passes.ml index 9f2e980da..3d93c359c 100644 --- a/src/passes/5-self_ast_typed/contract_passes.ml +++ b/src/passes/5-self_ast_typed/contract_passes.ml @@ -7,6 +7,17 @@ type contract_pass_data = { } module Errors = struct + let corner_case loc message = + let title () = "corner case" in + let content () = "we don't have a good error message for this case. we are +striving find ways to better report them and find the use-cases that generate +them. please report this to the developers." in + let data = [ + ("location" , fun () -> loc) ; + ("message" , fun () -> message) ; + ] in + error ~data title content + let bad_self_type expected got loc () = let title = thunk "bad self type" in let message () = Format.asprintf "expected %a but got %a" Ast_typed.PP.type_expression expected Ast_typed.PP.type_expression got in @@ -15,8 +26,23 @@ module Errors = struct ] in error ~data title message () + let bad_format_entrypoint_ann ep loc () = + let title = thunk "bad entrypoint format" in + let message () = Format.asprintf "entrypoint \"%s\" is badly formatted. We expect \"%%Bar\" for entrypoint Bar and \"%%Default\" when no entrypoint used" ep in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp loc) ; + ("hint" , fun () -> Format.asprintf "try %%%s" ep) + ] in + error ~data title message () + end +let check_entrypoint_annotation_format ep exp = + match String.split_on_char '%' ep with + | [ "" ; ep'] -> ok @@ ep' + | _ -> fail @@ Errors.bad_format_entrypoint_ann ep exp.location + + let self_typing : contract_pass_data -> expression -> (bool * contract_pass_data * expression) result = fun dat e -> let bad_self_err () = Errors.bad_self_type e.type_expression @@ -24,11 +50,27 @@ let self_typing : contract_pass_data -> expression -> (bool * contract_pass_data e.location in match e.expression_content , e.type_expression with - | E_constant {cons_name=C_SELF ; arguments=[]}, {type_content = T_operator (TC_contract t) ; type_meta=_} -> + | E_constant {cons_name=C_SELF ; arguments=[entrypoint_exp]}, {type_content = T_operator (TC_contract t) ; type_meta=_} -> + let%bind entrypoint = match entrypoint_exp.expression_content with + | E_literal (Literal_string ep) -> check_entrypoint_annotation_format ep entrypoint_exp + | E_variable v -> ( + match Ast_typed.Environment.get_opt v e.environment with + | Some {type_value = _; source_environment = _ ; definition = ED_declaration {expr ; free_variables = _}} -> ( + match expr.expression_content with + | E_literal (Literal_string ep) -> check_entrypoint_annotation_format ep entrypoint_exp + | _ -> fail @@ Errors.corner_case __LOC__ "SELF argument do not resolve to a string" + ) + | _ -> fail @@ Errors.corner_case __LOC__ "SELD argument not found in the environment" + ) + | _ -> fail @@ Errors.corner_case __LOC__ "SELF argument is not a string or a variable" in + let%bind entrypoint_t = match dat.contract_type.parameter.type_content with + | T_sum cmap -> trace_option (simple_error "No constructor matches the entrypoint annotation") + @@ Stage_common.Types.CMap.find_opt (Constructor entrypoint) cmap + | t -> ok {dat.contract_type.parameter with type_content = t} in let%bind () = trace_strong (bad_self_err ()) @@ - Ast_typed.assert_type_expression_eq (dat.contract_type.parameter,t) in + Ast_typed.assert_type_expression_eq (entrypoint_t , t) in ok (true, dat, e) - | E_constant {cons_name=C_SELF ; arguments=[]}, {type_content=_ ; type_meta=_} -> + | E_constant {cons_name=C_SELF ; arguments=[_]}, {type_content=_ ; type_meta=_} -> fail (bad_self_err ()) | _ -> ok (true,dat,e) diff --git a/src/passes/8-compiler/compiler_program.ml b/src/passes/8-compiler/compiler_program.ml index 73635024e..491b1b91a 100644 --- a/src/passes/8-compiler/compiler_program.ml +++ b/src/passes/8-compiler/compiler_program.ml @@ -32,6 +32,20 @@ let rec get_operator : constant' -> type_value -> expression list -> predicate r | Ok (x,_) -> ok x | Error _ -> ( match s with + | C_SELF -> ( + let%bind entrypoint_as_string = match lst with + | [{ content = E_literal (D_string s); type_value = _ }] -> ( + match String.split_on_char '%' s with + | ["" ; s] -> ok @@ String.concat "" ["%" ; (String.uncapitalize_ascii s)] + | _ -> fail @@ corner_case ~loc:__LOC__ "mini_c . SELF" + ) + | _ -> + fail @@ corner_case ~loc:__LOC__ "mini_c . SELF" in + ok @@ simple_unary @@ seq [ + i_drop ; + prim ~annot:[entrypoint_as_string] I_SELF + ] + ) | C_NONE -> ( let%bind ty' = Mini_c.get_t_option ty in let%bind m_ty = Compiler_type.type_ ty' in diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index bcb0ce691..e2adcc18f 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -792,7 +792,8 @@ module Typer = struct let self_address = typer_0 "SELF_ADDRESS" @@ fun _ -> ok @@ t_address () - let self = typer_0 "SELF" @@ fun tv_opt -> + let self = typer_1_opt "SELF" @@ fun entrypoint_as_string tv_opt -> + let%bind () = assert_t_string entrypoint_as_string in match tv_opt with | None -> simple_fail "untyped SELF" | Some t -> ok @@ t @@ -1310,7 +1311,6 @@ module Compiler = struct | C_AMOUNT -> ok @@ simple_constant @@ prim I_AMOUNT | C_ADDRESS -> ok @@ simple_unary @@ prim I_ADDRESS | C_SELF_ADDRESS -> ok @@ simple_constant @@ seq [prim I_SELF; prim I_ADDRESS] - | C_SELF -> ok @@ simple_constant @@ seq [prim I_SELF] | C_IMPLICIT_ACCOUNT -> ok @@ simple_unary @@ prim I_IMPLICIT_ACCOUNT | C_SET_DELEGATE -> ok @@ simple_unary @@ prim I_SET_DELEGATE | C_NOW -> ok @@ simple_constant @@ prim I_NOW diff --git a/src/stages/ast_typed/combinators.ml b/src/stages/ast_typed/combinators.ml index d1c0c4b1a..0a54bc708 100644 --- a/src/stages/ast_typed/combinators.ml +++ b/src/stages/ast_typed/combinators.ml @@ -233,6 +233,10 @@ let assert_t_bytes = fun t -> let%bind _ = get_t_bytes t in ok () +let assert_t_string = fun t -> + let%bind _ = get_t_string t in + ok () + let assert_t_operation (t:type_expression) : unit result = match t.type_content with | T_constant (TC_operation) -> ok () diff --git a/src/stages/ast_typed/combinators.mli b/src/stages/ast_typed/combinators.mli index 273fa15be..1b3f31aea 100644 --- a/src/stages/ast_typed/combinators.mli +++ b/src/stages/ast_typed/combinators.mli @@ -91,6 +91,7 @@ val is_t_bytes : type_expression -> bool val is_t_int : type_expression -> bool val assert_t_bytes : type_expression -> unit result +val assert_t_string : type_expression -> unit result (* val assert_t_operation : type_expression -> unit result *) diff --git a/src/test/contracts/negative/self_bad_entrypoint_format.ligo b/src/test/contracts/negative/self_bad_entrypoint_format.ligo new file mode 100644 index 000000000..ee22c4979 --- /dev/null +++ b/src/test/contracts/negative/self_bad_entrypoint_format.ligo @@ -0,0 +1,11 @@ +type parameter is Default | Toto of int +type storage is nat +type return is list (operation) * storage + + +function main (const p : parameter; const s : storage) : return is + block { + const self_contract: contract(int) = Tezos.self("Toto") ; + const op : operation = Tezos.transaction (2, 300tz, self_contract) ; + } + with (list [op], s) \ No newline at end of file diff --git a/src/test/contracts/negative/self_type_annotation.ligo b/src/test/contracts/negative/self_type_annotation.ligo index 1dcab5a61..d292c17a0 100644 --- a/src/test/contracts/negative/self_type_annotation.ligo +++ b/src/test/contracts/negative/self_type_annotation.ligo @@ -5,6 +5,6 @@ type return is list (operation) * storage function main (const p : parameter; const s : storage) : return is block { - const self_contract: contract(int) = Tezos.self; + const self_contract: contract(int) = Tezos.self ("%Default"); } with ((nil: list(operation)), s) \ No newline at end of file diff --git a/src/test/contracts/self_type_annotation.ligo b/src/test/contracts/self_type_annotation.ligo index 95c1ce3f2..12a74ae5b 100644 --- a/src/test/contracts/self_type_annotation.ligo +++ b/src/test/contracts/self_type_annotation.ligo @@ -5,6 +5,6 @@ type return is list (operation) * storage function main (const p : parameter; const s : storage) : return is block { - const self_contract: contract(parameter) = Tezos.self ; + const self_contract: contract(parameter) = Tezos.self("%Default") ; } with ((nil: list(operation)), s) \ No newline at end of file diff --git a/src/test/contracts/self_with_entrypoint.ligo b/src/test/contracts/self_with_entrypoint.ligo new file mode 100644 index 000000000..d690c0187 --- /dev/null +++ b/src/test/contracts/self_with_entrypoint.ligo @@ -0,0 +1,12 @@ +type parameter is Default | Toto of int +type storage is nat +type return is list (operation) * storage + + +function main (const p : parameter; const s : storage) : return is + block { + const v : string = "%Toto" ; + const self_contract: contract(int) = Tezos.self(v) ; + const op : operation = Tezos.transaction (2, 300tz, self_contract) ; + } + with (list [op], s) \ No newline at end of file diff --git a/src/test/contracts/self_without_entrypoint.ligo b/src/test/contracts/self_without_entrypoint.ligo new file mode 100644 index 000000000..ce5fa7d74 --- /dev/null +++ b/src/test/contracts/self_without_entrypoint.ligo @@ -0,0 +1,11 @@ +type parameter is int +type storage is nat +type return is list (operation) * storage + + +function main (const p : parameter; const s : storage) : return is + block { + const self_contract: contract(int) = Tezos.self("%Default") ; + const op : operation = Tezos.transaction (2, 300tz, self_contract) ; + } + with (list [op], s) \ No newline at end of file From 68f562ffc661b2bfcd1a064acd42e0c4bb7b4476 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Fri, 6 Mar 2020 18:42:57 +0100 Subject: [PATCH 33/40] add some doc about self in the reference page --- gitlab-pages/docs/reference/current.md | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gitlab-pages/docs/reference/current.md b/gitlab-pages/docs/reference/current.md index 0b5cd7265..45e3c6f35 100644 --- a/gitlab-pages/docs/reference/current.md +++ b/gitlab-pages/docs/reference/current.md @@ -321,6 +321,37 @@ let main = (p : unit) : address => Tezos.self_address; +## Self + +Typecast the currently running contract with an entrypoint annotation. +If your are using entrypoints: use "%Bar" for constructor Bar +If you are not using entrypoints: use "%Default" + + + +```pascaligo +function main (const p : unit) : contract(unit) is block { + const c : contract(unit) = Tezos.self("%Default") ; +} with c +``` + + + + +```cameligo +let main (p : unit) : unit contract = + (Tezos.self("%Default") : unit contract) +``` + + + + +```reasonligo +let main = (p: unit) : contract(unit) => + (Tezos.self("%Default") : contract(unit)); +``` + + ## Implicit Account From 7717ac926e0c5e42fa4d8012a9106fd9f37f664c Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Fri, 6 Mar 2020 18:51:56 +0100 Subject: [PATCH 34/40] changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe908e334..3fc44d2cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ ## [Unreleased] -## [Add crypto reference page to docs](https://gitlab.com/ligolang/ligo/-/merge_requests/459) +## [Support for self] (https://gitlab.com/ligolang/ligo/-/merge_requests/453) +### Added +- support for `Tezos.self(%Entrypoint)` + +## [Support for create_contract](https://gitlab.com/ligolang/ligo/-/merge_requests/459) ### Added - support for `Tezos.create_contract` origination From 25f004844a9dd45e677081a153da4f6950829c24 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Mon, 9 Mar 2020 11:22:56 +0100 Subject: [PATCH 35/40] self: now reject capitalized entrypoint annotation --- gitlab-pages/docs/reference/current.md | 4 +- src/bin/expect_tests/contract_tests.ml | 2 +- .../5-self_ast_typed/contract_passes.ml | 52 +++++++++---------- .../negative/self_type_annotation.ligo | 2 +- src/test/contracts/self_type_annotation.ligo | 2 +- src/test/contracts/self_with_entrypoint.ligo | 4 +- .../contracts/self_without_entrypoint.ligo | 2 +- 7 files changed, 32 insertions(+), 36 deletions(-) diff --git a/gitlab-pages/docs/reference/current.md b/gitlab-pages/docs/reference/current.md index 45e3c6f35..642bbb6fe 100644 --- a/gitlab-pages/docs/reference/current.md +++ b/gitlab-pages/docs/reference/current.md @@ -324,8 +324,8 @@ let main = (p : unit) : address => Tezos.self_address; ## Self Typecast the currently running contract with an entrypoint annotation. -If your are using entrypoints: use "%Bar" for constructor Bar -If you are not using entrypoints: use "%Default" +If your are using entrypoints: use "%bar" for constructor Bar +If you are not using entrypoints: use "%default" diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index fa784525d..49b1563d7 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -1322,7 +1322,7 @@ let%expect_test _ = run_ligo_bad [ "compile-contract" ; bad_contract "self_bad_entrypoint_format.ligo" ; "main" ] ; [%expect {| - ligo: in file "self_bad_entrypoint_format.ligo", line 8, characters 52-58. bad entrypoint format: entrypoint "Toto" is badly formatted. We expect "%Bar" for entrypoint Bar and "%Default" when no entrypoint used {"location":"in file \"self_bad_entrypoint_format.ligo\", line 8, characters 52-58","hint":"try %Toto"} + ligo: in file "self_bad_entrypoint_format.ligo", line 8, characters 52-58. bad entrypoint format: entrypoint "Toto" is badly formatted. We expect "%bar" for entrypoint Bar and "%default" when no entrypoint used {"location":"in file \"self_bad_entrypoint_format.ligo\", line 8, characters 52-58"} If you're not sure how to fix this error, you can diff --git a/src/passes/5-self_ast_typed/contract_passes.ml b/src/passes/5-self_ast_typed/contract_passes.ml index 3d93c359c..c16898146 100644 --- a/src/passes/5-self_ast_typed/contract_passes.ml +++ b/src/passes/5-self_ast_typed/contract_passes.ml @@ -7,17 +7,6 @@ type contract_pass_data = { } module Errors = struct - let corner_case loc message = - let title () = "corner case" in - let content () = "we don't have a good error message for this case. we are -striving find ways to better report them and find the use-cases that generate -them. please report this to the developers." in - let data = [ - ("location" , fun () -> loc) ; - ("message" , fun () -> message) ; - ] in - error ~data title content - let bad_self_type expected got loc () = let title = thunk "bad self type" in let message () = Format.asprintf "expected %a but got %a" Ast_typed.PP.type_expression expected Ast_typed.PP.type_expression got in @@ -28,10 +17,25 @@ them. please report this to the developers." in let bad_format_entrypoint_ann ep loc () = let title = thunk "bad entrypoint format" in - let message () = Format.asprintf "entrypoint \"%s\" is badly formatted. We expect \"%%Bar\" for entrypoint Bar and \"%%Default\" when no entrypoint used" ep in + let message () = Format.asprintf "entrypoint \"%s\" is badly formatted. We expect \"%%bar\" for entrypoint Bar and \"%%default\" when no entrypoint used" ep in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp loc) ; + ] in + error ~data title message () + + let entrypoint_annotation_not_literal loc () = + let title = thunk "entrypoint annotation must be a string literal" in + let message () = Format.asprintf "" in + let data = [ + ("location" , fun () -> Format.asprintf "%a" Location.pp loc) ; + ] in + error ~data title message () + + let unmatched_entrypoint loc () = + let title = thunk "No constructor matches the entrypoint annotation" in + let message () = Format.asprintf "" in let data = [ ("location" , fun () -> Format.asprintf "%a" Location.pp loc) ; - ("hint" , fun () -> Format.asprintf "try %%%s" ep) ] in error ~data title message () @@ -39,7 +43,10 @@ end let check_entrypoint_annotation_format ep exp = match String.split_on_char '%' ep with - | [ "" ; ep'] -> ok @@ ep' + | [ "" ; ep'] -> + let cap = String.capitalize_ascii ep' in + if String.equal cap ep' then fail @@ Errors.bad_format_entrypoint_ann ep exp.location + else ok cap | _ -> fail @@ Errors.bad_format_entrypoint_ann ep exp.location @@ -52,25 +59,14 @@ let self_typing : contract_pass_data -> expression -> (bool * contract_pass_data match e.expression_content , e.type_expression with | E_constant {cons_name=C_SELF ; arguments=[entrypoint_exp]}, {type_content = T_operator (TC_contract t) ; type_meta=_} -> let%bind entrypoint = match entrypoint_exp.expression_content with - | E_literal (Literal_string ep) -> check_entrypoint_annotation_format ep entrypoint_exp - | E_variable v -> ( - match Ast_typed.Environment.get_opt v e.environment with - | Some {type_value = _; source_environment = _ ; definition = ED_declaration {expr ; free_variables = _}} -> ( - match expr.expression_content with - | E_literal (Literal_string ep) -> check_entrypoint_annotation_format ep entrypoint_exp - | _ -> fail @@ Errors.corner_case __LOC__ "SELF argument do not resolve to a string" - ) - | _ -> fail @@ Errors.corner_case __LOC__ "SELD argument not found in the environment" - ) - | _ -> fail @@ Errors.corner_case __LOC__ "SELF argument is not a string or a variable" in + | E_literal (Literal_string ep) -> check_entrypoint_annotation_format ep entrypoint_exp + | _ -> fail @@ Errors.entrypoint_annotation_not_literal entrypoint_exp.location in let%bind entrypoint_t = match dat.contract_type.parameter.type_content with - | T_sum cmap -> trace_option (simple_error "No constructor matches the entrypoint annotation") + | T_sum cmap -> trace_option (Errors.unmatched_entrypoint entrypoint_exp.location) @@ Stage_common.Types.CMap.find_opt (Constructor entrypoint) cmap | t -> ok {dat.contract_type.parameter with type_content = t} in let%bind () = trace_strong (bad_self_err ()) @@ Ast_typed.assert_type_expression_eq (entrypoint_t , t) in ok (true, dat, e) - | E_constant {cons_name=C_SELF ; arguments=[_]}, {type_content=_ ; type_meta=_} -> - fail (bad_self_err ()) | _ -> ok (true,dat,e) diff --git a/src/test/contracts/negative/self_type_annotation.ligo b/src/test/contracts/negative/self_type_annotation.ligo index d292c17a0..375fbf0af 100644 --- a/src/test/contracts/negative/self_type_annotation.ligo +++ b/src/test/contracts/negative/self_type_annotation.ligo @@ -5,6 +5,6 @@ type return is list (operation) * storage function main (const p : parameter; const s : storage) : return is block { - const self_contract: contract(int) = Tezos.self ("%Default"); + const self_contract: contract(int) = Tezos.self ("%default"); } with ((nil: list(operation)), s) \ No newline at end of file diff --git a/src/test/contracts/self_type_annotation.ligo b/src/test/contracts/self_type_annotation.ligo index 12a74ae5b..3bd607aa1 100644 --- a/src/test/contracts/self_type_annotation.ligo +++ b/src/test/contracts/self_type_annotation.ligo @@ -5,6 +5,6 @@ type return is list (operation) * storage function main (const p : parameter; const s : storage) : return is block { - const self_contract: contract(parameter) = Tezos.self("%Default") ; + const self_contract: contract(parameter) = Tezos.self("%default") ; } with ((nil: list(operation)), s) \ No newline at end of file diff --git a/src/test/contracts/self_with_entrypoint.ligo b/src/test/contracts/self_with_entrypoint.ligo index d690c0187..aede1b5b5 100644 --- a/src/test/contracts/self_with_entrypoint.ligo +++ b/src/test/contracts/self_with_entrypoint.ligo @@ -5,8 +5,8 @@ type return is list (operation) * storage function main (const p : parameter; const s : storage) : return is block { - const v : string = "%Toto" ; - const self_contract: contract(int) = Tezos.self(v) ; + // const v : string = "%toto" ; + const self_contract: contract(int) = Tezos.self("%toto") ; const op : operation = Tezos.transaction (2, 300tz, self_contract) ; } with (list [op], s) \ No newline at end of file diff --git a/src/test/contracts/self_without_entrypoint.ligo b/src/test/contracts/self_without_entrypoint.ligo index ce5fa7d74..04701cf1d 100644 --- a/src/test/contracts/self_without_entrypoint.ligo +++ b/src/test/contracts/self_without_entrypoint.ligo @@ -5,7 +5,7 @@ type return is list (operation) * storage function main (const p : parameter; const s : storage) : return is block { - const self_contract: contract(int) = Tezos.self("%Default") ; + const self_contract: contract(int) = Tezos.self("%default") ; const op : operation = Tezos.transaction (2, 300tz, self_contract) ; } with (list [op], s) \ No newline at end of file From e436a0a08a73797d9d09aa80e08bca782fd28dec Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Wulfman Date: Tue, 18 Feb 2020 16:55:20 +0100 Subject: [PATCH 36/40] removes loops --- src/passes/3-self_ast_simplified/helpers.ml | 14 ---------- src/passes/4-typer-new/typer.ml | 14 ---------- src/passes/4-typer-new/typer.ml.old | 23 --------------- src/passes/4-typer-old/typer.ml | 31 --------------------- src/passes/5-self_ast_typed/helpers.ml | 16 +---------- src/passes/6-interpreter/interpreter.ml | 2 +- src/passes/6-transpiler/transpiler.ml | 5 ---- src/stages/ast_simplified/PP.ml | 2 -- src/stages/ast_simplified/combinators.ml | 1 - src/stages/ast_simplified/combinators.mli | 1 - src/stages/ast_simplified/misc.ml | 2 +- src/stages/ast_simplified/types.ml | 3 -- src/stages/ast_typed/PP.ml | 2 -- src/stages/ast_typed/misc.ml | 3 +- src/stages/ast_typed/misc_smart.ml | 3 -- src/stages/ast_typed/types.ml | 23 +++++---------- src/stages/typesystem/misc.ml | 4 --- 17 files changed, 11 insertions(+), 138 deletions(-) diff --git a/src/passes/3-self_ast_simplified/helpers.ml b/src/passes/3-self_ast_simplified/helpers.ml index 40520a0f4..40de7371b 100644 --- a/src/passes/3-self_ast_simplified/helpers.ml +++ b/src/passes/3-self_ast_simplified/helpers.ml @@ -19,10 +19,6 @@ let rec fold_expression : 'a folder -> 'a -> expression -> 'a result = fun f ini | E_look_up ab -> let%bind res = bind_fold_pair self init' ab in ok res - | E_loop {condition;body} -> - let ab = (condition,body) in - let%bind res = bind_fold_pair self init' ab in - ok res | E_application {expr1;expr2} -> ( let ab = (expr1,expr2) in let%bind res = bind_fold_pair self init' ab in @@ -116,11 +112,6 @@ let rec map_expression : mapper -> expression -> expression result = fun f e -> let%bind ab' = bind_map_pair self ab in return @@ E_look_up ab' ) - | E_loop {condition;body} -> ( - let ab = (condition,body) in - let%bind (a,b) = bind_map_pair self ab in - return @@ E_loop {condition = a; body = b} - ) | E_ascription ascr -> ( let%bind e' = self ascr.anno_expr in return @@ E_ascription {ascr with anno_expr=e'} @@ -237,11 +228,6 @@ let rec fold_map_expression : 'a fold_mapper -> 'a -> expression -> ('a * expres let%bind (res, ab') = bind_fold_map_pair self init' ab in ok (res, return @@ E_look_up ab') ) - | E_loop {condition;body} -> ( - let ab = (condition,body) in - let%bind (res,(a,b)) = bind_fold_map_pair self init' ab in - ok (res, return @@ E_loop {condition = a; body = b}) - ) | E_ascription ascr -> ( let%bind (res,e') = self init' ascr.anno_expr in ok (res, return @@ E_ascription {ascr with anno_expr=e'}) diff --git a/src/passes/4-typer-new/typer.ml b/src/passes/4-typer-new/typer.ml index 7c0b045be..0ca9f8ef8 100644 --- a/src/passes/4-typer-new/typer.ml +++ b/src/passes/4-typer-new/typer.ml @@ -159,14 +159,6 @@ module Errors = struct ] in error ~data title message () - let not_supported_yet_untranspile (message : string) (ae : O.expression) () = - let title = (thunk "not supported yet") in - let message () = message in - let data = [ - ("expression" , fun () -> Format.asprintf "%a" O.PP.expression ae) - ] in - error ~data title message () - end open Errors @@ -734,11 +726,6 @@ and type_expression : environment -> Solver.state -> ?tv_opt:O.type_expression - * tv_opt in * return (O.E_matching (ex', m')) tv * ) *) - | E_loop {condition; body} -> - let%bind (expr' , state') = type_expression e state condition in - let%bind (body' , state'') = type_expression e state' body in - let wrapped = Wrap.loop expr'.type_expression body'.type_expression in - return_wrapped (O.E_loop {condition=expr';body=body'}) state'' wrapped | E_let_in {let_binder ; rhs ; let_result; inline} -> let%bind rhs_tv_opt = bind_map_option (evaluate_type e) (snd let_binder) in (* TODO: the binder annotation should just be an annotation node *) @@ -1100,7 +1087,6 @@ let rec untype_expression (e:O.expression) : (I.expression) result = (* | E_failwith ae -> * let%bind ae' = untype_expression ae in * return (e_failwith ae') *) - | E_loop _ -> fail @@ not_supported_yet_untranspile "not possible to untranspile statements yet" e | E_let_in {let_binder; rhs;let_result; inline} -> let%bind tv = untype_type_value rhs.type_expression in let%bind rhs = untype_expression rhs in diff --git a/src/passes/4-typer-new/typer.ml.old b/src/passes/4-typer-new/typer.ml.old index a302301e0..db842716a 100644 --- a/src/passes/4-typer-new/typer.ml.old +++ b/src/passes/4-typer-new/typer.ml.old @@ -675,28 +675,6 @@ and type_expression : environment -> ?tv_opt:O.type_expression -> I.expression - a'.location) @@ Ast_typed.assert_type_expression_eq (t_unit () , a'_type_annot) in return (O.E_sequence (a' , b')) (get_type_annotation b') - | E_loop (expr , body) -> - let%bind expr' = type_expression e expr in - let%bind body' = type_expression e body in - let t_expr' = get_type_annotation expr' in - let%bind () = - trace_strong (type_error - ~msg:"while condition isn't of type bool" - ~expected:(O.t_bool ()) - ~actual:t_expr' - ~expression:expr - expr'.location) @@ - Ast_typed.assert_type_expression_eq (t_bool () , t_expr') in - let t_body' = get_type_annotation body' in - let%bind () = - trace_strong (type_error - ~msg:"while body isn't of unit type" - ~expected:(O.t_unit ()) - ~actual:t_body' - ~expression:body - body'.location) @@ - Ast_typed.assert_type_expression_eq (t_unit () , t_body') in - return (O.E_loop (expr' , body')) (t_unit ()) | E_assign (name , path , expr) -> let%bind typed_name = let%bind ele = Environment.get_trace name e in @@ -834,7 +812,6 @@ let rec untype_expression (e:O.annotated_expression) : (I.expression) result = let%bind ae' = untype_expression ae in return (e_failwith ae') | E_sequence _ - | E_loop _ | E_assign _ -> fail @@ not_supported_yet_untranspile "not possible to untranspile statements yet" e.expression | E_let_in {binder;rhs;result} -> let%bind tv = untype_type_expression rhs.type_annotation in diff --git a/src/passes/4-typer-old/typer.ml b/src/passes/4-typer-old/typer.ml index 2e13a76ab..eec5d3a49 100644 --- a/src/passes/4-typer-old/typer.ml +++ b/src/passes/4-typer-old/typer.ml @@ -205,14 +205,6 @@ module Errors = struct ] in error ~data title message () - let not_supported_yet_untranspile (message : string) (ae : O.expression) () = - let title = (thunk "not suported yet") in - let message () = message in - let data = [ - ("expression" , fun () -> Format.asprintf "%a" O.PP.expression ae) - ] in - error ~data title message () - end open Errors @@ -774,28 +766,6 @@ and type_expression' : environment -> ?tv_opt:O.type_expression -> I.expression tv_opt in return (O.E_matching {matchee=ex'; cases=m'}) tv ) - | E_loop {condition; body} -> - let%bind expr' = type_expression' e condition in - let%bind body' = type_expression' e body in - let t_expr' = get_type_expression expr' in - let%bind () = - trace_strong (type_error - ~msg:"while condition isn't of type bool" - ~expected:(O.t_bool ()) - ~actual:t_expr' - ~expression:condition - expr'.location) @@ - Ast_typed.assert_type_expression_eq (t_bool () , t_expr') in - let t_body' = get_type_expression body' in - let%bind () = - trace_strong (type_error - ~msg:"while body isn't of unit type" - ~expected:(O.t_unit ()) - ~actual:t_body' - ~expression:body - body'.location) @@ - Ast_typed.assert_type_expression_eq (t_unit () , t_body') in - return (O.E_loop {condition=expr'; body=body'}) (t_unit ()) | E_let_in {let_binder ; rhs ; let_result; inline} -> let%bind rhs_tv_opt = bind_map_option (evaluate_type e) (snd let_binder) in let%bind rhs = type_expression' ?tv_opt:rhs_tv_opt e rhs in @@ -909,7 +879,6 @@ let rec untype_expression (e:O.expression) : (I.expression) result = let%bind ae' = untype_expression matchee in let%bind m' = untype_matching untype_expression cases in return (e_matching ae' m') - | E_loop _-> fail @@ not_supported_yet_untranspile "not possible to untranspile statements yet" e | E_let_in {let_binder;rhs;let_result; inline} -> let%bind tv = untype_type_expression rhs.type_expression in let%bind rhs = untype_expression rhs in diff --git a/src/passes/5-self_ast_typed/helpers.ml b/src/passes/5-self_ast_typed/helpers.ml index f7d38302a..153093b06 100644 --- a/src/passes/5-self_ast_typed/helpers.ml +++ b/src/passes/5-self_ast_typed/helpers.ml @@ -19,10 +19,6 @@ let rec fold_expression : 'a folder -> 'a -> expression -> 'a result = fun f ini | E_look_up ab -> let%bind res = bind_fold_pair self init' ab in ok res - | E_loop {condition;body} -> - let ab = (condition,body) in - let%bind res = bind_fold_pair self init' ab in - ok res | E_application {expr1;expr2} -> ( let ab = (expr1,expr2) in let%bind res = bind_fold_pair self init' ab in @@ -116,11 +112,6 @@ let rec map_expression : mapper -> expression -> expression result = fun f e -> let%bind ab' = bind_map_pair self ab in return @@ E_look_up ab' ) - | E_loop {condition;body} -> ( - let ab = (condition,body) in - let%bind (a,b) = bind_map_pair self ab in - return @@ E_loop {condition = a; body = b} - ) | E_matching {matchee=e;cases} -> ( let%bind e' = self e in let%bind cases' = map_cases f cases in @@ -232,11 +223,6 @@ let rec fold_map_expression : 'a fold_mapper -> 'a -> expression -> ('a * expres let%bind (res, ab') = bind_fold_map_pair self init' ab in ok (res, return @@ E_look_up ab') ) - | E_loop {condition;body} -> ( - let ab = (condition,body) in - let%bind (res,(a,b)) = bind_fold_map_pair self init' ab in - ok (res, return @@ E_loop {condition = a; body = b}) - ) | E_matching {matchee=e;cases} -> ( let%bind (res, e') = self init' e in let%bind (res,cases') = fold_map_cases f res cases in @@ -391,4 +377,4 @@ let fetch_contract_type : string -> program -> contract_type result = fun main_f ) | _ -> fail @@ Errors.bad_contract_io main_fname e ) - | [] -> simple_fail ("Entrypoint '"^main_fname^"' does not exist") \ No newline at end of file + | [] -> simple_fail ("Entrypoint '"^main_fname^"' does not exist") diff --git a/src/passes/6-interpreter/interpreter.ml b/src/passes/6-interpreter/interpreter.ml index 5b44d5b11..ed9f6d6d3 100644 --- a/src/passes/6-interpreter/interpreter.ml +++ b/src/passes/6-interpreter/interpreter.ml @@ -371,7 +371,7 @@ and eval : Ast_typed.expression -> env -> value result | _ -> simple_fail "not yet supported case" (* ((ctor,name),body) *) ) - | E_look_up _ | E_loop _ -> + | E_look_up _ -> let serr = Format.asprintf "Unsupported construct :\n %a\n" Ast_typed.PP.expression term in simple_fail serr diff --git a/src/passes/6-transpiler/transpiler.ml b/src/passes/6-transpiler/transpiler.ml index 1a4569f75..8911b76fa 100644 --- a/src/passes/6-transpiler/transpiler.ml +++ b/src/passes/6-transpiler/transpiler.ml @@ -431,11 +431,6 @@ and transpile_annotated_expression (ae:AST.expression) : expression result = let%bind (ds', i') = bind_map_pair f dsi in return @@ E_constant {cons_name=C_MAP_FIND_OPT;arguments=[i' ; ds']} ) - | E_loop {condition; body} -> ( - let%bind expr' = transpile_annotated_expression condition in - let%bind body' = transpile_annotated_expression body in - return @@ E_while (expr' , body') - ) | E_matching {matchee=expr; cases=m} -> ( let%bind expr' = transpile_annotated_expression expr in match m with diff --git a/src/stages/ast_simplified/PP.ml b/src/stages/ast_simplified/PP.ml index 80311a012..f5c2283b0 100644 --- a/src/stages/ast_simplified/PP.ml +++ b/src/stages/ast_simplified/PP.ml @@ -48,8 +48,6 @@ let rec expression ppf (e : expression) = | E_matching {matchee; cases; _} -> fprintf ppf "match %a with %a" expression matchee (matching expression) cases - | E_loop l -> - fprintf ppf "while %a do %a" expression l.condition expression l.body | E_let_in { let_binder ; mut; rhs ; let_result; inline } -> fprintf ppf "let %a%a = %a%a in %a" option_mut mut option_type_name let_binder expression rhs option_inline inline expression let_result | E_skip -> diff --git a/src/stages/ast_simplified/combinators.ml b/src/stages/ast_simplified/combinators.ml index 8de9f5b77..21c9ee183 100644 --- a/src/stages/ast_simplified/combinators.ml +++ b/src/stages/ast_simplified/combinators.ml @@ -122,7 +122,6 @@ let e_accessor ?loc a b = location_wrap ?loc @@ E_record_accessor {expr = a; lab let e_accessor_list ?loc a b = List.fold_left (fun a b -> e_accessor ?loc a b) a b let e_variable ?loc v = location_wrap ?loc @@ E_variable v let e_skip ?loc () = location_wrap ?loc @@ E_skip -let e_loop ?loc condition body = location_wrap ?loc @@ E_loop {condition; body} let e_let_in ?loc (binder, ascr) mut inline rhs let_result = location_wrap ?loc @@ E_let_in { let_binder = (binder, ascr) ; mut; rhs ; let_result; inline } let e_annotation ?loc anno_expr ty = location_wrap ?loc @@ E_ascription {anno_expr; type_annotation = ty} diff --git a/src/stages/ast_simplified/combinators.mli b/src/stages/ast_simplified/combinators.mli index 9b18599be..37e32bb5f 100644 --- a/src/stages/ast_simplified/combinators.mli +++ b/src/stages/ast_simplified/combinators.mli @@ -83,7 +83,6 @@ val e_accessor : ?loc:Location.t -> expression -> string -> expression val e_accessor_list : ?loc:Location.t -> expression -> string list -> expression val e_variable : ?loc:Location.t -> expression_variable -> expression val e_skip : ?loc:Location.t -> unit -> expression -val e_loop : ?loc:Location.t -> expression -> expression -> expression val e_sequence : ?loc:Location.t -> expression -> expression -> expression val e_cond: ?loc:Location.t -> expression -> expression -> expression -> expression val e_let_in : ?loc:Location.t -> ( expression_variable * type_expression option ) -> bool -> bool -> expression -> expression -> expression diff --git a/src/stages/ast_simplified/misc.ml b/src/stages/ast_simplified/misc.ml index 31cccf719..bb309048e 100644 --- a/src/stages/ast_simplified/misc.ml +++ b/src/stages/ast_simplified/misc.ml @@ -184,7 +184,7 @@ let rec assert_value_eq (a, b: (expression * expression )) : unit result = | (E_application _, _) | (E_let_in _, _) | (E_record_accessor _, _) | (E_look_up _, _) | (E_matching _, _) - | (E_loop _, _) | (E_skip, _) -> simple_fail "comparing not a value" + | (E_skip, _) -> simple_fail "comparing not a value" let is_value_eq (a , b) = to_bool @@ assert_value_eq (a , b) diff --git a/src/stages/ast_simplified/types.ml b/src/stages/ast_simplified/types.ml index 9c1b9eaa1..de0de0934 100644 --- a/src/stages/ast_simplified/types.ml +++ b/src/stages/ast_simplified/types.ml @@ -51,7 +51,6 @@ and expression_content = | E_set of expression list | E_look_up of (expression * expression) (* Advanced *) - | E_loop of loop | E_ascription of ascription and constant = @@ -79,8 +78,6 @@ and accessor = {expr: expression; label: label} and update = {record: expression; path: label ; update: expression} -and loop = {condition: expression; body: expression} - and matching_expr = (expr,unit) matching_content and matching = { matchee: expression diff --git a/src/stages/ast_typed/PP.ml b/src/stages/ast_typed/PP.ml index 09d6a1734..a0f15514b 100644 --- a/src/stages/ast_typed/PP.ml +++ b/src/stages/ast_typed/PP.ml @@ -44,8 +44,6 @@ let rec expression ppf (e : expression) = expression result | E_matching {matchee; cases;} -> fprintf ppf "match %a with %a" expression matchee (matching expression) cases - | E_loop l -> - fprintf ppf "while %a do %a" expression l.condition expression l.body | E_let_in {let_binder; rhs; let_result; inline} -> fprintf ppf "let %a = %a%a in %a" expression_variable let_binder expression rhs option_inline inline expression let_result diff --git a/src/stages/ast_typed/misc.ml b/src/stages/ast_typed/misc.ml index ee404596a..9395c511a 100644 --- a/src/stages/ast_typed/misc.ml +++ b/src/stages/ast_typed/misc.ml @@ -216,7 +216,6 @@ module Free_variables = struct | (E_map m | E_big_map m) -> unions @@ List.map self @@ List.concat @@ List.map (fun (a, b) -> [ a ; b ]) m | E_look_up (a , b) -> unions @@ List.map self [ a ; b ] | E_matching {matchee; cases;_} -> union (self matchee) (matching_expression b cases) - | E_loop {condition ; body} -> unions @@ List.map self [ condition ; body ] | E_let_in { let_binder; rhs; let_result; _} -> let b' = union (singleton let_binder) b in union @@ -533,7 +532,7 @@ let rec assert_value_eq (a, b: (expression*expression)) : unit result = | (E_lambda _, _) | (E_let_in _, _) | (E_record_accessor _, _) | (E_record_update _,_) | (E_look_up _, _) | (E_matching _, _) - | (E_loop _, _)-> fail @@ error_uncomparable_values "can't compare sequences nor loops" a b + -> fail @@ error_uncomparable_values "can't compare sequences nor loops" a b let merge_annotation (a:type_expression option) (b:type_expression option) err : type_expression result = match a, b with diff --git a/src/stages/ast_typed/misc_smart.ml b/src/stages/ast_typed/misc_smart.ml index bf376f383..ebe25ace2 100644 --- a/src/stages/ast_typed/misc_smart.ml +++ b/src/stages/ast_typed/misc_smart.ml @@ -89,9 +89,6 @@ module Captured_variables = struct let%bind a' = self matchee in let%bind cs' = matching_expression b cases in ok @@ union a' cs' - | E_loop {condition; body} -> - let%bind lst' = bind_map_list self [ condition ; body ] in - ok @@ unions lst' | E_let_in li -> let b' = union (singleton li.let_binder) b in expression b' li.let_result diff --git a/src/stages/ast_typed/types.ml b/src/stages/ast_typed/types.ml index 8b9195d60..c20eef077 100644 --- a/src/stages/ast_typed/types.ml +++ b/src/stages/ast_typed/types.ml @@ -55,14 +55,10 @@ and expression_content = | E_list of expression list | E_set of expression list | E_look_up of (expression * expression) - (* Advanced *) - | E_loop of loop - (* | E_ascription of ascription *) -and constant = { - cons_name: constant' ; - arguments: expression list ; - } +and constant = + { cons_name: constant' + ; arguments: expression list } and application = {expr1: expression; expr2: expression} @@ -96,15 +92,10 @@ and update = { update: expression ; } -and loop = { - condition: expression ; - body: expression ; - } - -and matching_expr = (expression, type_expression) matching_content -and matching = { - matchee: expression ; - cases: matching_expr ; +and matching_expr = (expression,type_expression) matching_content +and matching = + { matchee: expression + ; cases: matching_expr } and ascription = { diff --git a/src/stages/typesystem/misc.ml b/src/stages/typesystem/misc.ml index 011fef1b7..f6618dd43 100644 --- a/src/stages/typesystem/misc.ml +++ b/src/stages/typesystem/misc.ml @@ -212,10 +212,6 @@ module Substitution = struct let%bind matchee = s_expression ~substs matchee in let%bind cases = s_matching_expr ~substs cases in ok @@ T.E_matching {matchee;cases} - | T.E_loop {condition;body} -> - let%bind condition = s_expression ~substs condition in - let%bind body = s_expression ~substs body in - ok @@ T.E_loop {condition;body} and s_expression : T.expression w = fun ~(substs:substs) { expression_content; type_expression; environment; location } -> let%bind expression_content = s_expression_content ~substs expression_content in From bc7a4daa64fec6e6b7d0503145124a703a75ab03 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Fri, 21 Feb 2020 17:05:52 +0100 Subject: [PATCH 37/40] add 'mapi' equivalent for label and constructor maps --- src/stages/common/helpers.ml | 2 ++ src/stages/common/helpers.mli | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/stages/common/helpers.ml b/src/stages/common/helpers.ml index d498a1712..5dba263b8 100644 --- a/src/stages/common/helpers.ml +++ b/src/stages/common/helpers.ml @@ -28,6 +28,8 @@ let bind_fold_lmap f init (lmap:_ LMap.t) = let bind_map_lmap f map = bind_lmap (LMap.map f map) let bind_map_cmap f map = bind_cmap (CMap.map f map) +let bind_map_lmapi f map = bind_lmap (LMap.mapi f map) +let bind_map_cmapi f map = bind_cmap (CMap.mapi f map) let range i j = let rec aux i j acc = if i >= j then acc else aux i (j-1) (j-1 :: acc) in diff --git a/src/stages/common/helpers.mli b/src/stages/common/helpers.mli index 69efa24eb..d5e388e36 100644 --- a/src/stages/common/helpers.mli +++ b/src/stages/common/helpers.mli @@ -19,3 +19,12 @@ val is_tuple_lmap : 'a Types.label_map -> bool val get_pair : 'a Types.label_map -> (('a * 'a) * 'b list, unit -> Trace.error) result + + + +val bind_map_lmapi : + (Types.label -> 'a -> ('b * 'c list, 'd) result) -> + 'a Types.label_map -> ('b Types.label_map * 'c list, 'd) result +val bind_map_cmapi : + (Types.constructor' -> 'a -> ('b * 'c list, 'd) result) -> + 'a Types.constructor_map -> ('b Types.constructor_map * 'c list, 'd) result From 5a15feadc157f1f87a44408643069f46d33e02e0 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Fri, 21 Feb 2020 17:07:48 +0100 Subject: [PATCH 38/40] now map over type declarations --- .../entrypoints_lenght_limit.ml | 25 +++++++ src/passes/3-self_ast_simplified/helpers.ml | 71 ++++++++++++++++--- .../self_ast_simplified.ml | 15 ++-- 3 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 src/passes/3-self_ast_simplified/entrypoints_lenght_limit.ml diff --git a/src/passes/3-self_ast_simplified/entrypoints_lenght_limit.ml b/src/passes/3-self_ast_simplified/entrypoints_lenght_limit.ml new file mode 100644 index 000000000..a64007b4a --- /dev/null +++ b/src/passes/3-self_ast_simplified/entrypoints_lenght_limit.ml @@ -0,0 +1,25 @@ +open Ast_simplified +open Trace +open Stage_common.Helpers + +module Errors = struct + let bad_string_timestamp name () = + let title = thunk @@ Format.asprintf ("Too long constructor '%s'") name in + let message () = "names length is limited to 32 (tezos limitation)" in + error title message () +end +open Errors + +let peephole_type_expression : type_expression -> type_expression result = fun e -> + let return type_content = ok { e with type_content } in + match e.type_content with + | T_sum cmap -> + let%bind _uu = bind_map_cmapi + (fun k _ -> + let (Constructor name) = k in + if (String.length name >= 32) then fail @@ bad_string_timestamp name + else ok () + ) + cmap in + ok e + | e -> return e diff --git a/src/passes/3-self_ast_simplified/helpers.ml b/src/passes/3-self_ast_simplified/helpers.ml index 40520a0f4..f34f48514 100644 --- a/src/passes/3-self_ast_simplified/helpers.ml +++ b/src/passes/3-self_ast_simplified/helpers.ml @@ -90,8 +90,12 @@ and fold_cases : 'a folder -> 'a -> matching_expr -> 'a result = fun f init m -> ok res ) -type mapper = expression -> expression result -let rec map_expression : mapper -> expression -> expression result = fun f e -> +type exp_mapper = expression -> expression result +type ty_exp_mapper = type_expression -> type_expression result +type abs_mapper = + | Expression of exp_mapper + | Type_expression of ty_exp_mapper +let rec map_expression : exp_mapper -> expression -> expression result = fun f e -> let self = map_expression f in let%bind e' = f e in let return expression_content = ok { e' with expression_content } in @@ -167,8 +171,54 @@ let rec map_expression : mapper -> expression -> expression result = fun f e -> ) | E_literal _ | E_variable _ | E_skip as e' -> return e' +and map_type_expression : ty_exp_mapper -> type_expression -> type_expression result = fun f te -> + let self = map_type_expression f in + let%bind te' = f te in + let return type_content = ok { te' with type_content } in + match te'.type_content with + | T_sum temap -> + let%bind temap' = bind_map_cmap self temap in + return @@ (T_sum temap') + | T_record temap -> + let%bind temap' = bind_map_lmap self temap in + return @@ (T_record temap') + | T_arrow {type1 ; type2} -> + let%bind type1' = self type1 in + let%bind type2' = self type2 in + return @@ (T_arrow {type1=type1' ; type2=type2'}) + | T_operator type_op -> + let%bind to' = map_type_operator f type_op in + return @@ (T_operator to') + | T_variable _ | T_constant _ -> ok te' -and map_cases : mapper -> matching_expr -> matching_expr result = fun f m -> +and map_type_operator : ty_exp_mapper -> type_operator -> type_operator result = fun f te -> + match te with + | TC_contract e -> + let%bind e' = map_type_expression f e in + ok @@ TC_contract e' + | TC_option e -> + let%bind e' = map_type_expression f e in + ok @@ TC_option e' + | TC_list e -> + let%bind e' = map_type_expression f e in + ok @@ TC_list e' + | TC_set e -> + let%bind e' = map_type_expression f e in + ok @@ TC_set e' + | TC_map (a , b) -> + let%bind a' = map_type_expression f a in + let%bind b' = map_type_expression f b in + ok @@ TC_map (a' , b') + | TC_big_map (a , b) -> + let%bind a' = map_type_expression f a in + let%bind b' = map_type_expression f b in + ok @@ TC_big_map (a' , b') + | TC_arrow (a , b) -> + let%bind a' = map_type_expression f a in + let%bind b' = map_type_expression f b in + ok @@ TC_arrow (a' , b') + +and map_cases : exp_mapper -> matching_expr -> matching_expr result = fun f m -> match m with | Match_bool { match_true ; match_false } -> ( let%bind match_true = map_expression f match_true in @@ -198,14 +248,19 @@ and map_cases : mapper -> matching_expr -> matching_expr result = fun f m -> ok @@ Match_variant (lst', ()) ) -and map_program : mapper -> program -> program result = fun m p -> +and map_program : abs_mapper -> program -> program result = fun m p -> let aux = fun (x : declaration) -> - match x with - | Declaration_constant (t , o , i, e) -> ( - let%bind e' = map_expression m e in + match x,m with + | (Declaration_constant (t , o , i, e), Expression m') -> ( + let%bind e' = map_expression m' e in ok (Declaration_constant (t , o , i, e')) ) - | Declaration_type _ -> ok x + | (Declaration_type (tv,te), Type_expression m') -> ( + let%bind te' = map_type_expression m' te in + ok (Declaration_type (tv, te')) + ) + | decl,_ -> ok decl + (* | Declaration_type of (type_variable * type_expression) *) in bind_map_list (bind_map_location aux) p diff --git a/src/passes/3-self_ast_simplified/self_ast_simplified.ml b/src/passes/3-self_ast_simplified/self_ast_simplified.ml index 8f8eee099..a10968c0c 100644 --- a/src/passes/3-self_ast_simplified/self_ast_simplified.ml +++ b/src/passes/3-self_ast_simplified/self_ast_simplified.ml @@ -1,17 +1,24 @@ open Trace -let all = [ +let all_expression_mapper = [ Tezos_type_annotation.peephole_expression ; None_variant.peephole_expression ; Literals.peephole_expression ; ] +let all_type_expression_mapper = [ + Entrypoints_lenght_limit.peephole_type_expression ; +] + +let all_exp = List.map (fun el -> Helpers.Expression el) all_expression_mapper +let all_ty = List.map (fun el -> Helpers.Type_expression el) all_type_expression_mapper let all_program = - let all_p = List.map Helpers.map_program all in - bind_chain all_p + let all_p = List.map Helpers.map_program all_exp in + let all_p2 = List.map Helpers.map_program all_ty in + bind_chain (List.append all_p all_p2) let all_expression = - let all_p = List.map Helpers.map_expression all in + let all_p = List.map Helpers.map_expression all_expression_mapper in bind_chain all_p let map_expression = Helpers.map_expression From 503d8f771e3a7141047bc2d97c1156b513f3a0a5 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Fri, 21 Feb 2020 17:08:10 +0100 Subject: [PATCH 39/40] add tests for sum type names limit length --- src/bin/expect_tests/contract_tests.ml | 13 +++++++++++++ .../negative/long_sum_type_names.ligo | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/test/contracts/negative/long_sum_type_names.ligo diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index 49b1563d7..cb7095651 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -1139,6 +1139,19 @@ let%expect_test _ = storage (pair (map %one key_hash nat) (big_map %two key_hash bool)) ; code { DUP ; CDR ; NIL operation ; PAIR ; DIP { DROP } } } |}] +let%expect_test _ = + run_ligo_bad [ "compile-contract" ; bad_contract "long_sum_type_names.ligo" ; "main" ] ; + [%expect {| + ligo: Too long constructor 'Incrementttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt': names length is limited to 32 (tezos limitation) + + If you're not sure how to fix this error, you can + do one of the following: + + * Visit our documentation: https://ligolang.org/docs/intro/what-and-why/ + * Ask a question on our Discord: https://discord.gg/9rhYaEt + * Open a gitlab issue: https://gitlab.com/ligolang/ligo/issues/new + * Check the changelog by running 'ligo changelog' |}] + let%expect_test _ = run_ligo_good [ "dry-run" ; contract "super-counter.mligo" ; "main" ; "test_param" ; "test_storage" ] ; [%expect {| diff --git a/src/test/contracts/negative/long_sum_type_names.ligo b/src/test/contracts/negative/long_sum_type_names.ligo new file mode 100644 index 000000000..71c9a4efe --- /dev/null +++ b/src/test/contracts/negative/long_sum_type_names.ligo @@ -0,0 +1,18 @@ +type action is +| Incrementttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt of int +// | Increment of int +| Decrement of int + +function add (const a : int ; const b : int) : int is a + b + +function subtract (const a : int ; const b : int) : int is a - b + +function main (const p : action ; const s : int) : (list(operation) * int) is + ((nil : list(operation)), + case p of + | Incrementttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt (n) -> add (s, n) + // | Increment(n) -> add (s, n) + | Decrement (n) -> subtract (s, n) + end) + +// incrementttttttttttttttttttttttt \ No newline at end of file From 66aca916bf2f50911c75f3f9279a2075f0b6c254 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Fri, 21 Feb 2020 17:18:51 +0100 Subject: [PATCH 40/40] mapping over type_operator types is useless --- src/bin/expect_tests/contract_tests.ml | 4 +-- src/passes/3-self_ast_simplified/helpers.ml | 31 +-------------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/src/bin/expect_tests/contract_tests.ml b/src/bin/expect_tests/contract_tests.ml index cb7095651..49d0d9ae1 100644 --- a/src/bin/expect_tests/contract_tests.ml +++ b/src/bin/expect_tests/contract_tests.ml @@ -1174,7 +1174,7 @@ let%expect_test _ = let%expect_test _ = run_ligo_bad [ "compile-contract" ; bad_contract "create_contract_toplevel.mligo" ; "main" ] ; [%expect {| -ligo: in file "create_contract_toplevel.mligo", line 4, character 35 to line 8, character 8. No free variable allowed in this lambda: variable 'store' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * string ):Some(( nat * string ))) : None return let rhs#808 = #P in let p = rhs#808.0 in let s = rhs#808.1 in ( list[] : (TO_list(operation)) , store ) , NONE() : (TO_option(key_hash)) , 300000000mutez , \"un\")","location":"in file \"create_contract_toplevel.mligo\", line 4, character 35 to line 8, character 8"} +ligo: in file "create_contract_toplevel.mligo", line 4, character 35 to line 8, character 8. No free variable allowed in this lambda: variable 'store' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * string ):Some(( nat * string ))) : None return let rhs#809 = #P in let p = rhs#809.0 in let s = rhs#809.1 in ( list[] : (TO_list(operation)) , store ) , NONE() : (TO_option(key_hash)) , 300000000mutez , \"un\")","location":"in file \"create_contract_toplevel.mligo\", line 4, character 35 to line 8, character 8"} If you're not sure how to fix this error, you can @@ -1187,7 +1187,7 @@ ligo: in file "create_contract_toplevel.mligo", line 4, character 35 to line 8, run_ligo_bad [ "compile-contract" ; bad_contract "create_contract_var.mligo" ; "main" ] ; [%expect {| -ligo: in file "create_contract_var.mligo", line 6, character 35 to line 10, character 5. No free variable allowed in this lambda: variable 'a' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * int ):Some(( nat * int ))) : None return let rhs#811 = #P in let p = rhs#811.0 in let s = rhs#811.1 in ( list[] : (TO_list(operation)) , a ) , NONE() : (TO_option(key_hash)) , 300000000mutez , 1)","location":"in file \"create_contract_var.mligo\", line 6, character 35 to line 10, character 5"} +ligo: in file "create_contract_var.mligo", line 6, character 35 to line 10, character 5. No free variable allowed in this lambda: variable 'a' {"expression":"CREATE_CONTRACT(lambda (#P : ( nat * int ):Some(( nat * int ))) : None return let rhs#812 = #P in let p = rhs#812.0 in let s = rhs#812.1 in ( list[] : (TO_list(operation)) , a ) , NONE() : (TO_option(key_hash)) , 300000000mutez , 1)","location":"in file \"create_contract_var.mligo\", line 6, character 35 to line 10, character 5"} If you're not sure how to fix this error, you can diff --git a/src/passes/3-self_ast_simplified/helpers.ml b/src/passes/3-self_ast_simplified/helpers.ml index f34f48514..76f884b6a 100644 --- a/src/passes/3-self_ast_simplified/helpers.ml +++ b/src/passes/3-self_ast_simplified/helpers.ml @@ -186,38 +186,9 @@ and map_type_expression : ty_exp_mapper -> type_expression -> type_expression re let%bind type1' = self type1 in let%bind type2' = self type2 in return @@ (T_arrow {type1=type1' ; type2=type2'}) - | T_operator type_op -> - let%bind to' = map_type_operator f type_op in - return @@ (T_operator to') + | T_operator _ | T_variable _ | T_constant _ -> ok te' -and map_type_operator : ty_exp_mapper -> type_operator -> type_operator result = fun f te -> - match te with - | TC_contract e -> - let%bind e' = map_type_expression f e in - ok @@ TC_contract e' - | TC_option e -> - let%bind e' = map_type_expression f e in - ok @@ TC_option e' - | TC_list e -> - let%bind e' = map_type_expression f e in - ok @@ TC_list e' - | TC_set e -> - let%bind e' = map_type_expression f e in - ok @@ TC_set e' - | TC_map (a , b) -> - let%bind a' = map_type_expression f a in - let%bind b' = map_type_expression f b in - ok @@ TC_map (a' , b') - | TC_big_map (a , b) -> - let%bind a' = map_type_expression f a in - let%bind b' = map_type_expression f b in - ok @@ TC_big_map (a' , b') - | TC_arrow (a , b) -> - let%bind a' = map_type_expression f a in - let%bind b' = map_type_expression f b in - ok @@ TC_arrow (a' , b') - and map_cases : exp_mapper -> matching_expr -> matching_expr result = fun f m -> match m with | Match_bool { match_true ; match_false } -> (