summary refs log tree commit diff stats
path: root/contract
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-25 15:57:09 +0530
committerAndinus <andinus@nand.sh>2021-09-25 15:57:09 +0530
commitb894c3893cda3746b877ca34cfe3d1f1a4b75684 (patch)
treedc397d3264257f504e3667200c6d8889c712e135 /contract
parent0cd98c2640bb9d4359c2c4b168f77df75fe59462 (diff)
downloadMyMedMemoir-b894c3893cda3746b877ca34cfe3d1f1a4b75684.tar.gz
Add Memoir contract
Diffstat (limited to 'contract')
-rw-r--r--contract/memoir.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/contract/memoir.py b/contract/memoir.py
new file mode 100644
index 0000000..792274b
--- /dev/null
+++ b/contract/memoir.py
@@ -0,0 +1,23 @@
+import smartpy as sp
+
+class Memoir(sp.Contract):
+    def __init__(self):
+        self.init(
+            dates = sp.list([]),
+            records = sp.list([])
+        )
+
+    @sp.entry_point
+    def add_record(self, params):
+        self.data.dates.push(sp.now)
+        self.data.records.push(params.record)
+
+@sp.add_test(name="MyMedMemoir")
+def test():
+    scenario = sp.test_scenario()
+    scenario.h1("MyMedMemoir")
+
+    c1 = Memoir()
+    scenario += c1
+    scenario += c1.add_record(record = '{record #1}')
+    scenario += c1.add_record(record = '{record #2}')