Add server-authoritative RZ Coin rewards
This commit is contained in:
@@ -8,10 +8,25 @@ public sealed class CreditEconomyTests
|
||||
[Fact]
|
||||
public void EarningPolicy_UsesTheAgreedRollingLimit()
|
||||
{
|
||||
Assert.Equal(20, CreditEconomy.RollingEarningLimit);
|
||||
Assert.Equal(30, CreditEconomy.RollingEarningLimit);
|
||||
Assert.Equal(TimeSpan.FromHours(24), CreditEconomy.EarningWindow);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1, 1)]
|
||||
[InlineData(3, 1)]
|
||||
[InlineData(4, 2)]
|
||||
[InlineData(5, 3)]
|
||||
public void FirstCorrectAwardsScaleWithStoredDifficulty(int difficulty, int expected) =>
|
||||
Assert.Equal(expected, CreditEconomy.FirstCorrectAmount(difficulty));
|
||||
|
||||
[Fact]
|
||||
public void DelayedRecoveryReplacesTheNormalReviewAward()
|
||||
{
|
||||
Assert.Equal(1, CreditEconomy.ReviewAmount(false));
|
||||
Assert.Equal(3, CreditEconomy.ReviewAmount(true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreditStatus_DoesNotExposeUserOrOperationIdentifiers()
|
||||
{
|
||||
@@ -21,6 +36,14 @@ public sealed class CreditEconomyTests
|
||||
Assert.Null(typeof(CreditStatusResponse).GetProperty(nameof(UserCreditAccount.AppliedOperations)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PublicLedgerEntry_DoesNotExposeUserOrOperationIdentifiers()
|
||||
{
|
||||
Assert.Null(typeof(CreditLedgerEntryResponse).GetProperty(nameof(CreditLedgerEntry.UserId)));
|
||||
Assert.Null(typeof(CreditLedgerEntryResponse).GetProperty(nameof(CreditLedgerEntry.OperationId)));
|
||||
Assert.Null(typeof(CreditLedgerEntryResponse).GetProperty(nameof(CreditLedgerEntry.SourceId)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CatalogHasStableCoinOnlyUtilityPrices()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user