templates.test_new_private
1import smartpy as sp 2 3 4@sp.module 5def M2(): 6 class C(sp.Contract): 7 def __init__(self, x, y): 8 self.data.s = 0 9 self.private.x = x 10 self.data.y = y 11 12 @sp.entrypoint 13 def myEntryPoint(self, params): 14 if self.private.x: 15 self.data.s += params 16 else: 17 assert False, "oops" 18 19 20@sp.add_test() 21def test(): 22 s = sp.test_scenario("Abbrevs", M2) 23 c = M2.C(x=True, y=0) 24 s += c