diff --git a/.Lib9c.DevExtensions.Tests/Action/FaucetRuneTest.cs b/.Lib9c.DevExtensions.Tests/Action/FaucetRuneTest.cs index 5535162c86..ae007716b1 100644 --- a/.Lib9c.DevExtensions.Tests/Action/FaucetRuneTest.cs +++ b/.Lib9c.DevExtensions.Tests/Action/FaucetRuneTest.cs @@ -59,7 +59,7 @@ public FaucetRuneTest(ITestOutputHelper outputHelper) _initialState = _initialState .SetAgentState(agentAddress, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); } [Theory] diff --git a/.Lib9c.Tests/Action/AccountStateViewExtensionsTest.cs b/.Lib9c.Tests/Action/AccountStateViewExtensionsTest.cs index 4288c9a7e7..993eef78ad 100644 --- a/.Lib9c.Tests/Action/AccountStateViewExtensionsTest.cs +++ b/.Lib9c.Tests/Action/AccountStateViewExtensionsTest.cs @@ -86,8 +86,7 @@ public void TryGetAvatarStateInvalidCastException() [Fact] public void TryGetAvatarStateInvalidAddress() { - var states = new World(new MockWorldState()).SetAvatarState( - default, _avatarState, true, true, true, true); + var states = new World(new MockWorldState()).SetAvatarState(default, _avatarState); Assert.False(states.TryGetAvatarState(Addresses.GameConfig, _avatarAddress, out _)); } @@ -97,7 +96,7 @@ public void GetAvatarStateV2() { IWorld states = new World(new MockWorldState()); states = states - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, _avatarState); var v2 = states.GetAvatarState(_avatarAddress); Assert.NotNull(v2.inventory); @@ -121,7 +120,7 @@ public void GetAvatarStateV2_Throw_FailedLoadStateException(string account) IWorld states = new World(new MockWorldState()); states = states - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, _avatarState); states = states.SetAccount( accountAddress, states.GetAccount(accountAddress).SetNull(_avatarAddress)); @@ -143,7 +142,7 @@ public void TryGetAvatarState(bool backward) else { states = states - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, _avatarState); } Assert.True(states.TryGetAvatarState(_agentAddress, _avatarAddress, out _)); diff --git a/.Lib9c.Tests/Action/ArenahelperTest.cs b/.Lib9c.Tests/Action/ArenahelperTest.cs index 7d5820c97c..cda73b8043 100644 --- a/.Lib9c.Tests/Action/ArenahelperTest.cs +++ b/.Lib9c.Tests/Action/ArenahelperTest.cs @@ -72,7 +72,7 @@ public ArenaHelperTest(ITestOutputHelper outputHelper) _state = _state .SetLegacyState(Addresses.GoldCurrency, goldCurrencyState.Serialize()) .SetAgentState(_agent1Address, agent1State) - .SetAvatarState(_avatar1Address, _avatar1, true, true, true, true) + .SetAvatarState(_avatar1Address, _avatar1) .SetLegacyState(Addresses.GameConfig, new GameConfigState(sheets[nameof(GameConfigSheet)]).Serialize()); Log.Logger = new LoggerConfiguration() diff --git a/.Lib9c.Tests/Action/BattleArenaTest.cs b/.Lib9c.Tests/Action/BattleArenaTest.cs index 691a8f83f1..23397678b2 100644 --- a/.Lib9c.Tests/Action/BattleArenaTest.cs +++ b/.Lib9c.Tests/Action/BattleArenaTest.cs @@ -111,13 +111,13 @@ public BattleArenaTest(ITestOutputHelper outputHelper) _initialStates = _initialStates .SetLegacyState(Addresses.GoldCurrency, goldCurrencyState.Serialize()) .SetAgentState(_agent1Address, agent1State) - .SetAvatarState(_avatar1Address, avatar1State, true, true, true, true) + .SetAvatarState(_avatar1Address, avatar1State) .SetAgentState(_agent2Address, agent2State) - .SetAvatarState(_avatar2Address, avatar2State, true, true, true, true) + .SetAvatarState(_avatar2Address, avatar2State) .SetAgentState(_agent3Address, agent3State) - .SetAvatarState(_avatar3Address, avatar3State, true, true, true, true) + .SetAvatarState(_avatar3Address, avatar3State) .SetAgentState(_agent4Address, agent4State) - .SetAvatarState(_avatar4Address, avatar4State, true, true, true, true) + .SetAvatarState(_avatar4Address, avatar4State) .SetLegacyState( Addresses.GameConfig, new GameConfigState(_sheets[nameof(GameConfigSheet)]).Serialize()); diff --git a/.Lib9c.Tests/Action/Buy7Test.cs b/.Lib9c.Tests/Action/Buy7Test.cs index 2c73f66c53..08543d57c3 100644 --- a/.Lib9c.Tests/Action/Buy7Test.cs +++ b/.Lib9c.Tests/Action/Buy7Test.cs @@ -295,8 +295,8 @@ out _ purchaseInfos.Add(purchaseInfo); _initialState = _initialState - .SetAvatarState(_buyerAvatarAddress, buyerAvatarState, true, true, true, true) - .SetAvatarState(sellerAvatarState.address, sellerAvatarState, true, true, true, true) + .SetAvatarState(_buyerAvatarAddress, buyerAvatarState) + .SetAvatarState(sellerAvatarState.address, sellerAvatarState) .SetLegacyState(shardedShopAddress, shopState.Serialize()) .SetLegacyState(Addresses.Shop, legacyShopState.Serialize()); } @@ -462,7 +462,7 @@ public void Execute_Throw_NotEnoughClearedStageLevel() 0 ), }; - _initialState = _initialState.SetAvatarState(_buyerAvatarAddress, avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(_buyerAvatarAddress, avatarState); PurchaseInfo0 purchaseInfo0 = new PurchaseInfo0( default, @@ -904,7 +904,7 @@ public void Execute_ErrorCode_InvalidPrice(int shopPrice, int price) _initialState = _initialState .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); return (avatarState, agentState); } diff --git a/.Lib9c.Tests/Action/BuyMultipleTest.cs b/.Lib9c.Tests/Action/BuyMultipleTest.cs index aeadf1cb11..5aae102522 100644 --- a/.Lib9c.Tests/Action/BuyMultipleTest.cs +++ b/.Lib9c.Tests/Action/BuyMultipleTest.cs @@ -78,7 +78,7 @@ public BuyMultipleTest(ITestOutputHelper outputHelper) .SetLegacyState(GoldCurrencyState.Address, _goldCurrencyState.Serialize()) .SetLegacyState(Addresses.Shop, shopState.Serialize()) .SetAgentState(_buyerAgentAddress, buyerAgentState) - .SetAvatarState(_buyerAvatarAddress, _buyerAvatarState, true, true, true, true) + .SetAvatarState(_buyerAvatarAddress, _buyerAvatarState) .MintAsset(context, _buyerAgentAddress, _goldCurrencyState.Currency * 100); } @@ -294,7 +294,7 @@ public void Execute(params ShopItemData[] productDatas) Assert.Equal(3, shopState.Products.Count); _initialState = _initialState - .SetAvatarState(_buyerAvatarAddress, buyerAvatarState, true, true, true, true) + .SetAvatarState(_buyerAvatarAddress, buyerAvatarState) .SetLegacyState(Addresses.Shop, shopState.Serialize()); var priceData = new PriceData(goldCurrency); @@ -305,7 +305,7 @@ public void Execute(params ShopItemData[] productDatas) priceData.TaxedPriceSum[agentState.address] = new FungibleAssetValue(goldCurrency, 0, 0); _initialState = _initialState - .SetAvatarState(avatarState.address, avatarState, true, true, true, true); + .SetAvatarState(avatarState.address, avatarState); } IWorld previousStates = _initialState; @@ -444,7 +444,7 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() 0 ), }; - _initialState = _initialState.SetAvatarState(_buyerAvatarAddress, avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(_buyerAvatarAddress, avatarState); var action = new BuyMultiple { @@ -631,7 +631,7 @@ public void ExecuteThrowShopItemExpiredError() _initialState = _initialState .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); return (avatarState, agentState); } diff --git a/.Lib9c.Tests/Action/BuyProduct2Test.cs b/.Lib9c.Tests/Action/BuyProduct2Test.cs index dee82f63dc..99414aca0f 100644 --- a/.Lib9c.Tests/Action/BuyProduct2Test.cs +++ b/.Lib9c.Tests/Action/BuyProduct2Test.cs @@ -114,11 +114,11 @@ public BuyProduct2Test(ITestOutputHelper outputHelper) _initialState = _initialState .SetLegacyState(GoldCurrencyState.Address, _goldCurrencyState.Serialize()) .SetAgentState(SellerAgentAddress, sellerAgentState) - .SetAvatarState(SellerAvatarAddress, sellerAvatarState, true, true, true, true) + .SetAvatarState(SellerAvatarAddress, sellerAvatarState) .SetAgentState(_sellerAgentAddress2, agentState2) - .SetAvatarState(_sellerAvatarAddress2, sellerAvatarState2, true, true, true, true) + .SetAvatarState(_sellerAvatarAddress2, sellerAvatarState2) .SetAgentState(BuyerAgentAddress, buyerAgentState) - .SetAvatarState(BuyerAvatarAddress, _buyerAvatarState, true, true, true, true) + .SetAvatarState(BuyerAvatarAddress, _buyerAvatarState) .MintAsset(context, BuyerAgentAddress, _goldCurrencyState.Currency * 1); } diff --git a/.Lib9c.Tests/Action/BuyTest.cs b/.Lib9c.Tests/Action/BuyTest.cs index addef23e38..8c48716b26 100644 --- a/.Lib9c.Tests/Action/BuyTest.cs +++ b/.Lib9c.Tests/Action/BuyTest.cs @@ -102,9 +102,9 @@ public BuyTest(ITestOutputHelper outputHelper) _initialState = _initialState .SetLegacyState(GoldCurrencyState.Address, _goldCurrencyState.Serialize()) .SetAgentState(_sellerAgentAddress, sellerAgentState) - .SetAvatarState(_sellerAvatarAddress, sellerAvatarState, true, true, true, true) + .SetAvatarState(_sellerAvatarAddress, sellerAvatarState) .SetAgentState(_buyerAgentAddress, buyerAgentState) - .SetAvatarState(_buyerAvatarAddress, _buyerAvatarState, true, true, true, true) + .SetAvatarState(_buyerAvatarAddress, _buyerAvatarState) .SetLegacyState(Addresses.Shop, new ShopState().Serialize()) .MintAsset(context, _buyerAgentAddress, _goldCurrencyState.Currency * 100); } @@ -332,8 +332,8 @@ public void Execute(params OrderData[] orderDataList) _initialState = _initialState .SetLegacyState(Order.DeriveAddress(orderId), order.Serialize()) - .SetAvatarState(_buyerAvatarAddress, buyerAvatarState, true, true, true, true) - .SetAvatarState(sellerAvatarState.address, sellerAvatarState, true, true, true, true) + .SetAvatarState(_buyerAvatarAddress, buyerAvatarState) + .SetAvatarState(sellerAvatarState.address, sellerAvatarState) .SetLegacyState(shardedShopAddress, shopState.Serialize()) .SetLegacyState(orderDigestListState.Address, orderDigestListState.Serialize()); } @@ -476,8 +476,7 @@ public void Execute_Throw_Exception(bool equalAvatarAddress, bool clearStage, Ty 0 ), }; - _initialState = _initialState.SetAvatarState( - _buyerAvatarAddress, avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(_buyerAvatarAddress, avatarState); } var avatarAddress = equalAvatarAddress ? _buyerAvatarAddress : default; @@ -575,8 +574,7 @@ public void Execute_ErrorCode(ErrorCodeMember errorCodeMember) var digest = order.Digest(sellerAvatarState, _tableSheets.CostumeStatSheet); shopState.Add(digest, 0); - _initialState = _initialState.SetAvatarState( - sellerAvatarAddress, sellerAvatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(sellerAvatarAddress, sellerAvatarState); } _initialState = _initialState.SetLegacyState(Order.DeriveAddress(_orderId), order.Serialize()); @@ -717,8 +715,7 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList) itemSubType, orderData.ItemCount ); - _initialState.SetAvatarState( - orderData.SellerAvatarAddress, sellerAvatarState, false, true, false, false); + _initialState.SetAvatarState(orderData.SellerAvatarAddress, sellerAvatarState); var sellItem = order.Sell3(sellerAvatarState); var orderDigest = order.Digest(sellerAvatarState, _tableSheets.CostumeStatSheet); @@ -757,8 +754,8 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList) _initialState = _initialState .SetLegacyState(Order.DeriveAddress(orderId), order.Serialize()) - .SetAvatarState(_buyerAvatarAddress, buyerAvatarState, true, true, true, true) - .SetAvatarState(sellerAvatarState.address, sellerAvatarState, true, true, true, true) + .SetAvatarState(_buyerAvatarAddress, buyerAvatarState) + .SetAvatarState(sellerAvatarState.address, sellerAvatarState) .SetLegacyState(shardedShopAddress, shopState.Serialize()) .SetLegacyState(orderDigestListState.Address, orderDigestListState.Serialize()); } @@ -985,7 +982,7 @@ public void Execute_With_Testbed() _initialState = _initialState .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); return (avatarState, agentState); } diff --git a/.Lib9c.Tests/Action/CancelProductRegistration0Test.cs b/.Lib9c.Tests/Action/CancelProductRegistration0Test.cs index 9323cf98ab..e5e6477f89 100644 --- a/.Lib9c.Tests/Action/CancelProductRegistration0Test.cs +++ b/.Lib9c.Tests/Action/CancelProductRegistration0Test.cs @@ -73,7 +73,7 @@ public CancelProductRegistration0Test(ITestOutputHelper outputHelper) .SetLegacyState(GoldCurrencyState.Address, _goldCurrencyState.Serialize()) .SetAgentState(_agentAddress, agentState) .SetLegacyState(Addresses.Shop, new ShopState().Serialize()) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); } [Theory] diff --git a/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs b/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs index 720f25f347..5944da1af2 100644 --- a/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs +++ b/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs @@ -56,7 +56,7 @@ public void Execute() var state = new World(new MockWorldState()) .SetLegacyState(Addresses.GameConfig, gameConfigState.Serialize()) .SetAgentState(agentAddress, agent) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); foreach (var (key, value) in _sheets) { diff --git a/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs b/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs index 6be7627c5b..a67ab1ab69 100644 --- a/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs +++ b/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs @@ -47,7 +47,7 @@ public ChargeActionPoint2Test() _initialState = new World(new MockWorldState()) .SetLegacyState(Addresses.GameConfig, gameConfigState.Serialize()) .SetAgentState(_agentAddress, agent) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); foreach (var (key, value) in _sheets) { @@ -75,7 +75,7 @@ public void Execute(bool useTradable) Assert.Equal(0, avatarState.actionPoint); - var state = _initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _initialState.SetAvatarState(_avatarAddress, avatarState); foreach (var (key, value) in _sheets) { @@ -134,7 +134,7 @@ public void Execute_Throw_NotEnoughMaterialException(bool useTradable) Assert.Equal(0, avatarState.actionPoint); - var state = _initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _initialState.SetAvatarState(_avatarAddress, avatarState); var action = new ChargeActionPoint2() { diff --git a/.Lib9c.Tests/Action/ChargeActionPointTest.cs b/.Lib9c.Tests/Action/ChargeActionPointTest.cs index 9fe32a0b32..258b691cdd 100644 --- a/.Lib9c.Tests/Action/ChargeActionPointTest.cs +++ b/.Lib9c.Tests/Action/ChargeActionPointTest.cs @@ -49,7 +49,7 @@ public ChargeActionPointTest() _initialState = new World(new MockWorldState()) .SetLegacyState(Addresses.GameConfig, gameConfigState.Serialize()) .SetAgentState(_agentAddress, agent) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); foreach (var (key, value) in _sheets) { @@ -78,7 +78,7 @@ public void Execute(bool useTradable) Assert.Equal(0, avatarState.actionPoint); IWorld state; - state = _initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + state = _initialState.SetAvatarState(_avatarAddress, avatarState); foreach (var (key, value) in _sheets) { @@ -131,13 +131,13 @@ public void Execute_Throw_Exception(bool useAvatarAddress, bool useTradable, boo if (enough) { avatarState.inventory.AddItem(apStone); - state = state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, avatarState); } if (charge) { avatarState.actionPoint = state.GetGameConfigState().ActionPointMax; - state = state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, avatarState); } var action = new ChargeActionPoint() diff --git a/.Lib9c.Tests/Action/ClaimItemsTest.cs b/.Lib9c.Tests/Action/ClaimItemsTest.cs index fe8c079a55..c74ddb646d 100644 --- a/.Lib9c.Tests/Action/ClaimItemsTest.cs +++ b/.Lib9c.Tests/Action/ClaimItemsTest.cs @@ -344,7 +344,7 @@ private IWorld GenerateAvatar(IWorld state, out Address avatarAddress, out Addre state = state .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); return state; } diff --git a/.Lib9c.Tests/Action/ClaimWorldBossKillRewardTest.cs b/.Lib9c.Tests/Action/ClaimWorldBossKillRewardTest.cs index 0c1ed8ce74..ce8f01a076 100644 --- a/.Lib9c.Tests/Action/ClaimWorldBossKillRewardTest.cs +++ b/.Lib9c.Tests/Action/ClaimWorldBossKillRewardTest.cs @@ -71,7 +71,7 @@ public void Execute(long blockIndex, Type exc) .SetLegacyState(Addresses.GetSheetAddress(), tableSheets.RuneSheet.Serialize()) .SetLegacyState(Addresses.GetSheetAddress(), tableSheets.WorldBossCharacterSheet.Serialize()) .SetLegacyState(Addresses.GameConfig, gameConfigState.Serialize()) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(worldBossKillRewardRecordAddress, worldBossKillRewardRecord.Serialize()) .SetLegacyState(worldBossAddress, worldBossState.Serialize()) .SetLegacyState(raiderStateAddress, raiderState.Serialize()); diff --git a/.Lib9c.Tests/Action/CombinationEquipment16Test.cs b/.Lib9c.Tests/Action/CombinationEquipment16Test.cs index 7356b700b7..b0d41e67f5 100644 --- a/.Lib9c.Tests/Action/CombinationEquipment16Test.cs +++ b/.Lib9c.Tests/Action/CombinationEquipment16Test.cs @@ -202,7 +202,7 @@ bool previousCostStateExist } else { - state = state.SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, _avatarState); } if (!slotUnlock) @@ -390,7 +390,7 @@ public void ExecuteWithCheckingHammerPointState( } state = state - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, _avatarState); var hammerPointAddress = Addresses.GetHammerPointStateAddress(_avatarAddress, recipeId); if (doSuperCraft) diff --git a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs index c451597d3a..c06a3390f5 100644 --- a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs +++ b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs @@ -77,9 +77,9 @@ public void Execute() default); state = state - .SetAvatarState(agent1Avatar0Address, agent1Avatar0State, true, true, true, true) - .SetAvatarState(agent1Avatar1Address, agent1Avatar1State, true, true, true, true) - .SetAvatarState(agent2Avatar0Address, agent2Avatar0State, true, true, true, true); + .SetAvatarState(agent1Avatar0Address, agent1Avatar0State) + .SetAvatarState(agent1Avatar1Address, agent1Avatar1State) + .SetAvatarState(agent2Avatar0Address, agent2Avatar0State); // can't redeem a coupon with an arbitrary guid Assert.Equal( diff --git a/.Lib9c.Tests/Action/DailyRewardTest.cs b/.Lib9c.Tests/Action/DailyRewardTest.cs index b9e3a7670c..dd24648622 100644 --- a/.Lib9c.Tests/Action/DailyRewardTest.cs +++ b/.Lib9c.Tests/Action/DailyRewardTest.cs @@ -56,7 +56,7 @@ public DailyRewardTest(ITestOutputHelper outputHelper) _initialState = _initialState .SetLegacyState(Addresses.GameConfig, gameConfigState.Serialize()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); } [Theory] @@ -145,7 +145,7 @@ private void Execute_Without_Runereward() } private IWorld SetAvatarStateAsV2To(IWorld state, AvatarState avatarState) => - state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + state.SetAvatarState(_avatarAddress, avatarState); private IWorld ExecuteInternal(IWorld previousStates, long blockIndex = 0) { diff --git a/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs b/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs index 7e93b42f35..636d29a4a9 100644 --- a/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs +++ b/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs @@ -55,7 +55,7 @@ public EventConsumableItemCrafts0Test() _initialStates = _initialStates .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetLegacyState(gameConfigState.address, gameConfigState.Serialize()); for (var i = 0; i < GameConfig.SlotCount; i++) @@ -124,7 +124,7 @@ private void Execute( GameConfig.RequireClearedStageLevel.CombinationConsumableAction); previousStates = previousStates - .SetAvatarState(_avatarAddress, previousAvatarState, false, true, true, false); + .SetAvatarState(_avatarAddress, previousAvatarState); var previousActionPoint = previousAvatarState.actionPoint; var previousResultConsumableCount = diff --git a/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs b/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs index 953040c8f8..f06296b5d2 100644 --- a/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs +++ b/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs @@ -58,7 +58,7 @@ public EventMaterialItemCrafts0Test() _initialStates = _initialStates .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetLegacyState(gameConfigState.address, gameConfigState.Serialize()); for (var i = 0; i < GameConfig.SlotCount; i++) @@ -217,7 +217,7 @@ private void Execute( GameConfig.RequireClearedStageLevel.CombinationConsumableAction); previousStates = previousStates - .SetAvatarState(_avatarAddress, previousAvatarState, false, true, true, false); + .SetAvatarState(_avatarAddress, previousAvatarState); var previousMaterialCount = previousAvatarState.inventory.Items .Where(i => recipeRow.RequiredMaterialsId.Contains(i.item.Id)) diff --git a/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs b/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs index 409ca78a6f..8d25b328df 100644 --- a/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs +++ b/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs @@ -304,7 +304,7 @@ public void Execute_Throws_Exception() avatarState = _previousStates.GetAvatarState(_avatarAddress); avatarState.inventory = new Inventory(); var previousStatesWithEmptyInventoryState = - _previousStates.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + _previousStates.SetAvatarState(_avatarAddress, avatarState); Assert.Throws(() => Execute( AgentAddr, 0, @@ -326,7 +326,7 @@ public void Execute_Throws_Exception() } var previousStatesWithNotEnoughInventoryState = - _previousStates.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + _previousStates.SetAvatarState(_avatarAddress, avatarState); Assert.Throws(() => Execute( AgentAddr, 0, @@ -487,7 +487,7 @@ private static (Address balanceAddr, FungibleAssetValue value)[] .ToArray(), garageCost, fungibleItemAndCounts.Select(tuple => tuple.fungibleItem).ToArray(), - previousStates.SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + previousStates.SetAvatarState(_avatarAddress, avatarState) ); } } diff --git a/.Lib9c.Tests/Action/Grinding0Test.cs b/.Lib9c.Tests/Action/Grinding0Test.cs index 9ba8289f98..47b983cc6a 100644 --- a/.Lib9c.Tests/Action/Grinding0Test.cs +++ b/.Lib9c.Tests/Action/Grinding0Test.cs @@ -156,7 +156,7 @@ Type exc } state = state - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, _avatarState); Assert.Equal(0 * _crystalCurrency, state.GetBalance(_avatarAddress, _crystalCurrency)); } diff --git a/.Lib9c.Tests/Action/GrindingTest.cs b/.Lib9c.Tests/Action/GrindingTest.cs index 91ec8597ff..9a8004fa4f 100644 --- a/.Lib9c.Tests/Action/GrindingTest.cs +++ b/.Lib9c.Tests/Action/GrindingTest.cs @@ -156,7 +156,7 @@ Type exc } state = state - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, _avatarState); Assert.Equal(0 * _crystalCurrency, state.GetBalance(_avatarAddress, _crystalCurrency)); } diff --git a/.Lib9c.Tests/Action/HackAndSlashRandomBuffTest.cs b/.Lib9c.Tests/Action/HackAndSlashRandomBuffTest.cs index f8f9412ff7..d1d8d3b39d 100644 --- a/.Lib9c.Tests/Action/HackAndSlashRandomBuffTest.cs +++ b/.Lib9c.Tests/Action/HackAndSlashRandomBuffTest.cs @@ -67,7 +67,7 @@ public HackAndSlashRandomBuffTest() _initialState = new World(new MockWorldState()) .SetLegacyState(_weeklyArenaState.address, _weeklyArenaState.Serialize()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, _avatarState) .SetLegacyState(gameConfigState.address, gameConfigState.Serialize()); foreach (var (key, value) in _sheets) @@ -109,7 +109,7 @@ public void Execute(int stageId, bool advancedGacha, int balance, int gatheredSt }; var gachaStateAddress = Addresses.GetSkillStateAddressFromAvatarAddress(_avatarAddress); var gachaState = new CrystalRandomSkillState(gachaStateAddress, stageId); - states = states.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(_avatarAddress, avatarState); var crystalStageSheet = _tableSheets.CrystalStageBuffGachaSheet; gachaState.Update(gatheredStar, crystalStageSheet); states = states.SetLegacyState(gachaStateAddress, gachaState.Serialize()); @@ -171,7 +171,7 @@ public void ContainMinimumBuffRank(bool advancedGacha, CrystalRandomBuffSheet.Ro }; var gachaStateAddress = Addresses.GetSkillStateAddressFromAvatarAddress(_avatarAddress); var gachaState = new CrystalRandomSkillState(gachaStateAddress, 1); - states = states.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(_avatarAddress, avatarState); var crystalStageSheet = _tableSheets.CrystalStageBuffGachaSheet; var randomBuffSheet = _tableSheets.CrystalRandomBuffSheet; gachaState.Update(100_000_000, crystalStageSheet); diff --git a/.Lib9c.Tests/Action/JoinArena1Test.cs b/.Lib9c.Tests/Action/JoinArena1Test.cs index d44baf800a..199df55e88 100644 --- a/.Lib9c.Tests/Action/JoinArena1Test.cs +++ b/.Lib9c.Tests/Action/JoinArena1Test.cs @@ -100,9 +100,9 @@ public JoinArena1Test(ITestOutputHelper outputHelper) _state = _state .SetAgentState(_signer, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetAgentState(_signer2, agent2State) - .SetAvatarState(_avatar2Address, avatar2State, true, true, true, true) + .SetAvatarState(_avatar2Address, avatar2State) .SetLegacyState(Addresses.GoldCurrency, goldCurrencyState.Serialize()); foreach ((string key, string value) in sheets) @@ -147,7 +147,7 @@ public AvatarState GetAvatarState(AvatarState avatarState, out List equipm (equipments, costumes) = GetDummyItems(avatarState); _state = _state - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); return avatarState; } @@ -167,7 +167,7 @@ public AvatarState AddMedal(AvatarState avatarState, ArenaSheet.Row row, int cou avatarState.inventory.AddItem(material, count); } - _state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + _state = _state.SetAvatarState(_avatarAddress, avatarState); return avatarState; } @@ -269,7 +269,7 @@ public void Execute_SheetRowNotFoundException(int championshipId) { var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena1() { @@ -294,7 +294,7 @@ public void Execute_RoundNotFoundByIdsException(int round) { var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena1() { @@ -349,7 +349,7 @@ public void Execute_NotEnoughFungibleAssetValueException(int round, long blockIn { var avatarState = _state.GetAvatarState(_avatarAddress); GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena1() { @@ -374,7 +374,7 @@ public void Execute_ArenaScoreAlreadyContainsException() { var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena1() { @@ -410,7 +410,7 @@ public void Execute_ArenaScoreAlreadyContainsException2() var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var arenaScoreAdr = ArenaScore.DeriveAddress(_avatarAddress, championshipId, round); var arenaScore = new ArenaScore(_avatarAddress, championshipId, round); @@ -442,7 +442,7 @@ public void Execute_ArenaInformationAlreadyContainsException() var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var arenaInformationAdr = ArenaInformation.DeriveAddress(_avatarAddress, championshipId, round); var arenaInformation = new ArenaInformation(_avatarAddress, championshipId, round); diff --git a/.Lib9c.Tests/Action/JoinArena3Test.cs b/.Lib9c.Tests/Action/JoinArena3Test.cs index 7e18a08a48..9a4ee71222 100644 --- a/.Lib9c.Tests/Action/JoinArena3Test.cs +++ b/.Lib9c.Tests/Action/JoinArena3Test.cs @@ -102,9 +102,9 @@ public JoinArena3Test(ITestOutputHelper outputHelper) _state = _state .SetAgentState(_signer, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetAgentState(_signer2, agent2State) - .SetAvatarState(_avatar2Address, avatar2State, true, true, true, true) + .SetAvatarState(_avatar2Address, avatar2State) .SetLegacyState(gameConfigState.address, gameConfigState.Serialize()) .SetLegacyState(Addresses.GoldCurrency, goldCurrencyState.Serialize()); @@ -149,7 +149,7 @@ public AvatarState GetAvatarState(AvatarState avatarState, out List equipm avatarState.level = 999; (equipments, costumes) = GetDummyItems(avatarState); - _state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + _state = _state.SetAvatarState(_avatarAddress, avatarState); return avatarState; } @@ -169,7 +169,7 @@ public AvatarState AddMedal(AvatarState avatarState, ArenaSheet.Row row, int cou avatarState.inventory.AddItem(material, count); } - _state = _state.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + _state = _state.SetAvatarState(_avatarAddress, avatarState); return avatarState; } @@ -272,7 +272,7 @@ public void Execute_SheetRowNotFoundException(int championshipId) { var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, false, false, false); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena3() { @@ -298,7 +298,7 @@ public void Execute_RoundNotFoundByIdsException(int round) { var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, false, false, false); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena3() { @@ -355,7 +355,7 @@ public void Execute_NotEnoughFungibleAssetValueException(int round, long blockIn { var avatarState = _state.GetAvatarState(_avatarAddress); GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, false, false, false); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena3() { @@ -381,7 +381,7 @@ public void Execute_ArenaScoreAlreadyContainsException() { var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, false, false, false); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var action = new JoinArena3() { @@ -418,7 +418,7 @@ public void Execute_ArenaScoreAlreadyContainsException2() var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, false, false, false); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var arenaScoreAdr = ArenaScore.DeriveAddress(_avatarAddress, championshipId, round); var arenaScore = new ArenaScore(_avatarAddress, championshipId, round); @@ -451,7 +451,7 @@ public void Execute_ArenaInformationAlreadyContainsException() var avatarState = _state.GetAvatarState(_avatarAddress); avatarState = GetAvatarState(avatarState, out var equipments, out var costumes); - var state = _state.SetAvatarState(_avatarAddress, avatarState, true, false, false, false); + var state = _state.SetAvatarState(_avatarAddress, avatarState); var arenaInformationAdr = ArenaInformation.DeriveAddress(_avatarAddress, championshipId, round); var arenaInformation = new ArenaInformation(_avatarAddress, championshipId, round); diff --git a/.Lib9c.Tests/Action/MigrateMonsterCollectionTest.cs b/.Lib9c.Tests/Action/MigrateMonsterCollectionTest.cs index 117d5de753..4a0fc6c454 100644 --- a/.Lib9c.Tests/Action/MigrateMonsterCollectionTest.cs +++ b/.Lib9c.Tests/Action/MigrateMonsterCollectionTest.cs @@ -53,7 +53,7 @@ public MigrateMonsterCollectionTest(ITestOutputHelper outputHelper) _state = _state .SetAgentState(_signer, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetLegacyState(Addresses.GoldCurrency, goldCurrencyState.Serialize()); foreach ((string key, string value) in sheets) diff --git a/.Lib9c.Tests/Action/MintAssetsTest.cs b/.Lib9c.Tests/Action/MintAssetsTest.cs index a787d0fbe8..981ebb1913 100644 --- a/.Lib9c.Tests/Action/MintAssetsTest.cs +++ b/.Lib9c.Tests/Action/MintAssetsTest.cs @@ -348,7 +348,7 @@ private IWorld GenerateAvatar(IWorld state, out Address avatarAddress) state = state .SetAgentState(address, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); return state; } @@ -374,7 +374,7 @@ private IWorld GenerateAvatar(IWorld state, Address address, Address avatarAddre state = state .SetAgentState(address, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); return state; } diff --git a/.Lib9c.Tests/Action/RankingBattleTest.cs b/.Lib9c.Tests/Action/RankingBattleTest.cs index 520f5c187b..2bff5d2cfc 100644 --- a/.Lib9c.Tests/Action/RankingBattleTest.cs +++ b/.Lib9c.Tests/Action/RankingBattleTest.cs @@ -89,9 +89,9 @@ public RankingBattleTest(ITestOutputHelper outputHelper) _initialState = _initialState .SetAgentState(_agent1Address, agent1State) - .SetAvatarState(_avatar1Address, avatar1State, true, true, true, true) + .SetAvatarState(_avatar1Address, avatar1State) .SetAgentState(agent2Address, agent2State) - .SetAvatarState(_avatar2Address, avatar2State, true, true, true, true) + .SetAvatarState(_avatar2Address, avatar2State) .SetLegacyState(Addresses.GameConfig, new GameConfigState(sheets[nameof(GameConfigSheet)]).Serialize()) .SetLegacyState(_weeklyArenaAddress, weeklyArenaState.Serialize()) .SetLegacyState( diff --git a/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs b/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs index 6087b2f688..6b1d315fea 100644 --- a/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs +++ b/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs @@ -202,7 +202,7 @@ bool fromPreviousAction else { prevState = prevState - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); } prevState = prevState diff --git a/.Lib9c.Tests/Action/ReRegisterProductTest.cs b/.Lib9c.Tests/Action/ReRegisterProductTest.cs index 5760be8397..b0c1ecabc4 100644 --- a/.Lib9c.Tests/Action/ReRegisterProductTest.cs +++ b/.Lib9c.Tests/Action/ReRegisterProductTest.cs @@ -197,11 +197,11 @@ bool fromPreviousAction if (fromPreviousAction) { - prevState = prevState.SetAvatarState(_avatarAddress, avatarState, true, false, false, false); + prevState = prevState.SetAvatarState(_avatarAddress, avatarState); } else { - prevState = prevState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + prevState = prevState.SetAvatarState(_avatarAddress, avatarState); } prevState = prevState diff --git a/.Lib9c.Tests/Action/RedeemCode0Test.cs b/.Lib9c.Tests/Action/RedeemCode0Test.cs index c91607c79e..3fe4794f51 100644 --- a/.Lib9c.Tests/Action/RedeemCode0Test.cs +++ b/.Lib9c.Tests/Action/RedeemCode0Test.cs @@ -70,7 +70,7 @@ public void Execute() var context = new ActionContext(); var initialState = new World(new MockWorldState()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetLegacyState(RedeemCodeState.Address, prevRedeemCodesState.Serialize()) .SetLegacyState(GoldCurrencyState.Address, goldState.Serialize()) .MintAsset(context, GoldCurrencyState.Address, goldState.Currency * 100000000); diff --git a/.Lib9c.Tests/Action/RedeemCodeTest.cs b/.Lib9c.Tests/Action/RedeemCodeTest.cs index 63c77a55b1..e491e300f3 100644 --- a/.Lib9c.Tests/Action/RedeemCodeTest.cs +++ b/.Lib9c.Tests/Action/RedeemCodeTest.cs @@ -83,7 +83,7 @@ public void Execute(bool backward) } else { - initialState = initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + initialState = initialState.SetAvatarState(_avatarAddress, avatarState); } foreach (var (key, value) in _sheets) diff --git a/.Lib9c.Tests/Action/RegisterProduct0Test.cs b/.Lib9c.Tests/Action/RegisterProduct0Test.cs index 821e3458fb..3acb53a28f 100644 --- a/.Lib9c.Tests/Action/RegisterProduct0Test.cs +++ b/.Lib9c.Tests/Action/RegisterProduct0Test.cs @@ -60,7 +60,7 @@ public RegisterProduct0Test() .SetLegacyState(Addresses.GetSheetAddress(), _tableSheets.MaterialItemSheet.Serialize()) .SetLegacyState(Addresses.GameConfig, _gameConfigState.Serialize()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(AvatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(AvatarAddress, _avatarState); } public static IEnumerable Execute_Validate_MemberData() @@ -208,7 +208,7 @@ public void Execute() var asset = 3 * RuneHelper.DailyRewardRune; var context = new ActionContext(); _initialState = _initialState - .SetAvatarState(AvatarAddress, _avatarState, true, true, true, true) + .SetAvatarState(AvatarAddress, _avatarState) .MintAsset(context, AvatarAddress, asset); var action = new RegisterProduct0 { @@ -347,7 +347,7 @@ public void Execute_Throw_ItemDoesNotExistException(ProductType type, int itemCo _avatarState.inventory.AddItem((ItemBase)tradableItem); } - _initialState = _initialState.SetAvatarState(AvatarAddress, _avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(AvatarAddress, _avatarState); var action = new RegisterProduct0 { AvatarAddress = AvatarAddress, diff --git a/.Lib9c.Tests/Action/RegisterProduct2Test.cs b/.Lib9c.Tests/Action/RegisterProduct2Test.cs index 5ab8b99f77..10e679fced 100644 --- a/.Lib9c.Tests/Action/RegisterProduct2Test.cs +++ b/.Lib9c.Tests/Action/RegisterProduct2Test.cs @@ -60,7 +60,7 @@ public RegisterProduct2Test() .SetLegacyState(Addresses.GetSheetAddress(), _tableSheets.MaterialItemSheet.Serialize()) .SetLegacyState(Addresses.GameConfig, _gameConfigState.Serialize()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(AvatarAddress, _avatarState, true, true, true, true); + .SetAvatarState(AvatarAddress, _avatarState); } public static IEnumerable Execute_Validate_MemberData() @@ -208,7 +208,7 @@ public void Execute() var asset = 3 * RuneHelper.DailyRewardRune; var context = new ActionContext(); _initialState = _initialState - .SetAvatarState(AvatarAddress, _avatarState, true, true, true, true) + .SetAvatarState(AvatarAddress, _avatarState) .MintAsset(context, AvatarAddress, asset); var action = new RegisterProduct2 { @@ -348,7 +348,7 @@ public void Execute_Throw_ItemDoesNotExistException(ProductType type, int itemCo _avatarState.inventory.AddItem((ItemBase)tradableItem); } - _initialState = _initialState.SetAvatarState(AvatarAddress, _avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(AvatarAddress, _avatarState); var action = new RegisterProduct2 { AvatarAddress = AvatarAddress, diff --git a/.Lib9c.Tests/Action/RuneEnhancementTest.cs b/.Lib9c.Tests/Action/RuneEnhancementTest.cs index 2ec6272712..16b398d0a4 100644 --- a/.Lib9c.Tests/Action/RuneEnhancementTest.cs +++ b/.Lib9c.Tests/Action/RuneEnhancementTest.cs @@ -54,7 +54,7 @@ public void Execute(int seed) var state = new World(new MockWorldState()) .SetLegacyState(goldCurrencyState.address, goldCurrencyState.Serialize()) .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); foreach (var (key, value) in sheets) { @@ -208,7 +208,7 @@ public void Execute_RuneCostNotFoundException() var state = new World(new MockWorldState()) .SetLegacyState(goldCurrencyState.address, goldCurrencyState.Serialize()) .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); foreach (var (key, value) in sheets) { @@ -264,7 +264,7 @@ public void Execute_RuneCostDataNotFoundException() var state = new World(new MockWorldState()) .SetLegacyState(goldCurrencyState.address, goldCurrencyState.Serialize()) .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); foreach (var (key, value) in sheets) { @@ -336,7 +336,7 @@ public void Execute_NotEnoughFungibleAssetValueException(bool ncg, bool crystal, var state = new World(new MockWorldState()) .SetLegacyState(goldCurrencyState.address, goldCurrencyState.Serialize()) .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); foreach (var (key, value) in sheets) { @@ -451,7 +451,7 @@ public void Execute_TryCountIsZeroException() var state = new World(new MockWorldState()) .SetLegacyState(goldCurrencyState.address, goldCurrencyState.Serialize()) .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); foreach (var (key, value) in sheets) { diff --git a/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs index 3fddf6eef8..5b6262816e 100644 --- a/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs @@ -176,7 +176,7 @@ public IWorld BattleArena( agentState.avatarAddresses.Add(0, avatarAddress); _state = _state .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); return (agentState, avatarState); } diff --git a/.Lib9c.Tests/Action/Scenario/AuraScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/AuraScenarioTest.cs index e3c44bb1c3..10fd9f1d06 100644 --- a/.Lib9c.Tests/Action/Scenario/AuraScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/AuraScenarioTest.cs @@ -64,8 +64,7 @@ public AuraScenarioTest() rankingMapAddress ); avatarState.inventory.AddItem(_aura); - _initialState = _initialState.SetAvatarState( - avatarAddress, avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(avatarAddress, avatarState); } _currency = Currency.Legacy("NCG", 2, minters: null); @@ -141,13 +140,7 @@ public void Raid() avatarState.worldInformation.ClearStage(1, i + 1, 0, _tableSheets.WorldSheet, _tableSheets.WorldUnlockSheet); } - var prevState = _initialState.SetAvatarState( - _avatarAddress, - avatarState, - false, - false, - true, - false); + var prevState = _initialState.SetAvatarState(_avatarAddress, avatarState); var raid = new Raid { @@ -187,8 +180,7 @@ public void Arena() avatarState.worldInformation.ClearStage(1, i + 1, 0, _tableSheets.WorldSheet, _tableSheets.WorldUnlockSheet); } - prevState = prevState.SetAvatarState( - avatarAddress, avatarState, false, false, true, false); + prevState = prevState.SetAvatarState(avatarAddress, avatarState); var join = new JoinArena3 { @@ -317,8 +309,7 @@ public void Market() avatarState.worldInformation.ClearStage(1, i + 1, 0, _tableSheets.WorldSheet, _tableSheets.WorldUnlockSheet); } - var previousState = _initialState.SetAvatarState( - _avatarAddress, avatarState, false, false, true, false); + var previousState = _initialState.SetAvatarState(_avatarAddress, avatarState); var register = new RegisterProduct2 { diff --git a/.Lib9c.Tests/Action/Scenario/MarketScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/MarketScenarioTest.cs index e731214e1a..9ded253595 100644 --- a/.Lib9c.Tests/Action/Scenario/MarketScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/MarketScenarioTest.cs @@ -109,11 +109,11 @@ public MarketScenarioTest(ITestOutputHelper outputHelper) .SetLegacyState(Addresses.GetSheetAddress(), _tableSheets.MaterialItemSheet.Serialize()) .SetLegacyState(Addresses.GetSheetAddress(), _tableSheets.ArenaSheet.Serialize()) .SetAgentState(_sellerAgentAddress, agentState) - .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState, true, true, true, true) + .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState) .SetAgentState(_sellerAgentAddress2, agentState2) - .SetAvatarState(_sellerAvatarAddress2, _sellerAvatarState2, true, true, true, true) + .SetAvatarState(_sellerAvatarAddress2, _sellerAvatarState2) .SetAgentState(_buyerAgentAddress, agentState3) - .SetAvatarState(_buyerAvatarAddress, buyerAvatarState, true, true, true, true); + .SetAvatarState(_buyerAvatarAddress, buyerAvatarState); } [Fact] @@ -128,8 +128,8 @@ public void Register_And_Buy() var equipment = ItemFactory.CreateItemUsable(equipmentRow, id, 0L); _sellerAvatarState2.inventory.AddItem(equipment); _initialState = _initialState - .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState, true, true, true, true) - .SetAvatarState(_sellerAvatarAddress2, _sellerAvatarState2, true, true, true, true) + .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState) + .SetAvatarState(_sellerAvatarAddress2, _sellerAvatarState2) .MintAsset(context, _buyerAgentAddress, 4 * _currency) .MintAsset(context, _sellerAvatarAddress, 1 * RuneHelper.StakeRune) .MintAsset(context, _sellerAvatarAddress2, 1 * RuneHelper.DailyRewardRune); @@ -361,7 +361,7 @@ public void Register_And_Cancel() _sellerAvatarState.inventory.AddItem(equipment); Assert.Equal(2, _sellerAvatarState.inventory.Items.Count); _initialState = _initialState - .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState, true, true, true, true) + .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState) .MintAsset(context, _sellerAvatarAddress, 1 * RuneHelper.StakeRune); var action = new RegisterProduct2 { @@ -534,7 +534,7 @@ public void Register_And_ReRegister() Assert.Equal(2, _sellerAvatarState.inventory.Items.Count); _initialState = _initialState .MintAsset(context, _sellerAvatarAddress, 2 * RuneHelper.StakeRune) - .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState, true, true, true, true); + .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState); var action = new RegisterProduct2 { AvatarAddress = _sellerAvatarAddress, @@ -746,8 +746,7 @@ public void ReRegister_Order() var id = Guid.NewGuid(); var equipment = ItemFactory.CreateItemUsable(equipmentRow, id, 0L); _sellerAvatarState.inventory.AddItem(equipment); - _initialState = _initialState.SetAvatarState( - _sellerAvatarAddress, _sellerAvatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(_sellerAvatarAddress, _sellerAvatarState); var digestListAddress = OrderDigestListState.DeriveAddress(_sellerAvatarAddress); var orderDigestList = new OrderDigestListState(digestListAddress); @@ -779,7 +778,7 @@ public void ReRegister_Order() .SetLegacyState(Order.DeriveAddress(order.OrderId), order.Serialize()) .SetLegacyState(digestListAddress, orderDigestList.Serialize()) .SetLegacyState(shardedShopAddress, shopState.Serialize()) - .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState, true, true, true, true); + .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState); var productType = tradableItem is TradableMaterial ? ProductType.Fungible @@ -860,7 +859,7 @@ public void HardFork() _sellerAvatarState.inventory.AddItem(equipment); Assert.Equal(2, _sellerAvatarState.inventory.Items.Count); _initialState = _initialState - .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState, true, true, true, true) + .SetAvatarState(_sellerAvatarAddress, _sellerAvatarState) .MintAsset(context, _buyerAgentAddress, 3 * _currency) .MintAsset(context, _sellerAvatarAddress, 1 * RuneHelper.StakeRune); var action = new RegisterProduct0 diff --git a/.Lib9c.Tests/Action/Scenario/RuneScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/RuneScenarioTest.cs index c4c274eaa6..d6f786bbbe 100644 --- a/.Lib9c.Tests/Action/Scenario/RuneScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/RuneScenarioTest.cs @@ -42,7 +42,7 @@ public void Craft_And_Unlock_And_Equip() var context = new ActionContext(); IWorld initialState = new World(new MockWorldState()) .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState( Addresses.GoldCurrency, new GoldCurrencyState(Currency.Legacy("NCG", 2, minters: null)).Serialize()) diff --git a/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs b/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs index edafb11445..5aa2457b93 100644 --- a/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs +++ b/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs @@ -64,7 +64,7 @@ public SellAndCancellationAndSellTest(ITestOutputHelper outputHelper) .SetLegacyState(GoldCurrencyState.Address, gold.Serialize()) .SetLegacyState(gameConfigState.address, gameConfigState.Serialize()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); foreach (var (key, value) in sheets) { @@ -83,8 +83,7 @@ public void Execute_With_TradableMaterial() var avatarState = previousStates.GetAvatarState(_avatarAddress); // Add 10 ap stones to inventory. avatarState.inventory.AddFungibleItem(apStone, 10); - previousStates = previousStates.SetAvatarState( - _avatarAddress, avatarState, false, true, false, false); + previousStates = previousStates.SetAvatarState(_avatarAddress, avatarState); // sell ap stones with count 1, 2, 3, 4. var sellBlockIndex = 1L; diff --git a/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs index c8d277b989..5ef3fcdb83 100644 --- a/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs @@ -53,7 +53,7 @@ public WorldUnlockScenarioTest() _initialState = new World(new MockWorldState()) .SetLegacyState(_weeklyArenaState.address, _weeklyArenaState.Serialize()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetLegacyState(_rankingMapAddress, new RankingMapState(_rankingMapAddress).Serialize()); foreach (var (key, value) in sheets) @@ -90,7 +90,7 @@ public void UnlockWorldByHackAndSlashAfterPatchTableWithAddRow( var doomfist = Doomfist.GetOne(_tableSheets, avatarState.level, ItemSubType.Weapon); avatarState.inventory.AddItem(doomfist); - var nextState = _initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + var nextState = _initialState.SetAvatarState(_avatarAddress, avatarState); var hackAndSlash = new HackAndSlash3 { worldId = worldIdToClear, diff --git a/.Lib9c.Tests/Action/SellCancellationTest.cs b/.Lib9c.Tests/Action/SellCancellationTest.cs index 9c720146b5..5feb2f10a2 100644 --- a/.Lib9c.Tests/Action/SellCancellationTest.cs +++ b/.Lib9c.Tests/Action/SellCancellationTest.cs @@ -209,7 +209,7 @@ bool fromPreviousAction } else { - prevState = prevState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + prevState = prevState.SetAvatarState(_avatarAddress, avatarState); } prevState = prevState @@ -330,7 +330,7 @@ public void Execute_Throw_NotEnoughClearedStageLevelException() ), }; - IWorld prevState = _initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + IWorld prevState = _initialState.SetAvatarState(_avatarAddress, avatarState); var action = new SellCancellation { @@ -644,7 +644,7 @@ bool fromPreviousAction } else { - prevState = prevState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + prevState = prevState.SetAvatarState(_avatarAddress, avatarState); } prevState = prevState diff --git a/.Lib9c.Tests/Action/SellTest.cs b/.Lib9c.Tests/Action/SellTest.cs index 8e5a29dfd9..d791456cc4 100644 --- a/.Lib9c.Tests/Action/SellTest.cs +++ b/.Lib9c.Tests/Action/SellTest.cs @@ -133,7 +133,7 @@ bool backward else { previousStates = previousStates - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(_avatarAddress, avatarState); } var currencyState = previousStates.GetGoldCurrency(); @@ -314,7 +314,7 @@ public void Execute_Throw_NotEnoughClearedStageLevelException() ), }; - _initialState = _initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(_avatarAddress, avatarState); var action = new Sell { @@ -349,13 +349,7 @@ public void Execute_Throw_ItemDoesNotExistException(bool isLock) var orderLock = new OrderLock(Guid.NewGuid()); _avatarState.inventory.AddItem(tradableItem, 1, orderLock); Assert.True(_avatarState.inventory.TryGetLockedItem(orderLock, out _)); - _initialState = _initialState.SetAvatarState( - _avatarAddress, - _avatarState, - false, - true, - false, - false); + _initialState = _initialState.SetAvatarState(_avatarAddress, _avatarState); } var action = new Sell @@ -387,8 +381,7 @@ public void Execute_Throw_InvalidItemTypeException() 10); _avatarState.inventory.AddItem(equipment); - _initialState = _initialState.SetAvatarState( - _avatarAddress, _avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(_avatarAddress, _avatarState); var action = new Sell { @@ -438,7 +431,7 @@ public void Execute_Throw_DuplicateOrderIdException() Assert.Single(shardedShopState.OrderDigestList); IWorld previousStates = _initialState - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetLegacyState(shardedShopAddress, shardedShopState.Serialize()); var action = new Sell diff --git a/.Lib9c.Tests/Action/Summon/AuraSummonTest.cs b/.Lib9c.Tests/Action/Summon/AuraSummonTest.cs index 1841d70e63..d8a70fd4ec 100644 --- a/.Lib9c.Tests/Action/Summon/AuraSummonTest.cs +++ b/.Lib9c.Tests/Action/Summon/AuraSummonTest.cs @@ -57,7 +57,7 @@ public AuraSummonTest() var context = new ActionContext(); _initialState = new World(new MockWorldState()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, _avatarState) .SetLegacyState(GoldCurrencyState.Address, gold.Serialize()) .MintAsset(context, GoldCurrencyState.Address, gold.Currency * 100000000000) .TransferAsset( @@ -209,7 +209,7 @@ Type expectedExc _avatarState.inventory.AddItem( ItemFactory.CreateItem(material, random), materialCount * _tableSheets.SummonSheet[groupId].CostMaterialCount); - state = state.SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, _avatarState); } var action = new AuraSummon( diff --git a/.Lib9c.Tests/Action/Summon/RuneSummonTest.cs b/.Lib9c.Tests/Action/Summon/RuneSummonTest.cs index 82bea26fa0..8dc111a3cd 100644 --- a/.Lib9c.Tests/Action/Summon/RuneSummonTest.cs +++ b/.Lib9c.Tests/Action/Summon/RuneSummonTest.cs @@ -57,7 +57,7 @@ public RuneSummonTest() var context = new ActionContext(); _initialState = new World(new MockWorldState()) .SetAgentState(_agentAddress, agentState) - .SetAvatarState(_avatarAddress, _avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, _avatarState) .SetLegacyState(GoldCurrencyState.Address, gold.Serialize()) .MintAsset(context, GoldCurrencyState.Address, gold.Currency * 100000000000) .MintAsset(context, _avatarAddress, 100 * Currencies.GetRune("RUNESTONE_FENRIR1")) @@ -131,7 +131,7 @@ Type expectedExc _avatarState.inventory.AddItem( ItemFactory.CreateItem(material, random), materialCount * _tableSheets.SummonSheet[groupId].CostMaterialCount); - state = state.SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, _avatarState); } var action = new RuneSummon diff --git a/.Lib9c.Tests/Action/UnlockEquipmentRecipe1Test.cs b/.Lib9c.Tests/Action/UnlockEquipmentRecipe1Test.cs index 792d388401..ab9c910537 100644 --- a/.Lib9c.Tests/Action/UnlockEquipmentRecipe1Test.cs +++ b/.Lib9c.Tests/Action/UnlockEquipmentRecipe1Test.cs @@ -130,7 +130,7 @@ Type exc state = state.SetLegacyState(unlockedRecipeIdsAddress, serializedIds); } - state = state.SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, _avatarState); } var action = new UnlockEquipmentRecipe1 diff --git a/.Lib9c.Tests/Action/UnlockEquipmentRecipeTest.cs b/.Lib9c.Tests/Action/UnlockEquipmentRecipeTest.cs index b9df75da54..f87805897d 100644 --- a/.Lib9c.Tests/Action/UnlockEquipmentRecipeTest.cs +++ b/.Lib9c.Tests/Action/UnlockEquipmentRecipeTest.cs @@ -141,7 +141,7 @@ Type exc } else { - state = state.SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, _avatarState); } } diff --git a/.Lib9c.Tests/Action/UnlockWorld1Test.cs b/.Lib9c.Tests/Action/UnlockWorld1Test.cs index 6ed6fd04ae..628bcc6bf0 100644 --- a/.Lib9c.Tests/Action/UnlockWorld1Test.cs +++ b/.Lib9c.Tests/Action/UnlockWorld1Test.cs @@ -120,7 +120,7 @@ Type exc } } - state = state.SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, _avatarState); } var unlockedWorldIdsAddress = _avatarAddress.Derive("world_ids"); diff --git a/.Lib9c.Tests/Action/UnlockWorldTest.cs b/.Lib9c.Tests/Action/UnlockWorldTest.cs index 8ea4cd7e6b..28d57e370a 100644 --- a/.Lib9c.Tests/Action/UnlockWorldTest.cs +++ b/.Lib9c.Tests/Action/UnlockWorldTest.cs @@ -122,7 +122,7 @@ Type exc } } - state = state.SetAvatarState(_avatarAddress, _avatarState, true, true, true, true); + state = state.SetAvatarState(_avatarAddress, _avatarState); } var unlockedWorldIdsAddress = _avatarAddress.Derive("world_ids"); diff --git a/.Lib9c.Tests/Action/UpdateSellTest.cs b/.Lib9c.Tests/Action/UpdateSellTest.cs index 19313df438..3791cc5f1e 100644 --- a/.Lib9c.Tests/Action/UpdateSellTest.cs +++ b/.Lib9c.Tests/Action/UpdateSellTest.cs @@ -198,7 +198,7 @@ bool fromPreviousAction } else { - prevState = prevState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + prevState = prevState.SetAvatarState(_avatarAddress, avatarState); } prevState = prevState @@ -296,7 +296,7 @@ public void Execute_Throw_NotEnoughClearedStageLevelException() ), }; - _initialState = _initialState.SetAvatarState(_avatarAddress, avatarState, true, true, true, true); + _initialState = _initialState.SetAvatarState(_avatarAddress, avatarState); var updateSellInfo = new UpdateSellInfo( default, @@ -334,7 +334,7 @@ public void Execute_Throw_InvalidPriceException() var digestListAddress = OrderDigestListState.DeriveAddress(_avatarAddress); var digestList = new OrderDigestListState(digestListAddress); _initialState = _initialState - .SetAvatarState(_avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(_avatarAddress, avatarState) .SetLegacyState(digestListAddress, digestList.Serialize()); var updateSellInfo = new UpdateSellInfo( diff --git a/.Lib9c.Tests/TestHelper/BlockChainHelper.cs b/.Lib9c.Tests/TestHelper/BlockChainHelper.cs index 015395f6c7..42a9b17e2f 100644 --- a/.Lib9c.Tests/TestHelper/BlockChainHelper.cs +++ b/.Lib9c.Tests/TestHelper/BlockChainHelper.cs @@ -145,7 +145,7 @@ public static MakeInitialStateResult MakeInitialState() initialState = initialState .SetLegacyState(GoldCurrencyState.Address, goldCurrencyState.Serialize()) .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(Addresses.Shop, new ShopState().Serialize()) .MintAsset(context, GoldCurrencyState.Address, initCurrencyGold) .TransferAsset(context, Addresses.GoldCurrency, agentAddress, agentCurrencyGold); diff --git a/.Lib9c.Tests/Util/CraftUtil.cs b/.Lib9c.Tests/Util/CraftUtil.cs index aec802015d..7877167847 100644 --- a/.Lib9c.Tests/Util/CraftUtil.cs +++ b/.Lib9c.Tests/Util/CraftUtil.cs @@ -53,8 +53,7 @@ IRandom random avatarState.inventory.AddItem(materialItem, material.Count); } - return state.SetAvatarState( - avatarAddress, avatarState, false, true, false, false); + return state.SetAvatarState(avatarAddress, avatarState); } public static IWorld UnlockStage( @@ -70,8 +69,7 @@ int stage tableSheets.WorldSheet, Math.Max(stage, GameConfig.RequireClearedStageLevel.ItemEnhancementAction) ); - return state.SetAvatarState( - avatarAddress, avatarState, false, false, true, false); + return state.SetAvatarState(avatarAddress, avatarState); } } } diff --git a/.Lib9c.Tests/Util/QuestUtil.cs b/.Lib9c.Tests/Util/QuestUtil.cs index 640a8ae907..c7f16f6532 100644 --- a/.Lib9c.Tests/Util/QuestUtil.cs +++ b/.Lib9c.Tests/Util/QuestUtil.cs @@ -25,8 +25,8 @@ Address avatarAddress var avatarState2 = stateV2.GetAvatarState(avatarAddress); avatarState1.questList = emptyQuestList; avatarState2.questList = emptyQuestList; - var newStateV1 = stateV1.SetAvatarState(avatarAddress, avatarState1, false, false, false, true); - var newStateV2 = stateV2.SetAvatarState(avatarAddress, avatarState2, false, false, false, true); + var newStateV1 = stateV1.SetAvatarState(avatarAddress, avatarState1); + var newStateV2 = stateV2.SetAvatarState(avatarAddress, avatarState2); return (newStateV1, newStateV2); } } diff --git a/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs b/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs index f9d685f776..66c8024dcc 100644 --- a/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs +++ b/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs @@ -60,7 +60,7 @@ public override IWorld Execute(IActionContext context) states.GetSheet(), targetStage ); - return states.SetAvatarState(AvatarAddress, avatarState, false, false, true, false); + return states.SetAvatarState(AvatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => diff --git a/Lib9c.DevExtensions/Action/CreateArenaDummy.cs b/Lib9c.DevExtensions/Action/CreateArenaDummy.cs index 9d250e8a96..8e85d7892f 100644 --- a/Lib9c.DevExtensions/Action/CreateArenaDummy.cs +++ b/Lib9c.DevExtensions/Action/CreateArenaDummy.cs @@ -126,7 +126,7 @@ public override IWorld Execute(IActionContext context) // join arena states = states .SetAgentState(agentAddress, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); var sheet = sheets.GetSheet(); diff --git a/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs b/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs index 0eeda3cdd7..bae6d208ad 100644 --- a/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs +++ b/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs @@ -558,8 +558,8 @@ public IWorld Execute( } // ~Set Inventory. - states = states.SetAvatarState(avatarAddr, avatar, true, true, true, true); - + states = states.SetAvatarState(avatarAddr, avatar); + // Set CombinationSlot. for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) { diff --git a/Lib9c.DevExtensions/Action/CreateTestbed.cs b/Lib9c.DevExtensions/Action/CreateTestbed.cs index 60e4ae72d0..71c327bace 100644 --- a/Lib9c.DevExtensions/Action/CreateTestbed.cs +++ b/Lib9c.DevExtensions/Action/CreateTestbed.cs @@ -153,7 +153,7 @@ public override IWorld Execute(IActionContext context) states = states .SetAgentState(agentAddress, agentState) .SetLegacyState(Addresses.Ranking, rankingState.Serialize()) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); // ~Create Agent and avatar && ~Add item // for sell @@ -194,7 +194,7 @@ public override IWorld Execute(IActionContext context) orderReceiptList.Add(orderDigest); states = states.SetLegacyState(orderReceiptAddress, orderReceiptList.Serialize()) - .SetAvatarState(avatarAddress, avatarState, true, true, false, false) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(itemAddress, tradableItem.Serialize()) .SetLegacyState(orderAddress, order.Serialize()) .SetLegacyState(shopAddress, shardedShopState.Serialize()); diff --git a/Lib9c.DevExtensions/Action/Stage/ClearStage.cs b/Lib9c.DevExtensions/Action/Stage/ClearStage.cs index 37160948bb..c837391e37 100644 --- a/Lib9c.DevExtensions/Action/Stage/ClearStage.cs +++ b/Lib9c.DevExtensions/Action/Stage/ClearStage.cs @@ -30,7 +30,7 @@ public override IWorld Execute(IActionContext context) states.GetSheet(), TargetStage ); - return states.SetAvatarState(AvatarAddress, avatarState, false, false, true, false); + return states.SetAvatarState(AvatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => diff --git a/Lib9c/Action/AuraSummon.cs b/Lib9c/Action/AuraSummon.cs index 3ae368769f..a0843b74ce 100644 --- a/Lib9c/Action/AuraSummon.cs +++ b/Lib9c/Action/AuraSummon.cs @@ -265,7 +265,7 @@ public override IWorld Execute(IActionContext context) // Set states return states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, true) + .SetAvatarState(AvatarAddress, avatarState) .SetAgentState(context.Signer, agentState); } diff --git a/Lib9c/Action/BattleArena.cs b/Lib9c/Action/BattleArena.cs index 832f82adcd..b3a3ca6dba 100644 --- a/Lib9c/Action/BattleArena.cs +++ b/Lib9c/Action/BattleArena.cs @@ -432,7 +432,7 @@ public override IWorld Execute(IActionContext context) .SetLegacyState(myArenaScoreAdr, myArenaScore.Serialize()) .SetLegacyState(enemyArenaScoreAdr, enemyArenaScore.Serialize()) .SetLegacyState(arenaInformationAdr, arenaInformation.Serialize()) - .SetAvatarState(myAvatarAddress, avatarState, false, true, false, false); + .SetAvatarState(myAvatarAddress, avatarState); } private void ValidateTicket() diff --git a/Lib9c/Action/Buy.cs b/Lib9c/Action/Buy.cs index d5635f3f29..babdc14a3d 100644 --- a/Lib9c/Action/Buy.cs +++ b/Lib9c/Action/Buy.cs @@ -268,7 +268,7 @@ public override IWorld Execute(IActionContext context) states = states .SetLegacyState(digestListAddress, digestList.Serialize()) .SetLegacyState(orderReceiptAddress, orderReceipt.Serialize()) - .SetAvatarState(sellerAvatarAddress, sellerAvatarState, true, true, true, true); + .SetAvatarState(sellerAvatarAddress, sellerAvatarState); sw.Stop(); Log.Verbose("{AddressesHex}Buy Set Seller AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); @@ -280,8 +280,7 @@ public override IWorld Execute(IActionContext context) buyerAvatarState.updatedAt = ctx.BlockIndex; buyerAvatarState.blockIndex = ctx.BlockIndex; - states = states.SetAvatarState( - buyerAvatarAddress, buyerAvatarState, true, true, true, true); + states = states.SetAvatarState(buyerAvatarAddress, buyerAvatarState); sw.Stop(); Log.Verbose("{AddressesHex}Buy Set Buyer AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); diff --git a/Lib9c/Action/Buy7.cs b/Lib9c/Action/Buy7.cs index c05b56937a..7c22fba70b 100644 --- a/Lib9c/Action/Buy7.cs +++ b/Lib9c/Action/Buy7.cs @@ -452,8 +452,7 @@ public override IWorld Execute(IActionContext context) buyerAvatarState.UpdateQuestRewards2(materialSheet); sellerAvatarState.UpdateQuestRewards2(materialSheet); - states = states.SetAvatarState( - sellerAvatarAddress, sellerAvatarState, true, true, true, true); + states = states.SetAvatarState(sellerAvatarAddress, sellerAvatarState); sw.Stop(); Log.Verbose("{AddressesHex}Buy Set Seller AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); @@ -468,7 +467,7 @@ public override IWorld Execute(IActionContext context) buyerAvatarState.updatedAt = ctx.BlockIndex; buyerAvatarState.blockIndex = ctx.BlockIndex; - states = states.SetAvatarState(buyerAvatarAddress, buyerAvatarState, true, true, true, true); + states = states.SetAvatarState(buyerAvatarAddress, buyerAvatarState); sw.Stop(); Log.Verbose("{AddressesHex}Buy Set Buyer AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); diff --git a/Lib9c/Action/BuyMultiple.cs b/Lib9c/Action/BuyMultiple.cs index 6ded249c1c..eb2f1bab75 100644 --- a/Lib9c/Action/BuyMultiple.cs +++ b/Lib9c/Action/BuyMultiple.cs @@ -401,7 +401,7 @@ public override IWorld Execute(IActionContext context) sellerAvatarState.UpdateQuestRewards2(materialSheet); sw.Restart(); - states = states.SetAvatarState(productInfo.sellerAvatarAddress, sellerAvatarState, true, true, true, true); + states = states.SetAvatarState(productInfo.sellerAvatarAddress, sellerAvatarState); sw.Stop(); Log.Verbose("{AddressesHex}BuyMultiple Set Seller AvatarState: {Elapsed}", addressesHex, sw.Elapsed); } @@ -415,7 +415,7 @@ public override IWorld Execute(IActionContext context) buyerAvatarState.UpdateQuestRewards2(materialSheet); sw.Restart(); - states = states.SetAvatarState(buyerAvatarAddress, buyerAvatarState, true, true, true, true); + states = states.SetAvatarState(buyerAvatarAddress, buyerAvatarState); sw.Stop(); Log.Verbose("{AddressesHex}BuyMultiple Set Buyer AvatarState: {Elapsed}", addressesHex, sw.Elapsed); diff --git a/Lib9c/Action/BuyProduct.cs b/Lib9c/Action/BuyProduct.cs index eb7f3be8fd..4fec7703af 100644 --- a/Lib9c/Action/BuyProduct.cs +++ b/Lib9c/Action/BuyProduct.cs @@ -91,7 +91,7 @@ public override IWorld Execute(IActionContext context) } } - states = states.SetAvatarState(AvatarAddress, buyerAvatarState, true, true, false, false); + states = states.SetAvatarState(AvatarAddress, buyerAvatarState); var ended = DateTimeOffset.UtcNow; Log.Debug("BuyProduct Total Executed Time: {Elapsed}", ended - started); @@ -180,7 +180,7 @@ private IWorld Buy(IActionContext context, IProductInfo productInfo, Address sel states = states .SetLegacyState(productAddress, Null.Value) .SetLegacyState(productsStateAddress, productsState.Serialize()) - .SetAvatarState(sellerAvatarAddress, sellerAvatarState, true, false, false, true) + .SetAvatarState(sellerAvatarAddress, sellerAvatarState) .SetLegacyState(ProductReceipt.DeriveAddress(productId), receipt.Serialize()) .TransferAsset(context, context.Signer, feeStoreAddress, tax) .TransferAsset(context, context.Signer, sellerAgentAddress, taxedPrice); @@ -319,7 +319,7 @@ private static IWorld Buy_Order(PurchaseInfo purchaseInfo, IActionContext contex states = states .SetLegacyState(digestListAddress, digestList.Serialize()) .SetLegacyState(orderReceiptAddress, orderReceipt.Serialize()) - .SetAvatarState(sellerAvatarAddress, sellerAvatarState, true, true, true, true); + .SetAvatarState(sellerAvatarAddress, sellerAvatarState); states = states.SetLegacyState(shardedShopAddress, shardedShopState.Serialize()); return states; } diff --git a/Lib9c/Action/BuyProduct0.cs b/Lib9c/Action/BuyProduct0.cs index dfcdb85ef1..018282f354 100644 --- a/Lib9c/Action/BuyProduct0.cs +++ b/Lib9c/Action/BuyProduct0.cs @@ -101,7 +101,7 @@ public override IWorld Execute(IActionContext context) } } - states = states.SetAvatarState(AvatarAddress, buyerAvatarState, true, true, false, false); + states = states.SetAvatarState(AvatarAddress, buyerAvatarState); var ended = DateTimeOffset.UtcNow; Log.Debug("BuyProduct Total Executed Time: {Elapsed}", ended - started); diff --git a/Lib9c/Action/BuyProduct2.cs b/Lib9c/Action/BuyProduct2.cs index a73bbc3903..57b7b2168f 100644 --- a/Lib9c/Action/BuyProduct2.cs +++ b/Lib9c/Action/BuyProduct2.cs @@ -101,7 +101,7 @@ public override IWorld Execute(IActionContext context) } } - states = states.SetAvatarState(AvatarAddress, buyerAvatarState, true, true, false, false); + states = states.SetAvatarState(AvatarAddress, buyerAvatarState); var ended = DateTimeOffset.UtcNow; Log.Debug("BuyProduct Total Executed Time: {Elapsed}", ended - started); @@ -190,7 +190,7 @@ private IWorld Buy(IActionContext context, IProductInfo productInfo, Address sel states = states .SetLegacyState(productAddress, Null.Value) .SetLegacyState(productsStateAddress, productsState.Serialize()) - .SetAvatarState(sellerAvatarAddress, sellerAvatarState, true, false, false, true) + .SetAvatarState(sellerAvatarAddress, sellerAvatarState) .SetLegacyState(ProductReceipt.DeriveAddress(productId), receipt.Serialize()) .TransferAsset(context, context.Signer, feeStoreAddress, tax) .TransferAsset(context, context.Signer, sellerAgentAddress, taxedPrice); @@ -329,7 +329,7 @@ private static IWorld Buy_Order(PurchaseInfo purchaseInfo, IActionContext contex states = states .SetLegacyState(digestListAddress, digestList.Serialize()) .SetLegacyState(orderReceiptAddress, orderReceipt.Serialize()) - .SetAvatarState(sellerAvatarAddress, sellerAvatarState, true, true, true, true); + .SetAvatarState(sellerAvatarAddress, sellerAvatarState); states = states.SetLegacyState(shardedShopAddress, shardedShopState.Serialize()); return states; } diff --git a/Lib9c/Action/CancelProductRegistration.cs b/Lib9c/Action/CancelProductRegistration.cs index 2ac39c809f..5f3ba57b24 100644 --- a/Lib9c/Action/CancelProductRegistration.cs +++ b/Lib9c/Action/CancelProductRegistration.cs @@ -116,7 +116,7 @@ public override IWorld Execute(IActionContext context) } states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(productsStateAddress, productsState.Serialize()); return states; diff --git a/Lib9c/Action/CancelProductRegistration0.cs b/Lib9c/Action/CancelProductRegistration0.cs index 7a0abe3791..a7472bdbb8 100644 --- a/Lib9c/Action/CancelProductRegistration0.cs +++ b/Lib9c/Action/CancelProductRegistration0.cs @@ -125,7 +125,7 @@ public override IWorld Execute(IActionContext context) } states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(productsStateAddress, productsState.Serialize()); return states; diff --git a/Lib9c/Action/ChargeActionPoint.cs b/Lib9c/Action/ChargeActionPoint.cs index d3f7cb3afc..51f28ddde6 100644 --- a/Lib9c/Action/ChargeActionPoint.cs +++ b/Lib9c/Action/ChargeActionPoint.cs @@ -67,7 +67,7 @@ public override IWorld Execute(IActionContext context) avatarState.actionPoint = gameConfigState.ActionPointMax; var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}ChargeActionPoint Total Executed Time: {Elapsed}", addressesHex, ended - started); - return states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + return states.SetAvatarState(avatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => diff --git a/Lib9c/Action/ChargeActionPoint0.cs b/Lib9c/Action/ChargeActionPoint0.cs index adb72857c5..0e17e3941a 100644 --- a/Lib9c/Action/ChargeActionPoint0.cs +++ b/Lib9c/Action/ChargeActionPoint0.cs @@ -58,7 +58,7 @@ public override IWorld Execute(IActionContext context) } avatarState.actionPoint = gameConfigState.ActionPointMax; - return states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + return states.SetAvatarState(avatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => diff --git a/Lib9c/Action/ChargeActionPoint2.cs b/Lib9c/Action/ChargeActionPoint2.cs index 1f62c60de6..15772fd1bb 100644 --- a/Lib9c/Action/ChargeActionPoint2.cs +++ b/Lib9c/Action/ChargeActionPoint2.cs @@ -53,7 +53,7 @@ public override IWorld Execute(IActionContext context) } avatarState.actionPoint = gameConfigState.ActionPointMax; - return states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + return states.SetAvatarState(avatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => diff --git a/Lib9c/Action/ClaimItems.cs b/Lib9c/Action/ClaimItems.cs index 8cff45b2a4..6ad0324f8b 100644 --- a/Lib9c/Action/ClaimItems.cs +++ b/Lib9c/Action/ClaimItems.cs @@ -160,7 +160,7 @@ public override IWorld Execute(IActionContext context) mailBox.Add(mail); mailBox.CleanUp(); avatarState.mailBox = mailBox; - states = states.SetAvatarState(avatarAddress, avatarState, true, true, false, false); + states = states.SetAvatarState(avatarAddress, avatarState); } return states; diff --git a/Lib9c/Action/ClaimStakeReward.cs b/Lib9c/Action/ClaimStakeReward.cs index 68972f2b57..b9fbe6d963 100644 --- a/Lib9c/Action/ClaimStakeReward.cs +++ b/Lib9c/Action/ClaimStakeReward.cs @@ -157,7 +157,7 @@ public override IWorld Execute(IActionContext context) return states .SetLegacyState(stakeStateAddr, stakeStateV2.Serialize()) - .SetAvatarState(AvatarAddress, avatarState, false, true, false, false); + .SetAvatarState(AvatarAddress, avatarState); } } } diff --git a/Lib9c/Action/CombinationConsumable.cs b/Lib9c/Action/CombinationConsumable.cs index 32622c4e07..a2cc2a9766 100644 --- a/Lib9c/Action/CombinationConsumable.cs +++ b/Lib9c/Action/CombinationConsumable.cs @@ -214,7 +214,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}Combination Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(slotAddress, slotState.Serialize()); } } diff --git a/Lib9c/Action/CombinationConsumable5.cs b/Lib9c/Action/CombinationConsumable5.cs index 708a27d978..dd6da043f6 100644 --- a/Lib9c/Action/CombinationConsumable5.cs +++ b/Lib9c/Action/CombinationConsumable5.cs @@ -246,7 +246,7 @@ public override IWorld Execute(IActionContext context) avatarState.updatedAt = ctx.BlockIndex; avatarState.blockIndex = ctx.BlockIndex; - states = states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(AvatarAddress, avatarState); slotState.Update(result, ctx.BlockIndex, requiredBlockIndex); sw.Stop(); Log.Verbose("{AddressesHex}Combination Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); diff --git a/Lib9c/Action/CombinationEquipment.cs b/Lib9c/Action/CombinationEquipment.cs index dadb33ea72..a2a1bde18d 100644 --- a/Lib9c/Action/CombinationEquipment.cs +++ b/Lib9c/Action/CombinationEquipment.cs @@ -499,7 +499,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}CombinationEquipment Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(slotAddress, slotState.Serialize()) .SetLegacyState(hammerPointAddress,hammerPointState.Serialize()) .SetAgentState(context.Signer, agentState); diff --git a/Lib9c/Action/CombinationEquipment16.cs b/Lib9c/Action/CombinationEquipment16.cs index 5cccbad657..72949aa1a1 100644 --- a/Lib9c/Action/CombinationEquipment16.cs +++ b/Lib9c/Action/CombinationEquipment16.cs @@ -512,7 +512,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}CombinationEquipment Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(slotAddress, slotState.Serialize()) .SetLegacyState(hammerPointAddress,hammerPointState.Serialize()) .SetAgentState(context.Signer, agentState); diff --git a/Lib9c/Action/CombinationEquipment5.cs b/Lib9c/Action/CombinationEquipment5.cs index 9ca2f89cc2..c4e4b3bf8f 100644 --- a/Lib9c/Action/CombinationEquipment5.cs +++ b/Lib9c/Action/CombinationEquipment5.cs @@ -234,7 +234,7 @@ public override IWorld Execute(IActionContext context) avatarState.UpdateFromCombination2(equipment); avatarState.UpdateQuestRewards2(materialSheet); return states - .SetAvatarState(AvatarAddress, avatarState, true, true, true, true) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(slotAddress, slotState.Serialize()) .SetAgentState(ctx.Signer, agentState); } diff --git a/Lib9c/Action/Coupons/RedeemCoupon.cs b/Lib9c/Action/Coupons/RedeemCoupon.cs index eb581868df..53d5177663 100644 --- a/Lib9c/Action/Coupons/RedeemCoupon.cs +++ b/Lib9c/Action/Coupons/RedeemCoupon.cs @@ -63,7 +63,7 @@ public override IWorld Execute(IActionContext context) } return states - .SetAvatarState(AvatarAddress, avatarState, true, true, true, true) + .SetAvatarState(AvatarAddress, avatarState) .SetCouponWallet(context.Signer, wallet); } diff --git a/Lib9c/Action/CreateAvatar.cs b/Lib9c/Action/CreateAvatar.cs index 178d9ec0f0..be34d1f3f2 100644 --- a/Lib9c/Action/CreateAvatar.cs +++ b/Lib9c/Action/CreateAvatar.cs @@ -235,7 +235,7 @@ public override IWorld Execute(IActionContext context) Log.Debug("{AddressesHex}CreateAvatar Total Executed Time: {Elapsed}", addressesHex, ended - started); return states .SetAgentState(signer, agentState) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); } public static void AddItem(ItemSheet itemSheet, CreateAvatarItemSheet createAvatarItemSheet, diff --git a/Lib9c/Action/CreateAvatar0.cs b/Lib9c/Action/CreateAvatar0.cs index 30bb7f3ba7..8b84c3c25d 100644 --- a/Lib9c/Action/CreateAvatar0.cs +++ b/Lib9c/Action/CreateAvatar0.cs @@ -151,7 +151,7 @@ public override IWorld Execute(IActionContext context) return states .SetAgentState(ctx.Signer, agentState) .SetLegacyState(Addresses.Ranking, rankingState.Serialize()) - .SetAvatarState(avatarAddress, avatarState, false, false, false, false); + .SetAvatarState(avatarAddress, avatarState); } public static AvatarState CreateAvatarState(string name, diff --git a/Lib9c/Action/DailyReward.cs b/Lib9c/Action/DailyReward.cs index 3a197f8d9b..34a8993306 100644 --- a/Lib9c/Action/DailyReward.cs +++ b/Lib9c/Action/DailyReward.cs @@ -71,7 +71,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}DailyReward Total Executed Time: {Elapsed}", addressesHex, ended - started); - return states.SetAvatarState(avatarAddress, avatarState, true, false, false, false); + return states.SetAvatarState(avatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => new Dictionary diff --git a/Lib9c/Action/DailyReward2.cs b/Lib9c/Action/DailyReward2.cs index 98b8554154..cc95089a30 100644 --- a/Lib9c/Action/DailyReward2.cs +++ b/Lib9c/Action/DailyReward2.cs @@ -81,7 +81,7 @@ public override IWorld Execute(IActionContext context) dailyRewardResult = result; avatarState.Update(mail); avatarState.UpdateFromAddItem2(material, rewardItemCount, false); - return states.SetAvatarState(avatarAddress, avatarState, true, false, false, false); + return states.SetAvatarState(avatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => new Dictionary diff --git a/Lib9c/Action/EventConsumableItemCrafts.cs b/Lib9c/Action/EventConsumableItemCrafts.cs index 3da6059a80..1b2992a97e 100644 --- a/Lib9c/Action/EventConsumableItemCrafts.cs +++ b/Lib9c/Action/EventConsumableItemCrafts.cs @@ -267,7 +267,7 @@ public override IWorld Execute(IActionContext context) // ~Create Mail states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState( CombinationSlotState.DeriveAddress(AvatarAddress, SlotIndex), slotState.Serialize()); diff --git a/Lib9c/Action/EventConsumableItemCrafts0.cs b/Lib9c/Action/EventConsumableItemCrafts0.cs index 03a699ad21..1b7391781b 100644 --- a/Lib9c/Action/EventConsumableItemCrafts0.cs +++ b/Lib9c/Action/EventConsumableItemCrafts0.cs @@ -280,7 +280,7 @@ public override IWorld Execute(IActionContext context) // Set states states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState( CombinationSlotState.DeriveAddress(AvatarAddress, SlotIndex), slotState.Serialize()); diff --git a/Lib9c/Action/EventDungeonBattle.cs b/Lib9c/Action/EventDungeonBattle.cs index a6fa4b1bc1..bc5ffd37e3 100644 --- a/Lib9c/Action/EventDungeonBattle.cs +++ b/Lib9c/Action/EventDungeonBattle.cs @@ -385,7 +385,7 @@ is Bencodex.Types.List serializedEventDungeonInfoList // Set states sw.Restart(); states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(eventDungeonInfoAddr, eventDungeonInfo.Serialize()); sw.Stop(); diff --git a/Lib9c/Action/EventMaterialItemCrafts.cs b/Lib9c/Action/EventMaterialItemCrafts.cs index ea95e735ac..0688ab9361 100644 --- a/Lib9c/Action/EventMaterialItemCrafts.cs +++ b/Lib9c/Action/EventMaterialItemCrafts.cs @@ -226,7 +226,7 @@ public override IWorld Execute(IActionContext context) // Set states sw.Restart(); - states = states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(AvatarAddress, avatarState); sw.Stop(); Log.Verbose( "[{ActionTypeString}][{AddressesHex}] Set states: {Elapsed}", diff --git a/Lib9c/Action/EventMaterialItemCrafts0.cs b/Lib9c/Action/EventMaterialItemCrafts0.cs index b76571933a..7ded80a1f6 100644 --- a/Lib9c/Action/EventMaterialItemCrafts0.cs +++ b/Lib9c/Action/EventMaterialItemCrafts0.cs @@ -240,7 +240,7 @@ public override IWorld Execute(IActionContext context) // Set states sw.Restart(); states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + .SetAvatarState(AvatarAddress, avatarState); sw.Stop(); Log.Verbose( "[{ActionTypeString}][{AddressesHex}] Set states: {Elapsed}", diff --git a/Lib9c/Action/Garages/BulkUnloadFromGarages.cs b/Lib9c/Action/Garages/BulkUnloadFromGarages.cs index 3edfd24d40..b2a080b061 100644 --- a/Lib9c/Action/Garages/BulkUnloadFromGarages.cs +++ b/Lib9c/Action/Garages/BulkUnloadFromGarages.cs @@ -200,7 +200,7 @@ private IWorld TransferFungibleItems( states = states.SetLegacyState(garageAddress, garage.Serialize()); } - return states.SetAvatarState(recipientAvatarAddress, avatarState, false, true, false, false); + return states.SetAvatarState(recipientAvatarAddress, avatarState); } private IWorld BulkSendMail( @@ -234,7 +234,7 @@ private IWorld BulkSendMail( mailBox.CleanUp(); avatarState.mailBox = mailBox; - return states.SetAvatarState(recipientAvatarAddress, avatarState, true, false, false, false); + return states.SetAvatarState(recipientAvatarAddress, avatarState); } return states; diff --git a/Lib9c/Action/Garages/LoadIntoMyGarages.cs b/Lib9c/Action/Garages/LoadIntoMyGarages.cs index 945adcb82d..70f0319524 100644 --- a/Lib9c/Action/Garages/LoadIntoMyGarages.cs +++ b/Lib9c/Action/Garages/LoadIntoMyGarages.cs @@ -297,7 +297,7 @@ private IWorld TransferFungibleItems( states = states.SetLegacyState(garageAddr, garage.Serialize()); } - return states.SetAvatarState(AvatarAddr.Value, avatarState, true, true, true, true); + return states.SetAvatarState(AvatarAddr.Value, avatarState); } } } diff --git a/Lib9c/Action/Garages/UnloadFromMyGarages.cs b/Lib9c/Action/Garages/UnloadFromMyGarages.cs index 6980a6617d..6f9ede2c2c 100644 --- a/Lib9c/Action/Garages/UnloadFromMyGarages.cs +++ b/Lib9c/Action/Garages/UnloadFromMyGarages.cs @@ -207,7 +207,7 @@ private IWorld TransferFungibleItems( states = states.SetLegacyState(garageAddr, garage.Serialize()); } - return states.SetAvatarState(RecipientAvatarAddr, avatarState, false, true, false, false); + return states.SetAvatarState(RecipientAvatarAddr, avatarState); } private IWorld SendMail( @@ -225,7 +225,7 @@ private IWorld SendMail( FungibleIdAndCounts, Memo)); avatarState.mailBox.CleanUp(); - return states.SetAvatarState(RecipientAvatarAddr, avatarState, true, false, false, false); + return states.SetAvatarState(RecipientAvatarAddr, avatarState); } } } diff --git a/Lib9c/Action/Grinding.cs b/Lib9c/Action/Grinding.cs index 17b600cb07..2ade7a4e31 100644 --- a/Lib9c/Action/Grinding.cs +++ b/Lib9c/Action/Grinding.cs @@ -148,7 +148,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}Grinding Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .MintAsset(context, context.Signer, crystal); } diff --git a/Lib9c/Action/Grinding0.cs b/Lib9c/Action/Grinding0.cs index ff3ef6729c..e048888820 100644 --- a/Lib9c/Action/Grinding0.cs +++ b/Lib9c/Action/Grinding0.cs @@ -147,7 +147,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}Grinding Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .MintAsset(context, context.Signer, crystal); } diff --git a/Lib9c/Action/HackAndSlash.cs b/Lib9c/Action/HackAndSlash.cs index 2c5c266e32..7111005595 100644 --- a/Lib9c/Action/HackAndSlash.cs +++ b/Lib9c/Action/HackAndSlash.cs @@ -577,7 +577,7 @@ public IWorld Execute( states = states.SetLegacyState(skillStateAddress, skillState.Serialize()); } - states = states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(AvatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex} {Source} HAS {Process} from #{BlockIndex}: {Elapsed}", diff --git a/Lib9c/Action/HackAndSlash3.cs b/Lib9c/Action/HackAndSlash3.cs index f4995d7469..bf122cd283 100644 --- a/Lib9c/Action/HackAndSlash3.cs +++ b/Lib9c/Action/HackAndSlash3.cs @@ -227,7 +227,7 @@ public override IWorld Execute(IActionContext context) avatarState.updatedAt = ctx.BlockIndex; avatarState.mailBox.CleanUpV1(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}HAS Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); diff --git a/Lib9c/Action/HackAndSlashSweep.cs b/Lib9c/Action/HackAndSlashSweep.cs index b5409a377f..55358e24ec 100644 --- a/Lib9c/Action/HackAndSlashSweep.cs +++ b/Lib9c/Action/HackAndSlashSweep.cs @@ -324,7 +324,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}HackAndSlashSweep Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(avatarAddress, avatarState, true, true, false, true); + .SetAvatarState(avatarAddress, avatarState); } public static List GetRewardItems(IRandom random, diff --git a/Lib9c/Action/ItemEnhancement.cs b/Lib9c/Action/ItemEnhancement.cs index 3b5032bce2..6566ad792a 100644 --- a/Lib9c/Action/ItemEnhancement.cs +++ b/Lib9c/Action/ItemEnhancement.cs @@ -360,7 +360,7 @@ public override IWorld Execute(IActionContext context) // Set state sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex} ItemEnhancement Set AvatarState: {Elapsed}", addressesHex, diff --git a/Lib9c/Action/ItemEnhancement10.cs b/Lib9c/Action/ItemEnhancement10.cs index 5c3c988f59..0b507360cf 100644 --- a/Lib9c/Action/ItemEnhancement10.cs +++ b/Lib9c/Action/ItemEnhancement10.cs @@ -336,7 +336,7 @@ public override IWorld Execute(IActionContext context) // Set state sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}ItemEnhancement Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); var ended = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/ItemEnhancement11.cs b/Lib9c/Action/ItemEnhancement11.cs index ca785b63de..8070e8c143 100644 --- a/Lib9c/Action/ItemEnhancement11.cs +++ b/Lib9c/Action/ItemEnhancement11.cs @@ -376,7 +376,7 @@ public override IWorld Execute(IActionContext context) // Set state sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}ItemEnhancement Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); var ended = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/ItemEnhancement12.cs b/Lib9c/Action/ItemEnhancement12.cs index f6a3145cc0..75efd4bd2c 100644 --- a/Lib9c/Action/ItemEnhancement12.cs +++ b/Lib9c/Action/ItemEnhancement12.cs @@ -414,7 +414,7 @@ public override IWorld Execute(IActionContext context) // Set state sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex} ItemEnhancement Set AvatarState: {Elapsed}", addressesHex, diff --git a/Lib9c/Action/ItemEnhancement13.cs b/Lib9c/Action/ItemEnhancement13.cs index e51e9cb6fe..557a6eeede 100644 --- a/Lib9c/Action/ItemEnhancement13.cs +++ b/Lib9c/Action/ItemEnhancement13.cs @@ -414,7 +414,7 @@ public override IWorld Execute(IActionContext context) // Set state sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex} ItemEnhancement Set AvatarState: {Elapsed}", addressesHex, diff --git a/Lib9c/Action/ItemEnhancement7.cs b/Lib9c/Action/ItemEnhancement7.cs index 3755b3ed59..6eac5bc942 100644 --- a/Lib9c/Action/ItemEnhancement7.cs +++ b/Lib9c/Action/ItemEnhancement7.cs @@ -275,7 +275,7 @@ public override IWorld Execute(IActionContext context) sw.Stop(); Log.Verbose("{AddressesHex}ItemEnhancement Update AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}ItemEnhancement Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); var ended = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/ItemEnhancement9.cs b/Lib9c/Action/ItemEnhancement9.cs index f813d77898..a592a54f48 100644 --- a/Lib9c/Action/ItemEnhancement9.cs +++ b/Lib9c/Action/ItemEnhancement9.cs @@ -319,7 +319,7 @@ public override IWorld Execute(IActionContext context) // Set state sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}ItemEnhancement Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); var ended = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/MigrateMonsterCollection.cs b/Lib9c/Action/MigrateMonsterCollection.cs index fc24a99da7..9f6f8e60f8 100644 --- a/Lib9c/Action/MigrateMonsterCollection.cs +++ b/Lib9c/Action/MigrateMonsterCollection.cs @@ -152,7 +152,7 @@ private static IWorld ClaimMonsterCollectionReward(IActionContext context, Addre var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}ClaimMonsterCollection Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(collectionAddress, monsterCollectionState.Serialize()); } } diff --git a/Lib9c/Action/MintAssets.cs b/Lib9c/Action/MintAssets.cs index 0b0aa1ea8d..2e1d30f863 100644 --- a/Lib9c/Action/MintAssets.cs +++ b/Lib9c/Action/MintAssets.cs @@ -100,7 +100,7 @@ public override IWorld Execute(IActionContext context) } } - state = state.SetAvatarState(recipient, recipientAvatarState, false, true, false, false); + state = state.SetAvatarState(recipient, recipientAvatarState); fivs.Add(itemsNotNull); } else @@ -135,7 +135,7 @@ public override IWorld Execute(IActionContext context) ) ); recipientAvatarState.mailBox.CleanUp(); - state = state.SetAvatarState(recipient, recipientAvatarState, true, false, false, false); + state = state.SetAvatarState(recipient, recipientAvatarState); } } diff --git a/Lib9c/Action/Raid.cs b/Lib9c/Action/Raid.cs index bb7eea941c..1987b83cfe 100644 --- a/Lib9c/Action/Raid.cs +++ b/Lib9c/Action/Raid.cs @@ -323,7 +323,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressHex}Raid Total Executed Time: {Elapsed}", addressHex, ended - started); return states - .SetAvatarState(AvatarAddress, avatarState, false, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(worldBossAddress, bossState.Serialize()) .SetLegacyState(raiderAddress, raiderState.Serialize()); } diff --git a/Lib9c/Action/RankingBattle.cs b/Lib9c/Action/RankingBattle.cs index 53ebd44500..56272890ba 100644 --- a/Lib9c/Action/RankingBattle.cs +++ b/Lib9c/Action/RankingBattle.cs @@ -246,7 +246,7 @@ public override IWorld Execute(IActionContext context) sw.Restart(); states = states - .SetAvatarState(avatarAddress, avatarState, false, true, false, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(arenaInfoAddress, arenaInfo.Serialize()) .SetLegacyState(enemyArenaInfoAddress, enemyArenaInfo.Serialize()); diff --git a/Lib9c/Action/RankingBattle11.cs b/Lib9c/Action/RankingBattle11.cs index 9dbff0f4a1..3fb8a58151 100644 --- a/Lib9c/Action/RankingBattle11.cs +++ b/Lib9c/Action/RankingBattle11.cs @@ -259,7 +259,7 @@ public override IWorld Execute(IActionContext context) sw.Restart(); states = states - .SetAvatarState(avatarAddress, avatarState, false, true, false, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(arenaInfoAddress, arenaInfo.Serialize()) .SetLegacyState(enemyInfoAddress, enemyInfo.Serialize()); @@ -425,7 +425,7 @@ private IWorld BackwardCompatibleExecute(Dictionary rawWeeklyArenaState, Diction Log.Verbose("{AddressesHex}RankingBattle Serialize WeeklyArenaState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); - states = states.SetAvatarState(avatarAddress, avatarState, false, true, false, true); + states = states.SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}RankingBattle Serialize AvatarState: {Elapsed}", addressesHex, sw.Elapsed); diff --git a/Lib9c/Action/RapidCombination.cs b/Lib9c/Action/RapidCombination.cs index d9e9ece96d..52413ea5d0 100644 --- a/Lib9c/Action/RapidCombination.cs +++ b/Lib9c/Action/RapidCombination.cs @@ -156,7 +156,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}RapidCombination Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(slotAddress, slotState.Serialize()); } diff --git a/Lib9c/Action/RapidCombination0.cs b/Lib9c/Action/RapidCombination0.cs index a68bc2fbb8..b4086fd5e8 100644 --- a/Lib9c/Action/RapidCombination0.cs +++ b/Lib9c/Action/RapidCombination0.cs @@ -122,7 +122,7 @@ public override IWorld Execute(IActionContext context) context.BlockIndex ); return states - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(slotAddress, slotState.Serialize()); } diff --git a/Lib9c/Action/RapidCombination5.cs b/Lib9c/Action/RapidCombination5.cs index 7b10cc7a6c..6e9bda2e3b 100644 --- a/Lib9c/Action/RapidCombination5.cs +++ b/Lib9c/Action/RapidCombination5.cs @@ -130,7 +130,7 @@ public override IWorld Execute(IActionContext context) avatarState.UpdateFromRapidCombinationV2((ResultModel)slotState.Result, context.BlockIndex); return states - .SetAvatarState(avatarAddress, avatarState, true, true, true, true) + .SetAvatarState(avatarAddress, avatarState) .SetLegacyState(slotAddress, slotState.Serialize()); } diff --git a/Lib9c/Action/ReRegisterProduct.cs b/Lib9c/Action/ReRegisterProduct.cs index 3a530ab0b1..7949f13bb1 100644 --- a/Lib9c/Action/ReRegisterProduct.cs +++ b/Lib9c/Action/ReRegisterProduct.cs @@ -161,7 +161,7 @@ public override IWorld Execute(IActionContext context) } states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(productsStateAddress, productsState.Serialize()); return states; diff --git a/Lib9c/Action/ReRegisterProduct0.cs b/Lib9c/Action/ReRegisterProduct0.cs index fd4f515c06..a7f3561b24 100644 --- a/Lib9c/Action/ReRegisterProduct0.cs +++ b/Lib9c/Action/ReRegisterProduct0.cs @@ -161,7 +161,7 @@ public override IWorld Execute(IActionContext context) } states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(productsStateAddress, productsState.Serialize()); return states; diff --git a/Lib9c/Action/RedeemCode.cs b/Lib9c/Action/RedeemCode.cs index b97e6e694f..1e89ca519e 100644 --- a/Lib9c/Action/RedeemCode.cs +++ b/Lib9c/Action/RedeemCode.cs @@ -113,7 +113,7 @@ public override IWorld Execute(IActionContext context) var ended = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}RedeemCode Total Executed Time: {Elapsed}", addressesHex, ended - started); return states - .SetAvatarState(AvatarAddress, avatarState, true, true, true, true) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(RedeemCodeState.Address, redeemState.Serialize()); } diff --git a/Lib9c/Action/RedeemCode0.cs b/Lib9c/Action/RedeemCode0.cs index 7e261e634e..0ef8bd4ac1 100644 --- a/Lib9c/Action/RedeemCode0.cs +++ b/Lib9c/Action/RedeemCode0.cs @@ -107,7 +107,7 @@ public override IWorld Execute(IActionContext context) } } - states = states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(AvatarAddress, avatarState); states = states.SetLegacyState(RedeemCodeState.Address, redeemState.Serialize()); return states; } diff --git a/Lib9c/Action/RedeemCode2.cs b/Lib9c/Action/RedeemCode2.cs index 20cc66df17..2ffe4bb36a 100644 --- a/Lib9c/Action/RedeemCode2.cs +++ b/Lib9c/Action/RedeemCode2.cs @@ -108,7 +108,7 @@ public override IWorld Execute(IActionContext context) } } return states - .SetAvatarState(AvatarAddress, avatarState, true, true, true, true) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(RedeemCodeState.Address, redeemState.Serialize()); } diff --git a/Lib9c/Action/RegisterProduct.cs b/Lib9c/Action/RegisterProduct.cs index 067fbd1ab8..325b92a9bc 100644 --- a/Lib9c/Action/RegisterProduct.cs +++ b/Lib9c/Action/RegisterProduct.cs @@ -101,9 +101,9 @@ public override IWorld Execute(IActionContext context) sw.Restart(); states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(productsStateAddress, productsState.Serialize()); - + sw.Stop(); Log.Debug("{Source} {Process} from #{BlockIndex}: {Elapsed}", nameof(RegisterProduct), "Set States", context.BlockIndex, sw.Elapsed.TotalMilliseconds); diff --git a/Lib9c/Action/RegisterProduct0.cs b/Lib9c/Action/RegisterProduct0.cs index e323636d46..cd82c66e18 100644 --- a/Lib9c/Action/RegisterProduct0.cs +++ b/Lib9c/Action/RegisterProduct0.cs @@ -89,7 +89,7 @@ public override IWorld Execute(IActionContext context) } states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(productsStateAddress, productsState.Serialize()); return states; diff --git a/Lib9c/Action/RegisterProduct2.cs b/Lib9c/Action/RegisterProduct2.cs index f8a423c1dd..51dac79d8c 100644 --- a/Lib9c/Action/RegisterProduct2.cs +++ b/Lib9c/Action/RegisterProduct2.cs @@ -88,7 +88,7 @@ public override IWorld Execute(IActionContext context) } states = states - .SetAvatarState(AvatarAddress, avatarState, true, true, false, false) + .SetAvatarState(AvatarAddress, avatarState) .SetLegacyState(productsStateAddress, productsState.Serialize()); return states; diff --git a/Lib9c/Action/RuneSummon.cs b/Lib9c/Action/RuneSummon.cs index 52e7bceef2..41edea80fe 100644 --- a/Lib9c/Action/RuneSummon.cs +++ b/Lib9c/Action/RuneSummon.cs @@ -121,7 +121,7 @@ public override IWorld Execute(IActionContext context) avatarState.updatedAt = context.BlockIndex; // Set states - return states.SetAvatarState(AvatarAddress, avatarState, true, true, false, false); + return states.SetAvatarState(AvatarAddress, avatarState); } protected override IImmutableDictionary PlainValueInternal => diff --git a/Lib9c/Action/Sell.cs b/Lib9c/Action/Sell.cs index 2c1e6bd7db..8f885e2770 100644 --- a/Lib9c/Action/Sell.cs +++ b/Lib9c/Action/Sell.cs @@ -168,7 +168,7 @@ public override IWorld Execute(IActionContext context) states = states .SetLegacyState(orderReceiptAddress, orderReceiptList.Serialize()) - .SetAvatarState(sellerAvatarAddress, avatarState, true, true, true, true); + .SetAvatarState(sellerAvatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}Sell Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); diff --git a/Lib9c/Action/SellCancellation.cs b/Lib9c/Action/SellCancellation.cs index 8f5ff3406f..350f10269e 100644 --- a/Lib9c/Action/SellCancellation.cs +++ b/Lib9c/Action/SellCancellation.cs @@ -196,7 +196,7 @@ public static IWorld CancelV2(IActionContext context, IWorld states, AvatarState states = states .SetLegacyState(itemAddress, sellItem.Serialize()) .SetLegacyState(digestListAddress, digestList.Serialize()) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}Sell Cancel Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); @@ -279,7 +279,7 @@ public static IWorld Cancel(IActionContext context, IWorld states, AvatarState a states = states .SetLegacyState(itemAddress, sellItem.Serialize()) .SetLegacyState(digestListAddress, digestList.Serialize()) - .SetAvatarState(avatarAddress, avatarState, true, true, true, true); + .SetAvatarState(avatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}Sell Cancel Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); diff --git a/Lib9c/Action/SellCancellation7.cs b/Lib9c/Action/SellCancellation7.cs index 030a0d3de3..2b0a439da3 100644 --- a/Lib9c/Action/SellCancellation7.cs +++ b/Lib9c/Action/SellCancellation7.cs @@ -166,7 +166,7 @@ public override IWorld Execute(IActionContext context) states = states .SetLegacyState(itemAddress, sellItem.Serialize()) .SetLegacyState(orderDigestListAddress, digestList.Serialize()) - .SetAvatarState(sellerAvatarAddress, avatarState, true, true, true, true); + .SetAvatarState(sellerAvatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}Sell Cancel Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); diff --git a/Lib9c/Action/SellCancellation8.cs b/Lib9c/Action/SellCancellation8.cs index 89d5bb9881..813ec07c99 100644 --- a/Lib9c/Action/SellCancellation8.cs +++ b/Lib9c/Action/SellCancellation8.cs @@ -184,7 +184,7 @@ public override IWorld Execute(IActionContext context) states = states .SetLegacyState(itemAddress, sellItem.Serialize()) .SetLegacyState(digestListAddress, digestList.Serialize()) - .SetAvatarState(sellerAvatarAddress, avatarState, true, true, true, true); + .SetAvatarState(sellerAvatarAddress, avatarState); sw.Stop(); Log.Verbose("{AddressesHex}Sell Cancel Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); sw.Restart(); diff --git a/Lib9c/Action/UnlockEquipmentRecipe.cs b/Lib9c/Action/UnlockEquipmentRecipe.cs index fe31f90655..204f072b7a 100644 --- a/Lib9c/Action/UnlockEquipmentRecipe.cs +++ b/Lib9c/Action/UnlockEquipmentRecipe.cs @@ -51,7 +51,7 @@ public override IWorld Execute(IActionContext context) if (states.TryGetAvatarState(context.Signer, AvatarAddress, out AvatarState avatarState)) { worldInformation = avatarState.worldInformation; - states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states.SetAvatarState(AvatarAddress, avatarState); } else { diff --git a/Lib9c/Action/UnlockEquipmentRecipe1.cs b/Lib9c/Action/UnlockEquipmentRecipe1.cs index 09cc18ba75..0172998120 100644 --- a/Lib9c/Action/UnlockEquipmentRecipe1.cs +++ b/Lib9c/Action/UnlockEquipmentRecipe1.cs @@ -54,7 +54,7 @@ public override IWorld Execute(IActionContext context) if (states.TryGetAvatarState(context.Signer, AvatarAddress, out AvatarState avatarState)) { worldInformation = avatarState.worldInformation; - states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states.SetAvatarState(AvatarAddress, avatarState); } else { diff --git a/Lib9c/Action/UnlockWorld.cs b/Lib9c/Action/UnlockWorld.cs index d894bf1ca9..5d7d8247a1 100644 --- a/Lib9c/Action/UnlockWorld.cs +++ b/Lib9c/Action/UnlockWorld.cs @@ -54,7 +54,7 @@ public override IWorld Execute(IActionContext context) if (states.TryGetAvatarState(context.Signer, AvatarAddress, out AvatarState avatarState)) { worldInformation = avatarState.worldInformation; - states = states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(AvatarAddress, avatarState); } else { diff --git a/Lib9c/Action/UnlockWorld1.cs b/Lib9c/Action/UnlockWorld1.cs index 5678e55d05..43e5efd853 100644 --- a/Lib9c/Action/UnlockWorld1.cs +++ b/Lib9c/Action/UnlockWorld1.cs @@ -49,7 +49,7 @@ public override IWorld Execute(IActionContext context) if (states.TryGetAvatarState(context.Signer, AvatarAddress, out AvatarState avatarState)) { worldInformation = avatarState.worldInformation; - states = states.SetAvatarState(AvatarAddress, avatarState, true, true, true, true); + states = states.SetAvatarState(AvatarAddress, avatarState); } else { diff --git a/Lib9c/Action/UpdateSell.cs b/Lib9c/Action/UpdateSell.cs index 98b8f55d8d..3c5354999c 100644 --- a/Lib9c/Action/UpdateSell.cs +++ b/Lib9c/Action/UpdateSell.cs @@ -155,7 +155,7 @@ public override IWorld Execute(IActionContext context) sw.Restart(); states = states - .SetAvatarState(sellerAvatarAddress, avatarState, true, true, true, true) + .SetAvatarState(sellerAvatarAddress, avatarState) .SetLegacyState(digestListAddress, digestList.Serialize()); sw.Stop(); Log.Verbose("{AddressesHex} UpdateSell Set AvatarState: {Elapsed}", addressesHex, sw.Elapsed); diff --git a/Lib9c/Module/AvatarModule.cs b/Lib9c/Module/AvatarModule.cs index 57a81e79d6..a0c458b166 100644 --- a/Lib9c/Module/AvatarModule.cs +++ b/Lib9c/Module/AvatarModule.cs @@ -235,10 +235,10 @@ public static IWorld SetAvatarState( this IWorld world, Address avatarAddress, AvatarState state, - bool setAvatar, - bool setInventory, - bool setWorldInformation, - bool setQuestList) + bool setAvatar = true, + bool setInventory = true, + bool setWorldInformation = true, + bool setQuestList = true) { // TODO: Overwrite legacy address to null state? if (state.Version < 2)