def count_deep(self): print("===deeper start==") account.contractCall("0x9a6bf01ba09a5853f898b2e9e6569157a01a7a00", "deepest", "[]") print("===deeper end==") pass # contractBeCalled = ContractBeCalled() # contractBeCalled.count_str("abc") # print("123")
def callExcption1(self): try: xx = account.contractCall( "0x2a4e0a5fb3d78a2c725a233b1bccff7560c35610", "be_calledException1", "[]") except Exception as e: print("====error is " + str(e)) if str(e).count("ddd") > 0: self.callExcption1 = "success"
def contract_bool(self): print("contract is called") try: self.mybool = account.contractCall( "0x2c34ce1df23b838c5abf2a7f6437cca3d3067ed509ff25f11df6b11b582b51eb", "count_bool", "[True]") print("count from another contract. count = " + str(self.mybool)) except Exception as e: print(e.args)
def contract_str(self): print("contract is called") try: count = account.contractCall( "0x2c34ce1df23b838c5abf2a7f6437cca3d3067ed509ff25f11df6b11b582b51eb", "count_str", "[]") self.mystr += count print("count from another contract. count = " + self.mystr) except Exception as e: print(e.args)
def contract_none(self): print("contract is called") try: mynone = account.contractCall( "0x2c34ce1df23b838c5abf2a7f6437cca3d3067ed509ff25f11df6b11b582b51eb", "count_none", "[]") print("count from another contract. count = " + str(mynone)) if mynone is None: self.mynone = 2 except Exception as e: print(e.args)
def contract_deep(self): print("===deep start==") try: count = account.contractCall( "0x2c34ce1df23b838c5abf2a7f6437cca3d3067ed509ff25f11df6b11b582b51eb", "count_deep", "[]") abc = count + 1 print("count from another contract. count 1 ") print("count from another contract. count = " + str(abc)) except Exception as e: print(e.args) print("===deep end==")
def call(self, function_name, *args, **kwargs): print("call: ", function_name) print("call: ", ujson.dumps(args)) account.contractCall(self.value, function_name, ujson.dumps(args))
def deepest(self): print("===deeptest start==") account.contractCall("0x2a4e0a5fb3d78a2c725a233b1bccff7560c35610", "count_deep", "[]") print("===deeptest end==") return 100
def client_print(self): print_str = account.contractCall( '0x303e2d65fc7cec255932f6cbbfac69851d47a56d06e3f33dc63c9620e07b1872', 'hello', '[]') print_str = print_str + " world" print(print_str)
def client_print_2(self): number = account.contractCall( '0x303e2d65fc7cec255932f6cbbfac69851d47a56d06e3f33dc63c9620e07b1872', 'plus', '[5, 5]') print(number)