def load_smart_contract(self, args):
if not self.Wallet:
print("please open wallet")
return
function_code = LoadContract(args[1:])
if function_code:
contract_script = GatherContractDetails(function_code, self)
if contract_script is not None:
tx, fee, results, num_ops = test_invoke(contract_script, self.Wallet, [])
if tx is not None and results is not None:
print("\n-------------------------------------------------------------------------------------------------------------------------------------")
print("Test deploy invoke successful")
print("Total operations executed: %s " % num_ops)
print("Results %s " % [str(item) for item in results])
print("Deploy Invoke TX gas cost: %s " % (tx.Gas.value / Fixed8.D))
print("Deploy Invoke TX Fee: %s " % (fee.value / Fixed8.D))
print("-------------------------------------------------------------------------------------------------------------------------------------\n")
print("Enter your password to continue and deploy this contract")
passwd = prompt("[password]> ", is_password=True)
if not self.Wallet.ValidatePassword(passwd):
return print("Incorrect password")
result = InvokeContract(self.Wallet, tx, Fixed8.Zero())
return
else:
print("test ivoke failed")
print("tx is, results are %s %s " % (tx, results))
return
评论列表
文章目录