From 9d0da34f965155e209a1d970d4ec77b0afba0d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jev=20Bj=C3=B6rsell?= Date: Thu, 28 May 2020 11:40:05 -0700 Subject: [PATCH] Improve formatting of default webide values --- src/test/examples/cameligo/id.mligo | 36 ++++++++++++++----- src/test/examples/pascaligo/id.ligo | 25 ++++++++++---- src/test/examples/reasonligo/id.religo | 48 +++++++++++++++++--------- 3 files changed, 76 insertions(+), 33 deletions(-) diff --git a/src/test/examples/cameligo/id.mligo b/src/test/examples/cameligo/id.mligo index cdce7161f..9f9fabac9 100644 --- a/src/test/examples/cameligo/id.mligo +++ b/src/test/examples/cameligo/id.mligo @@ -14,7 +14,13 @@ ) storage: | { - identities=Big_map.literal[(1, {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); profile=0x0501000000026869});]; + identities=Big_map.literal[ + (1, + {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); + controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); + profile=0x0501000000026869} + ); + ]; next_id=2; name_price=0tez; skip_price=333mutez @@ -23,10 +29,17 @@ entrypoint: main storage: | { - identities=Big_map.literal[(1, {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); profile=0x0501000000026869});]; + identities=Big_map.literal[ + (1, + {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); + controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); + profile=0x0501000000026869} + ); + ]; next_id=2; name_price=10tez; - skip_price=333mutez} + skip_price=333mutez + } evaluateValue: entrypoint: "" evaluateFunction: @@ -38,9 +51,13 @@ }, { - identities=Big_map.literal[(1, {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); - controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); - profile=0x0501000000026869});]; + identities=Big_map.literal[ + (1, + {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); + controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); + profile=0x0501000000026869} + ); + ]; next_id=2; name_price=0tez; skip_price=333mutez @@ -88,13 +105,14 @@ type storage = { (** Preliminary thoughts on ids: -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 +I very much like the simplicity of http://gurno.com/adam/mne/ + +Five 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 +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 diff --git a/src/test/examples/pascaligo/id.ligo b/src/test/examples/pascaligo/id.ligo index 5178916bd..a0023e201 100644 --- a/src/test/examples/pascaligo/id.ligo +++ b/src/test/examples/pascaligo/id.ligo @@ -14,8 +14,12 @@ ) storage: | record [ - identities=big_map[1->record [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); - controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); profile=0x0501000000026869]]; + identities=big_map[ + 1->record + [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); + controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); + profile=0x0501000000026869] + ]; next_id=2; name_price=0tez; skip_price=50mutez; @@ -24,8 +28,12 @@ entrypoint: main storage: | record [ - identities=big_map[1->record [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); - controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); profile=0x0501000000026869]]; + identities=big_map[ + 1->record + [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); + controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); + profile=0x0501000000026869] + ]; next_id=2; name_price=0tez; skip_price=50mutez; @@ -41,9 +49,12 @@ initial_controller=Some(("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address)) ], - record [ identities=big_map[1->record [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); - controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); - profile=0x0501000000026869]]; + record [ identities=big_map[ + 1->record + [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); + controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); + profile=0x0501000000026869] + ]; next_id=2; name_price=0tez; skip_price=333mutez; diff --git a/src/test/examples/reasonligo/id.religo b/src/test/examples/reasonligo/id.religo index b399cba1b..9131a9080 100644 --- a/src/test/examples/reasonligo/id.religo +++ b/src/test/examples/reasonligo/id.religo @@ -7,26 +7,36 @@ entrypoint: main parameters: | Buy ( - { - profile: 0x0501000000026869, initial_controller: Some(("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address)) + { + profile: 0x0501000000026869, + initial_controller: Some(("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address)) } ) storage: | { - identities:Big_map.literal([(1, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), - controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869})]), - next_id:2, - name_price:0tez, + identities:Big_map.literal([ + (1, + {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), + controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869} + ) + ]), + next_id:2, + name_price:0tez, skip_price:333mutez } deploy: entrypoint: main storage: | { - identities:Big_map.literal([(1, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869})]), - next_id:2, - name_price:10tez, - skip_price:333mutez} + identities:Big_map.literal([ + (1, + {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869} + ) + ]), + next_id:2, + name_price:10tez, + skip_price:333mutez + } evaluateValue: entrypoint: "" evaluateFunction: @@ -34,15 +44,19 @@ parameters: | ( { - profile: 0x0501000000026869, + profile: 0x0501000000026869, initial_controller: Some(("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address)) }, { - identities:Big_map.literal([(1, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), - controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), - profile:0x0501000000026869})]), - next_id:2, - name_price:0tez, + identities:Big_map.literal([ + (1, + {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), + controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), + profile:0x0501000000026869} + ) + ]), + next_id:2, + name_price:0tez, skip_price:333mutez } ) @@ -163,7 +177,7 @@ let update_owner = ((parameter, storage): (update_owner, storage)) : (list(opera let update_details = ((parameter, storage): (update_details, storage)) : (list(operation), storage) => { - let void : unit = + let void : unit = if (amount != 0mutez) { failwith("Updating details doesn't cost anything."); }