1111class TestDelegation (TestBase ):
1212 @retry (tries = TEST_RETRIES , backoff = 1.3 , delay = 2 , jitter = (0 , 10 ))
1313 def test_stake_delegation (self ):
14+ stake_key_pair = StakeKeyPair .generate ()
15+
1416 address = Address (
1517 self .payment_key_pair .verification_key .hash (),
16- self . stake_key_pair .verification_key .hash (),
18+ stake_key_pair .verification_key .hash (),
1719 self .NETWORK ,
1820 )
1921
@@ -38,17 +40,17 @@ def test_stake_delegation(self):
3840 time .sleep (3 )
3941
4042 stake_credential = StakeCredential (
41- self . stake_key_pair .verification_key .hash ()
43+ stake_key_pair .verification_key .hash ()
4244 )
4345 pool_hash = PoolKeyHash (bytes .fromhex (os .environ .get ("POOL_ID" ).strip ()))
4446
4547 drep = DRep (
4648 DRepKind .VERIFICATION_KEY_HASH ,
47- self . stake_key_pair .verification_key .hash (),
49+ stake_key_pair .verification_key .hash (),
4850 )
4951
5052 drep_credential = DRepCredential (
51- self . stake_key_pair .verification_key .hash ()
53+ stake_key_pair .verification_key .hash ()
5254 )
5355
5456 anchor = Anchor (
@@ -72,7 +74,7 @@ def test_stake_delegation(self):
7274 builder .certificates = [drep_registration , all_in_one_cert ]
7375
7476 signed_tx = builder .build_and_sign (
75- [self . stake_key_pair .signing_key , self .payment_key_pair .signing_key ],
77+ [stake_key_pair .signing_key , self .payment_key_pair .signing_key ],
7678 address ,
7779 )
7880
@@ -82,14 +84,14 @@ def test_stake_delegation(self):
8284 print ("############### Submitting transaction ###############" )
8385 self .chain_context .submit_tx (signed_tx )
8486
85- time .sleep (120 )
87+ time .sleep (5 )
8688
8789 builder = TransactionBuilder (self .chain_context )
8890
8991 builder .add_input_address (address )
9092
9193 stake_address = Address (
92- staking_part = self . stake_key_pair .verification_key .hash (),
94+ staking_part = stake_key_pair .verification_key .hash (),
9395 network = self .NETWORK ,
9496 )
9597
@@ -108,7 +110,7 @@ def test_stake_delegation(self):
108110 builder .add_output (TransactionOutput (address , 1000000 ))
109111
110112 signed_tx = builder .build_and_sign (
111- [self . stake_key_pair .signing_key , self .payment_key_pair .signing_key ],
113+ [stake_key_pair .signing_key , self .payment_key_pair .signing_key ],
112114 address ,
113115 )
114116
0 commit comments