Skip to content

Commit

Permalink
Merge pull request #2198 from planetarium/release/1.3.1
Browse files Browse the repository at this point in the history
Release/1.3.1
  • Loading branch information
sonohoshi authored Nov 3, 2023
2 parents 538afea + 49f6726 commit 2cd67a8
Show file tree
Hide file tree
Showing 88 changed files with 6,848 additions and 476 deletions.
36 changes: 18 additions & 18 deletions .Lib9c.Tests/Action/BattleArena13Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void Execute_Backward_Compatibility_Success()
[Fact]
public void Execute_InvalidAddressException()
{
var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar1Address,
Expand All @@ -218,7 +218,7 @@ public void Execute_InvalidAddressException()
[Fact]
public void Execute_FailedLoadStateException()
{
var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar2Address,
enemyAvatarAddress = _avatar1Address,
Expand All @@ -241,7 +241,7 @@ public void Execute_FailedLoadStateException()
[Fact]
public void Execute_NotEnoughClearedStageLevelException()
{
var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar4Address,
enemyAvatarAddress = _avatar2Address,
Expand All @@ -266,7 +266,7 @@ public void Execute_NotEnoughClearedStageLevelException()
[Fact]
public void Execute_SheetRowNotFoundException()
{
var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand All @@ -289,7 +289,7 @@ public void Execute_SheetRowNotFoundException()
[Fact]
public void Execute_ThisArenaIsClosedException()
{
var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand All @@ -313,7 +313,7 @@ public void Execute_ThisArenaIsClosedException()
[Fact]
public void Execute_ArenaParticipantsNotFoundException()
{
var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -374,7 +374,7 @@ public void Execute_AddressNotFoundInArenaParticipantsException(bool excludeMe)
round,
random);

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -444,7 +444,7 @@ public void Execute_ValidateScoreDifferenceException(bool isSigner)
arenaScore.AddScore(900);
previousStates = previousStates.SetState(arenaScoreAdr, arenaScore.Serialize());

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -513,7 +513,7 @@ public void Execute_InsufficientBalanceException()
beforeInfo.UseTicket(beforeInfo.Ticket);
previousStates = previousStates.SetState(arenaInfoAdr, beforeInfo.Serialize());

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -579,7 +579,7 @@ public void Execute_ExceedPlayCountException()
throw new ArenaInformationNotFoundException($"arenaInfoAdr : {arenaInfoAdr}");
}

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -659,7 +659,7 @@ public void Execute_ExceedTicketPurchaseLimitException()
previousStates.GetGoldCurrency());
previousStates = previousStates.MintAsset(context, _agent1Address, price);

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -732,7 +732,7 @@ public void Execute_ExceedTicketPurchaseLimitDuringIntervalException()
beforeInfo.BuyTicket(roundData.MaxPurchaseCount);
}

var purchasedCountDuringInterval = arenaInfoAdr.Derive(BattleArena.PurchasedCountKey);
var purchasedCountDuringInterval = arenaInfoAdr.Derive(BattleArena13.PurchasedCountKey);
previousStates = previousStates
.SetState(arenaInfoAdr, beforeInfo.Serialize())
.SetState(
Expand All @@ -744,7 +744,7 @@ public void Execute_ExceedTicketPurchaseLimitDuringIntervalException()
previousStates.GetGoldCurrency());
previousStates = previousStates.MintAsset(context, _agent1Address, price);

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -823,7 +823,7 @@ public void Execute_CoolDownBlockException()
beforeInfo.BuyTicket(roundData.MaxPurchaseCount);
}

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -922,7 +922,7 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2
Random = new TestRandom(),
});

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -1029,7 +1029,7 @@ public void Execute_ValidateDuplicateTicketPurchaseException()

beforeInfo.UseTicket(ArenaInformation.MaxTicketCount);

