Repository navigation
Expand file tree
/
Copy pathPORT.diff
More file actions
67 lines (66 loc) · 3.19 KB
/
Copy pathPORT.diff
File metadata and controls
67 lines (66 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# contracts/v06/PORT.diff, written by scripts/port.py. Do not edit it.
#
# The whole difference between the frozen pair in contracts/, which runs on
# studionet under py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6,
# and the ported pair in contracts/v06/, which runs on Studio Next under
# py-genlayer:5jycge4q8k23462jtb0b9fyey1s9qz928sz2nbrd9mg4sxqg2qng.
#
# Every changed line is the runtime header, an import, or differs only in one
# of five API names: gl.Contract, gl.get_contract_at, gl.vm.run_nondet_unsafe,
# gl.message_raw, and the stage an emitted message waits for, which consensus
# v0.6 calls "decided" where the first runtime said "accepted". The logic,
# the prompt and every string are unchanged.
--- contracts/escrow.py
+++ contracts/v06/escrow.py
@@ -1 +1,2 @@
-# { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" }
+# v0.3.0
+# { "Depends": "py-genlayer:5jycge4q8k23462jtb0b9fyey1s9qz928sz2nbrd9mg4sxqg2qng" }
@@ -21,0 +23,2 @@
+from genlayer.storage import DynArray, TreeMap, allow as allow_storage
+import genlayer as gl
@@ -70 +73 @@
- gl.message_raw['datetime'], an ISO 8601 string fixed for the transaction and
+ gl.message.raw['datetime'], an ISO 8601 string fixed for the transaction and
@@ -103 +106 @@
-# the chain layer rather than in GenVM. gl.get_contract_at(addr).emit_transfer()
+# the chain layer rather than in GenVM. gl.contract.get_at(addr).emit_transfer()
@@ -177 +180 @@
-class RecourseEscrow(gl.Contract):
+class RecourseEscrow(gl.contract.Contract):
@@ -213 +216 @@
- return u64(_seconds(gl.message_raw["datetime"]))
+ return u64(_seconds(gl.message.raw["datetime"]))
@@ -442 +445 @@
- gl.get_contract_at(self.dispute_contract).emit(on="accepted").adjudicate(
+ gl.contract.get_at(self.dispute_contract).emit(on="decided").adjudicate(
@@ -513 +516 @@
- gl.get_contract_at(self.dispute_contract).emit(on="finalized").check_promise(
+ gl.contract.get_at(self.dispute_contract).emit(on="finalized").check_promise(
--- contracts/dispute.py
+++ contracts/v06/dispute.py
@@ -1 +1,2 @@
-# { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" }
+# v0.3.0
+# { "Depends": "py-genlayer:5jycge4q8k23462jtb0b9fyey1s9qz928sz2nbrd9mg4sxqg2qng" }
@@ -21,0 +23,2 @@
+from genlayer.storage import DynArray, TreeMap, allow as allow_storage
+import genlayer as gl
@@ -324 +327 @@
-class RecourseDispute(gl.Contract):
+class RecourseDispute(gl.contract.Contract):
@@ -346 +349 @@
- text = gl.message_raw["datetime"].strip()
+ text = gl.message.raw["datetime"].strip()
@@ -395 +398 @@
- out = gl.vm.run_nondet_unsafe(leader_fn, validator_fn)
+ out = gl.vm.run_nondet(leader_fn, validator_fn)
@@ -413 +416 @@
- gl.get_contract_at(self.escrow).emit(on="finalized").settle(pid, verdict, reason)
+ gl.contract.get_at(self.escrow).emit(on="finalized").settle(pid, verdict, reason)
@@ -467 +470 @@
- out = gl.vm.run_nondet_unsafe(leader_fn, validator_fn)
+ out = gl.vm.run_nondet(leader_fn, validator_fn)
@@ -469 +472 @@
- gl.get_contract_at(self.escrow).emit(on="finalized").set_judgeable(
+ gl.contract.get_at(self.escrow).emit(on="finalized").set_judgeable(