From 6e604c22c3529e509bd1144aaa9517f50b5b296b Mon Sep 17 00:00:00 2001 From: Andinus Date: Sun, 26 Sep 2021 17:22:51 +0530 Subject: Finalize contract --- contract/memoir.py | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'contract') diff --git a/contract/memoir.py b/contract/memoir.py index cce8c72..725b965 100644 --- a/contract/memoir.py +++ b/contract/memoir.py @@ -11,24 +11,6 @@ class Memoir(sp.Contract): def add_record(self, params): self.data.dates.push(sp.now) self.data.records.push(params.record) - # self.data.records[params.id] = params.record - # Verify that the ID doesn't exist. - # sp.verify( - # self.data.records.contains(params.id) == False, - # message = "Record exists" - # ) - - # @sp.entry_point - # def update_record(self, params): - # self.data.records = sp.update_map( - # self.data.records, - # params.id, - # sp.some(params.record) - # ) - - @sp.entry_point - def delete_record(self, params): - del self.data.records[params.id] @sp.add_test(name="MyMedMemoir") def test(): @@ -39,20 +21,5 @@ def test(): scenario += c1 # Try adding records. - # scenario += c1.add_record(id = 0, record = '{record #0}') - # scenario += c1.add_record(id = 1, record = '{record #1}') - # scenario += c1.add_record(id = 2, record = '{record #2}') scenario += c1.add_record(record = '{record #1}') - scenario += c1.add_record(record = '{record #2}') - - # Updating records. - # scenario += c1.update_record(id = 1, record = '{record #1 - updated}') - - # Deleting records. - # scenario += c1.delete_record(id = 2) - scenario += c1.delete_record(id = 2) - - # Trying to add over existing record. Should Fail. - # scenario += c1.add_record( - # id = 2, record = '{record #2 - fail}' - # ).run(valid = False) + scenario += c1.add_record(record = '{record #2}') \ No newline at end of file -- cgit 1.4.1-2-gfad0