1111 ROYALTY_POLICY_LAP_ADDRESS ,
1212 ZERO_ADDRESS ,
1313)
14- from tests .integration .config .test_config import account , account_2 , web3
14+ from tests .integration .config .test_config import account , account_2 , private_key , web3
1515from tests .integration .config .utils import MockERC20 , approve , get_story_client
1616from tests .integration .setup_for_integration import PIL_LICENSE_TEMPLATE
1717
@@ -25,22 +25,25 @@ def story_client() -> StoryClient:
2525@pytest .fixture (scope = "session" )
2626def story_client_2 () -> StoryClient :
2727 """Fixture to provide the secondary story client"""
28- return get_story_client (web3 , account_2 )
28+ if not private_key :
29+ raise ValueError ("Private key is not set" )
2930
30-
31- @pytest .fixture (scope = "module" )
32- def nft_collection (story_client : StoryClient ):
33- """Fixture to provide the SPG NFT collection"""
34- tx_data = story_client .NFTClient .create_nft_collection (
35- name = "test-collection" ,
36- symbol = "TEST" ,
37- max_supply = 100 ,
38- is_public_minting = True ,
39- mint_open = True ,
40- contract_uri = "test-uri" ,
41- mint_fee_recipient = account .address ,
42- )
43- return tx_data ["nft_contract" ]
31+ story_client_2 = get_story_client (web3 , account_2 )
32+ balance = story_client_2 .get_wallet_balance ()
33+ if balance < web3 .to_wei (5 , "ether" ):
34+ tx = {
35+ "from" : account .address ,
36+ "to" : account_2 .address ,
37+ "value" : web3 .to_wei (5 , "ether" ),
38+ "nonce" : web3 .eth .get_transaction_count (account .address ),
39+ "gas" : 21000 ,
40+ "gasPrice" : web3 .eth .gas_price ,
41+ "chainId" : web3 .eth .chain_id ,
42+ }
43+ signed_tx = account .sign_transaction (tx )
44+ tx_hash = web3 .eth .send_raw_transaction (signed_tx .raw_transaction )
45+ web3 .eth .wait_for_transaction_receipt (tx_hash )
46+ return story_client_2
4447
4548
4649@pytest .fixture (scope = "module" )
@@ -124,3 +127,17 @@ def mint_and_approve_license_token(
124127 )
125128
126129 return license_token_ids
130+
131+
132+ @pytest .fixture (scope = "module" )
133+ def nft_collection (story_client : StoryClient ):
134+ tx_data = story_client .NFTClient .create_nft_collection (
135+ name = "test-collection" ,
136+ symbol = "TEST" ,
137+ max_supply = 100 ,
138+ is_public_minting = True ,
139+ mint_open = True ,
140+ contract_uri = "test-uri" ,
141+ mint_fee_recipient = account .address ,
142+ )
143+ return tx_data ["nft_contract" ]
0 commit comments