def doubler(request):
    """Return configured instance of Doubler smart contract"""
    contract_path = compile('doubler', DoublerContract, __file__,
                            request.config.cache)
    instance = ContractInterface.create_from(contract_path)
    instance.maxDiff = None
    return instance
Example #2
0
 def compile_contract(self):
     """
     Force compilation of LIGO contract from source file and loads it into
     pytezos.
     :return: pytezos.ContractInterface
     """
     command = f"{ligo_cmd} compile-contract {self.ligo_file} {self.main_func}"
     michelson = self._ligo_to_michelson(command)
     self.tz_file.write_text(michelson)
     self.contract_interface = ContractInterface.create_from(michelson)
     return self.contract_interface
Example #3
0
 def test_bmd_path(self):
     ci = ContractInterface.create_from(code)
     ci.contract.storage.big_map_init(michelson_to_micheline(storage))
     query = ci.contract.storage.big_map_query(
         'big_map_0/tz1bHzftcTKZMTZgLLtnrXydCm6UEqf4ivca')
     self.assertEqual(
         {
             'big_map_id':
             17,
             'script_expr':
             'expruGu4fvT7wyJYm2Rdz7jssqBZyoSmi3kub6Us3guARnzR9HBQCe'
         }, query)
Example #4
0
 def setUpClass(cls):
     project_dir = dirname(dirname(__file__))
     cls.nftContract = ContractInterface.create_from(
         path_to_michelson_contract)
     cls.nftContract.address = contract_address
Example #5
0
 def setUpClass(cls):
     cls.nftContract = ContractInterface.create_from(join(dirname(dirname(__file__)), 'test/helpers.tz'))
     cls.nftContract.address = contract_address
 def setUpClass(cls):
     cls.atomex = ContractInterface.create_from(
         join(project_dir, 'src/atomex.tz'))
     cls.maxDiff = None
Example #7
0
 def test_now_babylonnet(self):
     contract = ContractInterface.create_from(code)
     now = format_timestamp(pytezos.now())
     res = contract.call().result(storage=0)
     self.assertEqual(now, res.storage)
Example #8
0
 def setUpClass(cls):
     project_dir = dirname(dirname(__file__))
     print("projectdir", project_dir)
     cls.nftContract = ContractInterface.create_from(
         join(project_dir, 'src/land.tz'))
 def setUpClass(cls):
     cls.contract = ContractInterface.create_from(code)
Example #10
0
 def setUpClass(cls):
     cls.nft = ContractInterface.create_from(join(dirname(__file__),
                                                  '../build/nft.tz'),
                                             shell='sandboxnet')
     cls.maxDiff = None
Example #11
0
 def setUpClass(cls):
     project_dir = dirname(dirname(__file__))
     print("projectdir", project_dir)
     cls.nftContract = ContractInterface.create_from(
         join(project_dir, 'src/land.tz'))
     cls.nftContract.address = "KT1BEqzn5Wx8uJrZNvuS9DVHmLvG9td3fDLi"
Example #12
0
 def setUpClass(cls):
     project_dir = dirname(dirname(__file__))
     cls.votingContract = ContractInterface.create_from(
         join(project_dir, 'votingContract.tz'))
Example #13
0
 def setUpClass(cls):
     cls.nft = ContractInterface.create_from(join(project_dir, 'src/nft.tz'), factory=NonFungibleTokenImpl)
Example #14
0
 def setUpClass(cls):
     cls.nftContract = ContractInterface.create_from(path_to_michelson_contract)
     cls.nftContract.address = contract_address
Example #15
0
 def setUpClass(cls):
     cls.atomex = ContractInterface.create_from(
         join(project_dir, 'src/atomex.tz'))
     cls.fa12 = pytezos.contract(fa_address)
     cls.maxDiff = None
Example #16
0
 def setUpClass(cls):
     cls.token = ContractInterface.create_from(
         join(dirname(__file__), "./../../build/token.tz"))
     cls.maxDiff = None
Example #17
0
 def test_now_zeronet(self):
     contract = ContractInterface.create_from(code, shell='zeronet')
     now = format_timestamp(pytezos.using('zeronet').now())
     res = contract.call().result(storage=0)
     self.assertEqual(now, res.storage)
Example #18
0
 def setUpClass(cls):
     cls.atomex = ContractInterface.create_from(
         join(dirname(__file__), 'atomex.tz'))
     cls.maxDiff = None
Example #19
0
 def setUpClass(cls):
     cls.fa12 = ContractInterface.create_from(
         join(project_dir, 'samples/fa1.2.tz'))
     cls.viewer = pytezos.contract(viewer_address)
     cls.maxDiff = None
 def test_transfer_tokens(self):
     ci = ContractInterface.create_from(code)
     res = ci.call(0, 'KT1SmF5SCC5DrzkSm28HP9ovWVqcA5cmqZ1q').interpret(
         storage={"haha": "nice"})
     self.assertEqual(1, len(res.operations))
Example #21
0
 def setUpClass(cls):
     cls.concat = ContractInterface.create_from(
         join(dirname(__file__), 'concat.tz'))
     cls.maxDiff = None
Example #22
0
 def setUpClass(cls):
     cls.nft = ContractInterface.create_from(join(dirname(__file__),
                                                  'nft.tz'),
                                             factory=NonFungibleTokenImpl)
Example #23
0
def participator():
    """Return configured instance of Participator smart contract"""
    contract_path = 'src/contracts/participator/participator.tz'
    instance = ContractInterface.create_from(contract_path)
    instance.maxDiff = None
    return instance
 def setUpClass(cls):
     contract_path = join(dirname(dirname(__file__)),
                          "src/contracts/counter_with_previous_counter.tz")
     cls.contract = ContractInterface.create_from(contract_path)
 def setUpClass(cls):
     contract_path = join(dirname(dirname(__file__)),
                          "src/contracts/counter_with_check.tz")
     print("path", contract_path)
     cls.contract = ContractInterface.create_from(contract_path)
Example #26
0
 def setUpClass(cls):
     project_dir = dirname(dirname(__file__))
     print("projectdir", project_dir)
     cls.voteContract = ContractInterface.create_from(
         join(project_dir, 'bin/vote.tz'))
Example #27
0
 def setUpClass(cls):
     cls.token_v3 = ContractInterface.create_from(
         join(dirname(__file__), 'contract.tz'))