@@ -61,6 +61,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
6161 err := Create0boxTestWallet (t , headers )
6262 require .NoError (t , err )
6363
64+ // Refresh CSRF token after wallet creation to ensure it's valid
65+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
66+
6467 allocationList , response , err := zboxClient .ListAllocation (t , headers )
6568 require .NoError (t , err )
6669 require .Equal (t , 200 , response .StatusCode (), "Response status code does not match expected. Output: [%v]" , response .String ())
@@ -74,6 +77,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
7477 err := Create0boxTestWallet (t , headers )
7578 require .NoError (t , err )
7679
80+ // Refresh CSRF token after wallet creation to ensure it's valid
81+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
82+
7783 allocInput := NewTestAllocation ()
7884 _ , response , err := zboxClient .CreateAllocation (t , headers , allocInput )
7985 require .NoError (t , err )
@@ -92,6 +98,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
9298 err := Create0boxTestWallet (t , headers )
9399 require .NoError (t , err )
94100
101+ // Refresh CSRF token after wallet creation to ensure it's valid
102+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
103+
95104 allocInput := NewTestAllocation ()
96105 allocInput ["id" ] = "c0360331837a7376d27007614e124db83811e4416dd2f1577345dd96c8621bf6"
97106 _ , response , err := zboxClient .CreateAllocation (t , headers , allocInput )
@@ -137,6 +146,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
137146 err := Create0boxTestWallet (t , headers )
138147 require .NoError (t , err )
139148
149+ // Refresh CSRF token after wallet creation to ensure it's valid
150+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_CHIMNEY )
151+
140152 allocInput := NewTestAllocation ()
141153 _ , response , err := zboxClient .CreateAllocation (t , headers , allocInput )
142154 require .NoError (t , err )
@@ -150,6 +162,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
150162 err := Create0boxTestWallet (t , headers )
151163 require .NoError (t , err )
152164
165+ // Refresh CSRF token after wallet creation to ensure it's valid
166+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
167+
153168 allocInput := NewTestAllocation ()
154169 _ , response , err := zboxClient .CreateAllocation (t , headers , allocInput )
155170 require .NoError (t , err )
@@ -167,6 +182,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
167182 err := Create0boxTestWallet (t , headers )
168183 require .NoError (t , err )
169184
185+ // Refresh CSRF token after wallet creation to ensure it's valid
186+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
187+
170188 allocInput := NewTestAllocation ()
171189 _ , response , err := zboxClient .CreateAllocation (t , headers , allocInput )
172190 require .NoError (t , err )
@@ -188,6 +206,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
188206 err := Create0boxTestWallet (t , headers )
189207 require .NoError (t , err )
190208
209+ // Refresh CSRF token after wallet creation to ensure it's valid
210+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
211+
191212 allocInput := NewTestAllocation ()
192213
193214 _ , response , err := zboxClient .GetAllocation (t , headers , allocInput ["id" ])
@@ -202,6 +223,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
202223 err := Create0boxTestWallet (t , headers )
203224 require .NoError (t , err )
204225
226+ // Refresh CSRF token after wallet creation to ensure it's valid
227+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
228+
205229 allocInput := NewTestAllocation ()
206230 _ , response , err := zboxClient .CreateAllocation (t , headers , allocInput )
207231 require .NoError (t , err )
@@ -229,6 +253,9 @@ func Test0BoxAllocation(testSetup *testing.T) {
229253 err := Create0boxTestWallet (t , headers )
230254 require .NoError (t , err )
231255
256+ // Refresh CSRF token after wallet creation to ensure it's valid
257+ headers = zboxClient .NewZboxHeadersWithCSRF (t , client .X_APP_BLIMP )
258+
232259 allocInput := NewTestAllocation ()
233260 allocInput ["name" ] = "new_alloc_name"
234261 allocInput ["description" ] = "new_alloc_description"
0 commit comments