11
11
class TestDelegation (TestBase ):
12
12
@retry (tries = TEST_RETRIES , backoff = 1.3 , delay = 2 , jitter = (0 , 10 ))
13
13
def test_stake_delegation (self ):
14
+ stake_key_pair = StakeKeyPair .generate ()
15
+
14
16
address = Address (
15
17
self .payment_key_pair .verification_key .hash (),
16
- self . stake_key_pair .verification_key .hash (),
18
+ stake_key_pair .verification_key .hash (),
17
19
self .NETWORK ,
18
20
)
19
21
@@ -38,17 +40,17 @@ def test_stake_delegation(self):
38
40
time .sleep (3 )
39
41
40
42
stake_credential = StakeCredential (
41
- self . stake_key_pair .verification_key .hash ()
43
+ stake_key_pair .verification_key .hash ()
42
44
)
43
45
pool_hash = PoolKeyHash (bytes .fromhex (os .environ .get ("POOL_ID" ).strip ()))
44
46
45
47
drep = DRep (
46
48
DRepKind .VERIFICATION_KEY_HASH ,
47
- self . stake_key_pair .verification_key .hash (),
49
+ stake_key_pair .verification_key .hash (),
48
50
)
49
51
50
52
drep_credential = DRepCredential (
51
- self . stake_key_pair .verification_key .hash ()
53
+ stake_key_pair .verification_key .hash ()
52
54
)
53
55
54
56
anchor = Anchor (
@@ -72,7 +74,7 @@ def test_stake_delegation(self):
72
74
builder .certificates = [drep_registration , all_in_one_cert ]
73
75
74
76
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 ],
76
78
address ,
77
79
)
78
80
@@ -82,14 +84,14 @@ def test_stake_delegation(self):
82
84
print ("############### Submitting transaction ###############" )
83
85
self .chain_context .submit_tx (signed_tx )
84
86
85
- time .sleep (120 )
87
+ time .sleep (5 )
86
88
87
89
builder = TransactionBuilder (self .chain_context )
88
90
89
91
builder .add_input_address (address )
90
92
91
93
stake_address = Address (
92
- staking_part = self . stake_key_pair .verification_key .hash (),
94
+ staking_part = stake_key_pair .verification_key .hash (),
93
95
network = self .NETWORK ,
94
96
)
95
97
@@ -108,7 +110,7 @@ def test_stake_delegation(self):
108
110
builder .add_output (TransactionOutput (address , 1000000 ))
109
111
110
112
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 ],
112
114
address ,
113
115
)
114
116
0 commit comments