Skip to content

Commit 07d39ef

Browse files
committed
Fixes repair test. Disables until implemented
1 parent 9c1a0b6 commit 07d39ef

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

Framework/Utils/EthAccount.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ public override string ToString()
3232
return EthAddress.ToString();
3333
}
3434

35-
public static bool operator ==(EthAccount a, EthAccount b)
35+
public static bool operator ==(EthAccount? a, EthAccount? b)
3636
{
37+
if (ReferenceEquals(a, b)) return true;
38+
if (ReferenceEquals(a, null)) return false;
39+
if (ReferenceEquals(b, null)) return false;
3740
return a.PrivateKey == b.PrivateKey;
3841
}
3942

40-
public static bool operator !=(EthAccount a, EthAccount b)
43+
public static bool operator !=(EthAccount? a, EthAccount? b)
4144
{
42-
return a.PrivateKey != b.PrivateKey;
45+
return !(a == b);
4346
}
4447
}
4548
}

Framework/Utils/EthAddress.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ public override string ToString()
3535
return Address;
3636
}
3737

38-
public static bool operator ==(EthAddress a, EthAddress b)
38+
public static bool operator ==(EthAddress? a, EthAddress? b)
3939
{
40+
if (ReferenceEquals(a, b)) return true;
41+
if (ReferenceEquals(a, null)) return false;
42+
if (ReferenceEquals(b, null)) return false;
4043
return a.Address == b.Address;
4144
}
4245

43-
public static bool operator !=(EthAddress a, EthAddress b)
46+
public static bool operator !=(EthAddress? a, EthAddress? b)
4447
{
45-
return a.Address != b.Address;
48+
return !(a == b);
4649
}
4750
}
4851
}

Tests/CodexReleaseTests/MarketTests/RepairTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public RepairTest()
3131
protected override int NumberOfHosts => 5;
3232
protected override int NumberOfClients => 1;
3333
protected override ByteSize HostAvailabilitySize => SlotSize.Multiply(1.1); // Each host can hold 1 slot.
34-
protected override TimeSpan HostAvailabilityMaxDuration => GetPeriodDuration() * 100;
34+
protected override TimeSpan HostAvailabilityMaxDuration => TimeSpan.FromDays(5.0);
3535

3636
private static bool IsPowerOfTwo(ByteSize size)
3737
{
@@ -41,6 +41,7 @@ private static bool IsPowerOfTwo(ByteSize size)
4141

4242
#endregion
4343

44+
[Ignore("Test is ready. Waiting for repair implementation.")]
4445
[Test]
4546
[Combinatorial]
4647
public void RollingRepairSingleFailure(
@@ -172,7 +173,7 @@ private IStoragePurchaseContract CreateStorageRequest(ICodexNode client)
172173
var config = GetContracts().Deployment.Config;
173174
return client.Marketplace.RequestStorage(new StoragePurchaseRequest(cid)
174175
{
175-
Duration = TimeSpan.FromDays(2.0),
176+
Duration = HostAvailabilityMaxDuration / 2,
176177
Expiry = TimeSpan.FromMinutes(10.0),
177178
MinRequiredNumberOfNodes = Slots,
178179
NodeFailureTolerance = Tolerance,

0 commit comments

Comments
 (0)