var purchasedCountDuringInterval = arenaInfoAdr.Derive(BattleArena.PurchasedCountKey);
var purchasedCountDuringInterval = arenaInfoAdr.Derive(BattleArena13.PurchasedCountKey);
previousStates = previousStates
.SetState(arenaInfoAdr, beforeInfo.Serialize())
.SetState(
Expand All @@ -1041,7 +1041,7 @@ public void Execute_ValidateDuplicateTicketPurchaseException()
previousStates.GetGoldCurrency());
previousStates = previousStates.MintAsset(context, _agent1Address, price);

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = _avatar1Address,
enemyAvatarAddress = _avatar2Address,
Expand Down Expand Up @@ -1157,7 +1157,7 @@ private void Execute(
}
}

var action = new BattleArena
var action = new BattleArena13
{
myAvatarAddress = myAvatarAddress,
enemyAvatarAddress = enemyAvatarAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Lib9c.Tests.Action
using Xunit;
using Xunit.Abstractions;

public class BuyProductTest
public class BuyProduct2Test
{
private static readonly Address BuyerAgentAddress = new Address("47d082a115c63e7b58b1532d20e631538eafadde");
private static readonly Address BuyerAvatarAddress = new Address("340f110b91d0577a9ae0ea69ce15269436f217da");
Expand All @@ -37,7 +37,7 @@ public class BuyProductTest
private readonly Guid _orderId;
private IAccount _initialState;

public BuyProductTest(ITestOutputHelper outputHelper)
public BuyProduct2Test(ITestOutputHelper outputHelper)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
Expand Down Expand Up @@ -296,7 +296,7 @@ public void Execute_Throw_Exception(params ExecuteMember[] validateMembers)

foreach (var productInfo in validateMember.ProductInfos)
{
var action = new BuyProduct
var action = new BuyProduct2
{
AvatarAddress = BuyerAvatarAddress,
ProductInfos = new[] { productInfo },
Expand All @@ -315,12 +315,12 @@ public void Execute_Throw_Exception(params ExecuteMember[] validateMembers)
public void Execute_Throw_ArgumentOutOfRangeException()
{
var productInfos = new List<ItemProductInfo>();
for (int i = 0; i < BuyProduct.Capacity + 1; i++)
for (int i = 0; i < BuyProduct2.Capacity + 1; i++)
{
productInfos.Add(new ItemProductInfo());
}

var action = new BuyProduct
var action = new BuyProduct2
{
AvatarAddress = _sellerAvatarAddress2,
ProductInfos = productInfos,
Expand Down
4 changes: 2 additions & 2 deletions .Lib9c.Tests/Action/BuyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public void Execute(params OrderData[] orderDataList)
Signer = _buyerAgentAddress,
});

var buyProductAction = new BuyProduct
var buyProductAction = new BuyProduct2
{
AvatarAddress = _buyerAvatarAddress,
ProductInfos = productInfos,
Expand Down Expand Up @@ -630,7 +630,7 @@ public void Execute_ErrorCode(ErrorCodeMember errorCodeMember)
action.errors.Select(r => r.errorCode)
);

var buyProductAction = new BuyProduct
var buyProductAction = new BuyProduct2
{
AvatarAddress = _buyerAvatarAddress,
ProductInfos = new[] { productInfo },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Lib9c.Tests.Action
using Xunit;
using Xunit.Abstractions;

public class CancelProductRegistrationTest
public class CancelProductRegistration0Test
{
private readonly IAccount _initialState;
private readonly Address _agentAddress;
Expand All @@ -26,7 +26,7 @@ public class CancelProductRegistrationTest
private readonly TableSheets _tableSheets;
private readonly GameConfigState _gameConfigState;

public CancelProductRegistrationTest(ITestOutputHelper outputHelper)
public CancelProductRegistration0Test(ITestOutputHelper outputHelper)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
Expand Down Expand Up @@ -84,7 +84,7 @@ public void Execute_Throw_InvalidAddressException(
bool invalidAgentAddress
)
{
var action = new CancelProductRegistration
var action = new CancelProductRegistration0
{
AvatarAddress = _avatarAddress,
ProductInfos = new List<IProductInfo>
Expand Down Expand Up @@ -129,7 +129,7 @@ public void Execute_Throw_ProductNotFoundException()
{
var context = new ActionContext();
var prevState = _initialState.MintAsset(context, _avatarAddress, 1 * RuneHelper.StakeRune);
var registerProduct = new RegisterProduct
var registerProduct = new RegisterProduct2
{
AvatarAddress = _avatarAddress,
RegisterInfos = new List<IRegisterInfo>
Expand Down Expand Up @@ -159,7 +159,7 @@ public void Execute_Throw_ProductNotFoundException()
(List)nexState.GetState(ProductsState.DeriveAddress(_avatarAddress)));
var productId = Assert.Single(productsState.ProductIds);

var action = new CancelProductRegistration
var action = new CancelProductRegistration0
{
AvatarAddress = _avatarAddress,
ProductInfos = new List<IProductInfo>
Expand Down Expand Up @@ -196,12 +196,12 @@ public void Execute_Throw_ProductNotFoundException()
public void Execute_Throw_ArgumentOutOfRangeException()
{
var productInfos = new List<IProductInfo>();
for (int i = 0; i < CancelProductRegistration.Capacity + 1; i++)
for (int i = 0; i < CancelProductRegistration0.Capacity + 1; i++)
{
productInfos.Add(new ItemProductInfo());
}

var action = new CancelProductRegistration
var action = new CancelProductRegistration0
{
AvatarAddress = _avatarAddress,
ProductInfos = productInfos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ namespace Lib9c.Tests.Action
using Xunit;
using static Lib9c.SerializeKeys;

public class CombinationConsumableTest
public class CombinationConsumable8Test
{
private readonly Address _agentAddress;
private readonly Address _avatarAddress;
private readonly IRandom _random;
private readonly TableSheets _tableSheets;
private IAccount _initialState;

public CombinationConsumableTest()
public CombinationConsumable8Test()
{
_agentAddress = new PrivateKey().ToAddress();
_avatarAddress = _agentAddress.Derive("avatar");
Expand Down Expand Up @@ -113,7 +113,7 @@ public void Execute(bool backward)
.SetState(_avatarAddress, avatarState.SerializeV2());
}

var action = new CombinationConsumable
var action = new CombinationConsumable8
{
avatarAddress = _avatarAddress,
recipeId = row.Id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Lib9c.Tests.Action
using Xunit.Abstractions;
using static Lib9c.SerializeKeys;

public class CombinationEquipmentTest
public class CombinationEquipment16Test
{
private readonly Address _agentAddress;
private readonly Address _avatarAddress;
Expand All @@ -34,7 +34,7 @@ public class CombinationEquipmentTest
private readonly AgentState _agentState;
private readonly AvatarState _avatarState;

public CombinationEquipmentTest(ITestOutputHelper outputHelper)
public CombinationEquipment16Test(ITestOutputHelper outputHelper)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
Expand Down Expand Up @@ -75,7 +75,7 @@ public CombinationEquipmentTest(ITestOutputHelper outputHelper)

var combinationSlotState = new CombinationSlotState(
_slotAddress,
GameConfig.RequireClearedStageLevel.CombinationEquipmentAction);
0);

_initialState = new MockStateDelta()
.SetState(_slotAddress, combinationSlotState.Serialize())
Expand Down Expand Up @@ -280,7 +280,7 @@ bool previousCostStateExist
Assert.Null(state.GetState(dailyCostAddress));
Assert.Null(state.GetState(weeklyCostAddress));

var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddress,
slotIndex = slotIndex,
Expand Down Expand Up @@ -460,7 +460,7 @@ public void ExecuteWithCheckingHammerPointState(
}
}

var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddress,
slotIndex = 0,
Expand Down Expand Up @@ -520,7 +520,7 @@ public void AddAndUnlockOption()
Guid.NewGuid(),
default);
Assert.Equal(0, equipment.optionCountFromCombination);
CombinationEquipment.AddAndUnlockOption(
CombinationEquipment16.AddAndUnlockOption(
_agentState,
null,
equipment,
Expand Down
Loading

0 comments on commit 2cd67a8

Please sign in to comment.