Improve formatting of default webide values

This commit is contained in:
Jev Björsell 2020-05-28 11:40:05 -07:00 committed by Pierre-Emmanuel Wulfman
parent a5419d0158
commit 9d0da34f96
3 changed files with 76 additions and 33 deletions

View File

@ -14,7 +14,13 @@
) )
storage: | 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; next_id=2;
name_price=0tez; name_price=0tez;
skip_price=333mutez skip_price=333mutez
@ -23,10 +29,17 @@
entrypoint: main entrypoint: main
storage: | 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; next_id=2;
name_price=10tez; name_price=10tez;
skip_price=333mutez} skip_price=333mutez
}
evaluateValue: evaluateValue:
entrypoint: "" entrypoint: ""
evaluateFunction: evaluateFunction:
@ -38,9 +51,13 @@
}, },
{ {
identities=Big_map.literal[(1, {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); identities=Big_map.literal[
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); (1,
profile=0x0501000000026869});]; {owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address);
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address);
profile=0x0501000000026869}
);
];
next_id=2; next_id=2;
name_price=0tez; name_price=0tez;
skip_price=333mutez skip_price=333mutez
@ -88,13 +105,14 @@ type storage = {
(** Preliminary thoughts on ids: (** Preliminary thoughts on ids:
I very much like the simplicity of http://gurno.com/adam/mne/. 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
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 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 can be stored as a single integer which is then translated into the corresponding
series of 5 words. 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 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. 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 Should probably do some napkin calculations for how expensive skipping needs to

View File

@ -14,8 +14,12 @@
) )
storage: | storage: |
record [ record [
identities=big_map[1->record [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); identities=big_map[
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); profile=0x0501000000026869]]; 1->record
[owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address);
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address);
profile=0x0501000000026869]
];
next_id=2; next_id=2;
name_price=0tez; name_price=0tez;
skip_price=50mutez; skip_price=50mutez;
@ -24,8 +28,12 @@
entrypoint: main entrypoint: main
storage: | storage: |
record [ record [
identities=big_map[1->record [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); identities=big_map[
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); profile=0x0501000000026869]]; 1->record
[owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address);
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address);
profile=0x0501000000026869]
];
next_id=2; next_id=2;
name_price=0tez; name_price=0tez;
skip_price=50mutez; skip_price=50mutez;
@ -41,9 +49,12 @@
initial_controller=Some(("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address)) initial_controller=Some(("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address))
], ],
record [ identities=big_map[1->record [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address); record [ identities=big_map[
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address); 1->record
profile=0x0501000000026869]]; [owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address);
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address);
profile=0x0501000000026869]
];
next_id=2; next_id=2;
name_price=0tez; name_price=0tez;
skip_price=333mutez; skip_price=333mutez;

View File

@ -7,26 +7,36 @@
entrypoint: main entrypoint: main
parameters: | parameters: |
Buy ( Buy (
{ {
profile: 0x0501000000026869, initial_controller: Some(("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address)) profile: 0x0501000000026869,
initial_controller: Some(("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address))
} }
) )
storage: | storage: |
{ {
identities:Big_map.literal([(1, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), identities:Big_map.literal([
controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869})]), (1,
next_id:2, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address),
name_price:0tez, controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869}
)
]),
next_id:2,
name_price:0tez,
skip_price:333mutez skip_price:333mutez
} }
deploy: deploy:
entrypoint: main entrypoint: main
storage: | storage: |
{ {
identities:Big_map.literal([(1, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869})]), identities:Big_map.literal([
next_id:2, (1,
name_price:10tez, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869}
skip_price:333mutez} )
]),
next_id:2,
name_price:10tez,
skip_price:333mutez
}
evaluateValue: evaluateValue:
entrypoint: "" entrypoint: ""
evaluateFunction: evaluateFunction:
@ -34,15 +44,19 @@
parameters: | parameters: |
( (
{ {
profile: 0x0501000000026869, profile: 0x0501000000026869,
initial_controller: Some(("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address)) initial_controller: Some(("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address))
}, },
{ {
identities:Big_map.literal([(1, {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), identities:Big_map.literal([
controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), (1,
profile:0x0501000000026869})]), {owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address),
next_id:2, controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address),
name_price:0tez, profile:0x0501000000026869}
)
]),
next_id:2,
name_price:0tez,
skip_price:333mutez 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)) : let update_details = ((parameter, storage): (update_details, storage)) :
(list(operation), storage) => { (list(operation), storage) => {
let void : unit = let void : unit =
if (amount != 0mutez) { if (amount != 0mutez) {
failwith("Updating details doesn't cost anything."); failwith("Updating details doesn't cost anything.");
} }