@@ -97,7 +97,11 @@ public void MarketplaceExample(
97
97
98
98
purchaseContract . WaitForStorageContractStarted ( ) ;
99
99
100
- var availabilities = hosts . Select ( h => h . Marketplace . GetAvailabilities ( ) ) ;
100
+ var availabilities = hosts . Select ( h => h . Marketplace . GetAvailabilities ( ) ) . ToArray ( ) ;
101
+ if ( availabilities . All ( h => h . All ( a => a . FreeSpace . SizeInBytes == a . TotalSpace . SizeInBytes ) ) )
102
+ {
103
+ Assert . Fail ( "Host availabilities were not used." ) ;
104
+ }
101
105
102
106
var request = GetOnChainStorageRequest ( contracts , geth ) ;
103
107
AssertStorageRequest ( request , purchase , contracts , client ) ;
@@ -109,47 +113,6 @@ public void MarketplaceExample(
109
113
Assert . That ( contracts . GetRequestState ( request ) , Is . EqualTo ( RequestState . Finished ) ) ;
110
114
}
111
115
112
- [ Test ]
113
- [ Ignore ( "Integrated into MarketplaceExample to speed up testing." ) ]
114
- public void CanDownloadContentFromContractCid ( )
115
- {
116
- var fileSize = 10 . MB ( ) ;
117
- var geth = Ci . StartGethNode ( s => s . IsMiner ( ) . WithName ( "disttest-geth" ) ) ;
118
- var contracts = Ci . StartCodexContracts ( geth ) ;
119
- var testFile = CreateFile ( fileSize ) ;
120
-
121
- var client = StartCodex ( s => s
122
- . WithName ( "Client" )
123
- . EnableMarketplace ( geth , contracts , m => m
124
- . WithInitial ( 10 . Eth ( ) , 10 . Tst ( ) ) ) ) ;
125
-
126
- var uploadCid = client . UploadFile ( testFile ) ;
127
-
128
- var purchase = new StoragePurchaseRequest ( uploadCid )
129
- {
130
- PricePerSlotPerSecond = 2 . TstWei ( ) ,
131
- RequiredCollateral = 10 . TstWei ( ) ,
132
- MinRequiredNumberOfNodes = 5 ,
133
- NodeFailureTolerance = 2 ,
134
- ProofProbability = 5 ,
135
- Duration = TimeSpan . FromMinutes ( 5 ) ,
136
- Expiry = TimeSpan . FromMinutes ( 4 )
137
- } ;
138
-
139
- var purchaseContract = client . Marketplace . RequestStorage ( purchase ) ;
140
- var contractCid = purchaseContract . ContentId ;
141
- Assert . That ( uploadCid . Id , Is . Not . EqualTo ( contractCid . Id ) ) ;
142
-
143
- // Download both from client.
144
- testFile . AssertIsEqual ( client . DownloadContent ( uploadCid ) ) ;
145
- testFile . AssertIsEqual ( client . DownloadContent ( contractCid ) ) ;
146
-
147
- // Download both from another node.
148
- var downloader = StartCodex ( s => s . WithName ( "Downloader" ) ) ;
149
- testFile . AssertIsEqual ( downloader . DownloadContent ( uploadCid ) ) ;
150
- testFile . AssertIsEqual ( downloader . DownloadContent ( contractCid ) ) ;
151
- }
152
-
153
116
private TrackedFile CreateFile ( ByteSize fileSize )
154
117
{
155
118
var segmentSize = new ByteSize ( fileSize . SizeInBytes / 4 ) ;
0 commit comments