templates.test_local_record
1import smartpy as sp 2 3 4@sp.module 5def main(): 6 class C(sp.Contract): 7 @sp.entrypoint 8 def ep(self): 9 x = sp.record(a=sp.nat(1), b=sp.nat(2)) 10 x.a = 15 11 12 @sp.entrypoint 13 def ep2(self, params): 14 sp.cast(params, sp.pair[int, int]) 15 16 17@sp.add_test() 18def test(): 19 scenario = sp.test_scenario("LocalRecord", main) 20 scenario.h1("Local record") 21 scenario += main.C()