From 141650db4efa2247cf7d2f563181a8e3a1744473 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Fri, 10 Nov 2023 18:45:47 +0900 Subject: [PATCH 01/19] Remove GetValue() usage --- .Lib9c.Tests/Model/State/LazyStateTest.cs | 6 +++--- Lib9c/Action/ValidatorSetOperate.cs | 4 ++-- Lib9c/Model/Coupons/Coupon.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.Lib9c.Tests/Model/State/LazyStateTest.cs b/.Lib9c.Tests/Model/State/LazyStateTest.cs index ca77f5fbf3..d02660c797 100644 --- a/.Lib9c.Tests/Model/State/LazyStateTest.cs +++ b/.Lib9c.Tests/Model/State/LazyStateTest.cs @@ -55,7 +55,7 @@ public void Serialize() _unloaded.State.Foo = 456L; Assert.Equal( 456L, - (long)((Dictionary)_unloaded.Serialize()).GetValue("foo") + (long)(Integer)((Dictionary)_unloaded.Serialize())["foo"] ); Assert.True(_unloaded.GetStateOrSerializedEncoding(out _, out _)); } @@ -107,8 +107,8 @@ public SampleState(Address address, long foo, string bar) public SampleState(Dictionary serialized) : base(serialized) { - Foo = serialized.GetValue("foo"); - Bar = serialized.GetValue("bar"); + Foo = (Integer)serialized["foo"]; + Bar = (Text)serialized["bar"]; } public SampleState(IValue iValue) diff --git a/Lib9c/Action/ValidatorSetOperate.cs b/Lib9c/Action/ValidatorSetOperate.cs index 987b734a17..f64cf3ca23 100644 --- a/Lib9c/Action/ValidatorSetOperate.cs +++ b/Lib9c/Action/ValidatorSetOperate.cs @@ -163,9 +163,9 @@ private Validator BackwardCompatibility(Bencodex.Types.Dictionary dict) catch (Exception) { BigInteger power = - new BigInteger(dict.GetValue(PowerKey).ToByteArray()); + new BigInteger(((Binary)dict[PowerKey]).ToByteArray()); PublicKey publicKey = - new PublicKey(dict.GetValue(PublicKeyKey).ToByteArray()); + new PublicKey(((Binary)dict[PublicKeyKey]).ToByteArray()); return new Validator(publicKey, power); } diff --git a/Lib9c/Model/Coupons/Coupon.cs b/Lib9c/Model/Coupons/Coupon.cs index 80b9f97da6..24e6178579 100644 --- a/Lib9c/Model/Coupons/Coupon.cs +++ b/Lib9c/Model/Coupons/Coupon.cs @@ -40,7 +40,7 @@ public Coupon(IValue serialized) ); } - Id = new Guid(dict.GetValue("id")); + Id = new Guid((Binary)dict["id"]); Rewards = new RewardSet((Bencodex.Types.Dictionary)dict["rewards"]); } From 51dec40b7a7589b590bdd973d6aab3737c60c08f Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Fri, 10 Nov 2023 18:52:23 +0900 Subject: [PATCH 02/19] Use bencodability of Address --- .Lib9c.Miner.Tests/CustomActionsDeserializableValidatorTest.cs | 2 +- Lib9c.MessagePack/AccountStateDelta.cs | 2 +- Lib9c/CurrencyExtensions.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.Lib9c.Miner.Tests/CustomActionsDeserializableValidatorTest.cs b/.Lib9c.Miner.Tests/CustomActionsDeserializableValidatorTest.cs index 0b3d82745a..2383770db8 100644 --- a/.Lib9c.Miner.Tests/CustomActionsDeserializableValidatorTest.cs +++ b/.Lib9c.Miner.Tests/CustomActionsDeserializableValidatorTest.cs @@ -44,7 +44,7 @@ private class DailyReward : IAction public void LoadPlainValue(IValue plainValue) { - AvatarAddress = new Address(((Binary)((Dictionary)plainValue)["a"]).ByteArray); + AvatarAddress = new Address(((Dictionary)plainValue)["a"]); } public IAccount Execute(IActionContext context) diff --git a/Lib9c.MessagePack/AccountStateDelta.cs b/Lib9c.MessagePack/AccountStateDelta.cs index 864d8eea5a..ff556a3f95 100644 --- a/Lib9c.MessagePack/AccountStateDelta.cs +++ b/Lib9c.MessagePack/AccountStateDelta.cs @@ -42,7 +42,7 @@ public AccountStateDelta(Dictionary states, List balances, Dictionary totalSuppl kv => new Address(kv.Key), kv => kv.Value), balances.Cast().ToImmutableDictionary( - record => (new Address(((Binary)record["address"]).ByteArray), new Currency((Dictionary)record["currency"])), + record => (new Address(record["address"]), new Currency((Dictionary)record["currency"])), record => (BigInteger)(Integer)record["amount"]), totalSupplies.ToImmutableDictionary( kv => new Currency(new Codec().Decode((Binary)kv.Key)), diff --git a/Lib9c/CurrencyExtensions.cs b/Lib9c/CurrencyExtensions.cs index 79180e14ad..3a7ba36f08 100644 --- a/Lib9c/CurrencyExtensions.cs +++ b/Lib9c/CurrencyExtensions.cs @@ -40,7 +40,7 @@ public static Currency Deserialize(Bencodex.Types.Dictionary serialized) IImmutableSet
minters = null; if (serialized["minters"] is Bencodex.Types.List mintersAsList) { - minters = mintersAsList.Select(b => new Address(((Binary) b).ByteArray)).ToImmutableHashSet(); + minters = mintersAsList.Select(b => new Address(b)).ToImmutableHashSet(); } if (serialized.ContainsKey("totalSupplyTrackable")) From 20773488a3416e36d530f8f72b5c5317447181d7 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Fri, 10 Nov 2023 18:57:59 +0900 Subject: [PATCH 03/19] Remove forced rehearsal extension method --- .../Action/ActionBaseExtensionsTest.cs | 55 ----- Lib9c/Action/ActionBaseExtensions.cs | 192 ------------------ 2 files changed, 247 deletions(-) delete mode 100644 .Lib9c.Tests/Action/ActionBaseExtensionsTest.cs delete mode 100644 Lib9c/Action/ActionBaseExtensions.cs diff --git a/.Lib9c.Tests/Action/ActionBaseExtensionsTest.cs b/.Lib9c.Tests/Action/ActionBaseExtensionsTest.cs deleted file mode 100644 index f40a828fef..0000000000 --- a/.Lib9c.Tests/Action/ActionBaseExtensionsTest.cs +++ /dev/null @@ -1,55 +0,0 @@ -namespace Lib9c.Tests.Action -{ - using System.Collections.Immutable; - using Libplanet.Crypto; - using Nekoyume.Action; - using Xunit; - - public class ActionBaseExtensionsTest - { - [Fact] - public void CalculateUpdateAddresses() - { - var actions = new ActionBase[] - { - new TransferAsset( - sender: default, - recipient: default, - amount: Currencies.DailyRewardRune * 1 - ), - }; - - IImmutableSet
actual = actions.CalculateUpdateAddresses(); - Assert.Equal( - new Address[] - { - default, - }, - actual - ); - } - - [Fact] - public void CalculateUpdateAddressesWithIncompatibles() - { - var actions = new ActionBase[] - { - new TransferAsset( - sender: default, - recipient: default, - amount: Currencies.DailyRewardRune * 1 - ), - new HackAndSlashRandomBuff(), - }; - - IImmutableSet
actual = actions.CalculateUpdateAddresses(); - Assert.Equal( - new Address[] - { - default, - }, - actual - ); - } - } -} diff --git a/Lib9c/Action/ActionBaseExtensions.cs b/Lib9c/Action/ActionBaseExtensions.cs deleted file mode 100644 index 1eae92aaec..0000000000 --- a/Lib9c/Action/ActionBaseExtensions.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Numerics; -using System.Security.Cryptography; -using Bencodex.Types; -using Libplanet.Action; -using Libplanet.Action.State; -using Libplanet.Common; -using Libplanet.Crypto; -using Libplanet.Store.Trie; -using Libplanet.Types.Assets; -using Libplanet.Types.Blocks; -using Libplanet.Types.Consensus; -using Libplanet.Types.Tx; - -namespace Nekoyume.Action -{ - public static class ActionBaseExtensions - { - public static IImmutableSet
CalculateUpdateAddresses(this IEnumerable actions) - { - IImmutableSet
addresses = ImmutableHashSet
.Empty; - IActionContext rehearsalContext = new RehearsalActionContext(); - - foreach (ActionBase action in actions) - { - try - { - IAccount nextStates = action.Execute(rehearsalContext); - addresses = addresses.Union(nextStates.Delta.UpdatedAddresses); - } - catch (NotSupportedException) - { - // Ignore updated addresses from incompatible actions - } - } - - return addresses; - } - - private class RehearsalActionContext : IActionContext - { - public BlockHash? GenesisHash => default; - - public Address Signer => default; - - public TxId? TxId => default; - - public Address Miner => default; - - public long BlockIndex => default; - - public int BlockProtocolVersion => default; - - public bool Rehearsal => true; - - public IAccount PreviousState => new AddressTraceStateDelta(); - - public int RandomSeed => default; - - public HashDigest? PreviousStateRootHash => default; - - public bool BlockAction => default; - - public void UseGas(long gas) - { - // pass - } - - public IRandom GetRandom() => null; - - public long GasUsed() => 0; - - public long GasLimit() => 0; - } - - private class AddressTraceStateDelta : IAccount - { - private AddressTraceDelta _delta; - - public AddressTraceStateDelta() - : this(new AddressTraceDelta()) - { - } - - public AddressTraceStateDelta(AddressTraceDelta delta) - { - _delta = delta; - } - - public ITrie Trie => throw new NotSupportedException(); - - public IAccountDelta Delta => _delta; - - public IImmutableSet
UpdatedAddresses => _delta.UpdatedAddresses; - - public IImmutableSet
StateUpdatedAddresses => _delta.StateUpdatedAddresses; - - public IImmutableSet<(Address, Currency)> UpdatedFungibleAssets => - Delta.UpdatedFungibleAssets; - - public IImmutableSet<(Address, Currency)> TotalUpdatedFungibleAssets => - throw new NotSupportedException(); - - public IImmutableSet UpdatedTotalSupplyCurrencies - => Delta.UpdatedTotalSupplyCurrencies; - - public IAccount BurnAsset(IActionContext context, Address owner, FungibleAssetValue value) - { - return new AddressTraceStateDelta( - new AddressTraceDelta(Delta.UpdatedAddresses.Union(new [] { owner }))); - } - - public FungibleAssetValue GetBalance(Address address, Currency currency) - { - throw new NotSupportedException(); - } - - public IValue GetState(Address address) - { - throw new NotSupportedException(); - } - - public IReadOnlyList GetStates(IReadOnlyList
addresses) - { - throw new NotSupportedException(); - } - - public FungibleAssetValue GetTotalSupply(Currency currency) - { - throw new NotSupportedException(); - } - - public IAccount MintAsset(IActionContext context, Address recipient, FungibleAssetValue value) - { - return new AddressTraceStateDelta( - new AddressTraceDelta(Delta.UpdatedAddresses.Union(new[] { recipient }))); - } - - public IAccount SetState(Address address, IValue state) - { - return new AddressTraceStateDelta( - new AddressTraceDelta(Delta.UpdatedAddresses.Union(new[] { address }))); - } - - public IAccount TransferAsset( - IActionContext context, - Address sender, - Address recipient, - FungibleAssetValue value, - bool allowNegativeBalance = false - ) - { - return new AddressTraceStateDelta( - new AddressTraceDelta(Delta.UpdatedAddresses.Union(new[] { sender, recipient }))); - } - - public ValidatorSet GetValidatorSet() => throw new NotSupportedException(); - - public IAccount SetValidator(Validator validator) - { - throw new NotSupportedException(); - } - - public class AddressTraceDelta : IAccountDelta - { - private IImmutableSet
_updatedAddresses; - - public AddressTraceDelta() - : this(ImmutableHashSet
.Empty) - { - } - - public AddressTraceDelta(IImmutableSet
updatedAddresses) - { - _updatedAddresses = updatedAddresses; - } - - public IImmutableSet
UpdatedAddresses => _updatedAddresses; - public IImmutableSet
StateUpdatedAddresses => _updatedAddresses; - public IImmutableDictionary States => throw new NotSupportedException(); - public IImmutableSet
FungibleUpdatedAddresses => _updatedAddresses; - public IImmutableSet<(Address, Currency)> UpdatedFungibleAssets => throw new NotSupportedException(); - public IImmutableDictionary<(Address, Currency), BigInteger> Fungibles => throw new NotSupportedException(); - public IImmutableSet UpdatedTotalSupplyCurrencies => throw new NotSupportedException(); - public IImmutableDictionary TotalSupplies => throw new NotSupportedException(); - public ValidatorSet ValidatorSet => throw new NotSupportedException(); - } - } - } -} From 374ff35f4050c7d6f33fdd11603ff5f8501cc405 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Sat, 11 Nov 2023 09:17:23 +0900 Subject: [PATCH 04/19] Remove unnecessary testing --- .Lib9c.Tests/Action/ActivateAccount0Test.cs | 26 ------- .Lib9c.Tests/Action/ActivateAccountTest.cs | 27 -------- .../Action/AddActivatedAccount0Test.cs | 29 -------- .../Action/AddActivatedAccountTest.cs | 28 -------- .Lib9c.Tests/Action/Buy10Test.cs | 49 ------------- .Lib9c.Tests/Action/Buy11Test.cs | 49 ------------- .Lib9c.Tests/Action/Buy8Test.cs | 49 ------------- .Lib9c.Tests/Action/Buy9Test.cs | 49 ------------- .Lib9c.Tests/Action/CreateAvatar0Test.cs | 58 ---------------- .Lib9c.Tests/Action/CreateAvatar10Test.cs | 65 ----------------- .Lib9c.Tests/Action/CreateAvatar2Test.cs | 66 ------------------ .Lib9c.Tests/Action/CreateAvatar3Test.cs | 69 ------------------- .Lib9c.Tests/Action/CreateAvatar6Test.cs | 69 ------------------- .Lib9c.Tests/Action/CreateAvatar7Test.cs | 65 ----------------- .Lib9c.Tests/Action/CreateAvatar8Test.cs | 65 ----------------- .Lib9c.Tests/Action/CreateAvatar9Test.cs | 65 ----------------- .Lib9c.Tests/Action/DailyReward4Test.cs | 28 -------- .Lib9c.Tests/Action/DailyReward5Test.cs | 25 ------- .Lib9c.Tests/Action/DailyReward6Test.cs | 28 -------- .Lib9c.Tests/Action/DailyRewardTest.cs | 21 ------ .Lib9c.Tests/Action/HackAndSlash0Test.cs | 36 ---------- .Lib9c.Tests/Action/HackAndSlash10Test.cs | 38 ---------- .Lib9c.Tests/Action/HackAndSlash11Test.cs | 36 ---------- .Lib9c.Tests/Action/HackAndSlash12Test.cs | 36 ---------- .Lib9c.Tests/Action/HackAndSlash13Test.cs | 35 ---------- .Lib9c.Tests/Action/HackAndSlash2Test.cs | 36 ---------- .Lib9c.Tests/Action/HackAndSlash6Test.cs | 39 ----------- .Lib9c.Tests/Action/HackAndSlash7Test.cs | 39 ----------- .Lib9c.Tests/Action/HackAndSlash8Test.cs | 37 ---------- .Lib9c.Tests/Action/HackAndSlash9Test.cs | 38 ---------- .Lib9c.Tests/Action/ItemEnhancement0Test.cs | 44 ------------ .Lib9c.Tests/Action/ItemEnhancement10Test.cs | 42 ----------- .Lib9c.Tests/Action/ItemEnhancement2Test.cs | 44 ------------ .Lib9c.Tests/Action/ItemEnhancement7Test.cs | 42 ----------- .Lib9c.Tests/Action/ItemEnhancement8Test.cs | 42 ----------- .Lib9c.Tests/Action/ItemEnhancement9Test.cs | 42 ----------- .Lib9c.Tests/Action/RankingBattle10Test.cs | 34 --------- .Lib9c.Tests/Action/RankingBattle11Test.cs | 34 --------- .Lib9c.Tests/Action/RankingBattle5Test.cs | 35 ---------- .Lib9c.Tests/Action/RankingBattle6Test.cs | 35 ---------- .Lib9c.Tests/Action/RankingBattle7Test.cs | 35 ---------- .Lib9c.Tests/Action/RankingBattle8Test.cs | 35 ---------- .Lib9c.Tests/Action/RankingBattle9Test.cs | 35 ---------- .Lib9c.Tests/Action/Sell10Test.cs | 41 ----------- .Lib9c.Tests/Action/Sell11Test.cs | 41 ----------- .Lib9c.Tests/Action/Sell7Test.cs | 41 ----------- .Lib9c.Tests/Action/Sell8Test.cs | 41 ----------- .Lib9c.Tests/Action/Sell9Test.cs | 41 ----------- .Lib9c.Tests/Action/SellCancellation7Test.cs | 35 ---------- .Lib9c.Tests/Action/SellCancellation8Test.cs | 35 ---------- .Lib9c.Tests/Action/SellCancellationTest.cs | 35 ---------- .Lib9c.Tests/Action/SellTest.cs | 41 ----------- .Lib9c.Tests/Action/TransferAsset2Test.cs | 29 -------- .Lib9c.Tests/Action/TransferAsset3Test.cs | 29 -------- .Lib9c.Tests/Action/TransferAsset4Test.cs | 30 -------- .Lib9c.Tests/Action/TransferAssetTest.cs | 30 -------- .Lib9c.Tests/Action/TransferAssetTest0.cs | 29 -------- .Lib9c.Tests/Action/TransferAssets0Test.cs | 31 --------- .Lib9c.Tests/Action/TransferAssets2Test.cs | 31 --------- .Lib9c.Tests/Action/TransferAssetsTest.cs | 31 --------- 60 files changed, 2390 deletions(-) diff --git a/.Lib9c.Tests/Action/ActivateAccount0Test.cs b/.Lib9c.Tests/Action/ActivateAccount0Test.cs index 5157ab2676..ff1904bb6b 100644 --- a/.Lib9c.Tests/Action/ActivateAccount0Test.cs +++ b/.Lib9c.Tests/Action/ActivateAccount0Test.cs @@ -39,32 +39,6 @@ public void Execute() activatedAccounts.Accounts); } - [Fact] - public void Rehearsal() - { - var nonce = new byte[] { 0x00, 0x01, 0x02, 0x03 }; - var privateKey = new PrivateKey(); - (ActivationKey activationKey, PendingActivationState pendingActivation) = - ActivationKey.Create(privateKey, nonce); - - ActivateAccount0 action = activationKey.CreateActivateAccount0(nonce); - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - ActivatedAccountsState.Address, - pendingActivation.address - ), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void ExecuteWithInvalidSignature() { diff --git a/.Lib9c.Tests/Action/ActivateAccountTest.cs b/.Lib9c.Tests/Action/ActivateAccountTest.cs index 4006fe3059..33bf593c7d 100644 --- a/.Lib9c.Tests/Action/ActivateAccountTest.cs +++ b/.Lib9c.Tests/Action/ActivateAccountTest.cs @@ -62,33 +62,6 @@ public void Execute(bool invalid, bool pendingExist, bool alreadyActivated, Type } } - [Fact] - public void Rehearsal() - { - var nonce = new byte[] { 0x00, 0x01, 0x02, 0x03 }; - var privateKey = new PrivateKey(); - (ActivationKey activationKey, PendingActivationState pendingActivation) = - ActivationKey.Create(privateKey, nonce); - - ActivateAccount action = activationKey.CreateActivateAccount(nonce); - Address activatedAddress = default(Address).Derive(ActivationKey.DeriveKey); - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - activatedAddress, - pendingActivation.address - ), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void PlainValue() { diff --git a/.Lib9c.Tests/Action/AddActivatedAccount0Test.cs b/.Lib9c.Tests/Action/AddActivatedAccount0Test.cs index 051ba4fad3..50f35b07e3 100644 --- a/.Lib9c.Tests/Action/AddActivatedAccount0Test.cs +++ b/.Lib9c.Tests/Action/AddActivatedAccount0Test.cs @@ -39,35 +39,6 @@ public void Execute() ); } - [Fact] - public void Rehearsal() - { - var admin = new Address("8d9f76aF8Dc5A812aCeA15d8bf56E2F790F47fd7"); - var state = new Account( - MockState.Empty - .SetState(AdminState.Address, new AdminState(admin, 100).Serialize()) - .SetState(ActivatedAccountsState.Address, new ActivatedAccountsState().Serialize())); - var newComer = new Address("399bddF9F7B6d902ea27037B907B2486C9910730"); - var action = new AddActivatedAccount0(newComer); - - IAccount nextState = action.Execute(new ActionContext() - { - BlockIndex = 1, - Miner = default, - PreviousState = state, - Signer = admin, - Rehearsal = true, - }); - - Assert.Equal( - new[] - { - ActivatedAccountsState.Address, - }.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void ExecuteWithNonExistsAccounts() { diff --git a/.Lib9c.Tests/Action/AddActivatedAccountTest.cs b/.Lib9c.Tests/Action/AddActivatedAccountTest.cs index a9ca6661ea..081d6622a4 100644 --- a/.Lib9c.Tests/Action/AddActivatedAccountTest.cs +++ b/.Lib9c.Tests/Action/AddActivatedAccountTest.cs @@ -55,34 +55,6 @@ public void Execute(bool isAdmin, long blockIndex, bool alreadyActivated, Type e } } - [Fact] - public void Rehearsal() - { - var admin = new Address("8d9f76aF8Dc5A812aCeA15d8bf56E2F790F47fd7"); - var state = new Account( - MockState.Empty - .SetState(AdminState.Address, new AdminState(admin, 100).Serialize())); - var newComer = new Address("399bddF9F7B6d902ea27037B907B2486C9910730"); - var action = new AddActivatedAccount(newComer); - - IAccount nextState = action.Execute(new ActionContext() - { - BlockIndex = 1, - Miner = default, - PreviousState = state, - Signer = admin, - Rehearsal = true, - }); - - Assert.Equal( - new[] - { - newComer.Derive(ActivationKey.DeriveKey), - }.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void PlainValue() { diff --git a/.Lib9c.Tests/Action/Buy10Test.cs b/.Lib9c.Tests/Action/Buy10Test.cs index b8a156412b..3a3f550419 100644 --- a/.Lib9c.Tests/Action/Buy10Test.cs +++ b/.Lib9c.Tests/Action/Buy10Test.cs @@ -768,55 +768,6 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList) } } - [Fact] - public void Rehearsal() - { - PurchaseInfo purchaseInfo = new PurchaseInfo( - _orderId, - default, - _sellerAgentAddress, - _sellerAvatarAddress, - ItemSubType.Weapon, - new FungibleAssetValue(_goldCurrencyState.Currency, 10, 0) - ); - - var action = new Buy10 - { - buyerAvatarAddress = _buyerAvatarAddress, - purchaseInfos = new[] { purchaseInfo }, - }; - - var updatedAddresses = new List
() - { - _sellerAgentAddress, - _sellerAvatarAddress, - _sellerAvatarAddress.Derive(LegacyInventoryKey), - _sellerAvatarAddress.Derive(LegacyWorldInformationKey), - _sellerAvatarAddress.Derive(LegacyQuestListKey), - OrderDigestListState.DeriveAddress(_sellerAvatarAddress), - _buyerAgentAddress, - _buyerAvatarAddress, - _buyerAvatarAddress.Derive(LegacyInventoryKey), - _buyerAvatarAddress.Derive(LegacyWorldInformationKey), - _buyerAvatarAddress.Derive(LegacyQuestListKey), - Addresses.GoldCurrency, - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, _orderId), - OrderReceipt.DeriveAddress(_orderId), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _buyerAgentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void Execute_With_Testbed() { diff --git a/.Lib9c.Tests/Action/Buy11Test.cs b/.Lib9c.Tests/Action/Buy11Test.cs index 9ff4dfe34c..6a68862fb3 100644 --- a/.Lib9c.Tests/Action/Buy11Test.cs +++ b/.Lib9c.Tests/Action/Buy11Test.cs @@ -774,55 +774,6 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList) } } - [Fact] - public void Rehearsal() - { - PurchaseInfo purchaseInfo = new PurchaseInfo( - _orderId, - default, - _sellerAgentAddress, - _sellerAvatarAddress, - ItemSubType.Weapon, - new FungibleAssetValue(_goldCurrencyState.Currency, 10, 0) - ); - - var action = new Buy11 - { - buyerAvatarAddress = _buyerAvatarAddress, - purchaseInfos = new[] { purchaseInfo }, - }; - - var updatedAddresses = new List
() - { - _sellerAgentAddress, - _sellerAvatarAddress, - _sellerAvatarAddress.Derive(LegacyInventoryKey), - _sellerAvatarAddress.Derive(LegacyWorldInformationKey), - _sellerAvatarAddress.Derive(LegacyQuestListKey), - OrderDigestListState.DeriveAddress(_sellerAvatarAddress), - _buyerAgentAddress, - _buyerAvatarAddress, - _buyerAvatarAddress.Derive(LegacyInventoryKey), - _buyerAvatarAddress.Derive(LegacyWorldInformationKey), - _buyerAvatarAddress.Derive(LegacyQuestListKey), - Buy11.GetFeeStoreAddress(), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, _orderId), - OrderReceipt.DeriveAddress(_orderId), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _buyerAgentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void Execute_With_Testbed() { diff --git a/.Lib9c.Tests/Action/Buy8Test.cs b/.Lib9c.Tests/Action/Buy8Test.cs index fe13fbaad9..f968b3815b 100644 --- a/.Lib9c.Tests/Action/Buy8Test.cs +++ b/.Lib9c.Tests/Action/Buy8Test.cs @@ -550,55 +550,6 @@ public void Execute_ErrorCode(ErrorCodeMember errorCodeMember) } } - [Fact] - public void Rehearsal() - { - PurchaseInfo purchaseInfo = new PurchaseInfo( - _orderId, - default, - _sellerAgentAddress, - _sellerAvatarAddress, - ItemSubType.Weapon, - new FungibleAssetValue(_goldCurrencyState.Currency, 10, 0) - ); - - var action = new Buy8 - { - buyerAvatarAddress = _buyerAvatarAddress, - purchaseInfos = new[] { purchaseInfo }, - }; - - var updatedAddresses = new List
() - { - _sellerAgentAddress, - _sellerAvatarAddress, - _sellerAvatarAddress.Derive(LegacyInventoryKey), - _sellerAvatarAddress.Derive(LegacyWorldInformationKey), - _sellerAvatarAddress.Derive(LegacyQuestListKey), - OrderDigestListState.DeriveAddress(_sellerAvatarAddress), - _buyerAgentAddress, - _buyerAvatarAddress, - _buyerAvatarAddress.Derive(LegacyInventoryKey), - _buyerAvatarAddress.Derive(LegacyWorldInformationKey), - _buyerAvatarAddress.Derive(LegacyQuestListKey), - Addresses.GoldCurrency, - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, _orderId), - OrderReceipt.DeriveAddress(_orderId), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _buyerAgentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private (AvatarState AvatarState, AgentState AgentState) CreateAvatarState( Address agentAddress, Address avatarAddress) { diff --git a/.Lib9c.Tests/Action/Buy9Test.cs b/.Lib9c.Tests/Action/Buy9Test.cs index 9a11cefffc..b0da320384 100644 --- a/.Lib9c.Tests/Action/Buy9Test.cs +++ b/.Lib9c.Tests/Action/Buy9Test.cs @@ -649,55 +649,6 @@ public void Execute_ErrorCode(ErrorCodeMember errorCodeMember) } } - [Fact] - public void Rehearsal() - { - PurchaseInfo purchaseInfo = new PurchaseInfo( - _orderId, - default, - _sellerAgentAddress, - _sellerAvatarAddress, - ItemSubType.Weapon, - new FungibleAssetValue(_goldCurrencyState.Currency, 10, 0) - ); - - var action = new Buy9 - { - buyerAvatarAddress = _buyerAvatarAddress, - purchaseInfos = new[] { purchaseInfo }, - }; - - var updatedAddresses = new List
() - { - _sellerAgentAddress, - _sellerAvatarAddress, - _sellerAvatarAddress.Derive(LegacyInventoryKey), - _sellerAvatarAddress.Derive(LegacyWorldInformationKey), - _sellerAvatarAddress.Derive(LegacyQuestListKey), - OrderDigestListState.DeriveAddress(_sellerAvatarAddress), - _buyerAgentAddress, - _buyerAvatarAddress, - _buyerAvatarAddress.Derive(LegacyInventoryKey), - _buyerAvatarAddress.Derive(LegacyWorldInformationKey), - _buyerAvatarAddress.Derive(LegacyQuestListKey), - Addresses.GoldCurrency, - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, _orderId), - OrderReceipt.DeriveAddress(_orderId), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _buyerAgentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private (AvatarState AvatarState, AgentState AgentState) CreateAvatarState( Address agentAddress, Address avatarAddress) { diff --git a/.Lib9c.Tests/Action/CreateAvatar0Test.cs b/.Lib9c.Tests/Action/CreateAvatar0Test.cs index 7251dd2169..28ba4f4b14 100644 --- a/.Lib9c.Tests/Action/CreateAvatar0Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar0Test.cs @@ -215,64 +215,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Fact] - public void Rehearsal() - { - var agentAddress = default(Address); - var avatarAddress = agentAddress.Derive("avatar"); - - var action = new CreateAvatar0() - { - avatarAddress = avatarAddress, - index = 0, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - Addresses.GoldCurrency, - Addresses.Ranking, - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty) - .SetState(Addresses.Ranking, new RankingState0().Serialize()) - .SetState(GoldCurrencyState.Address, gold.Serialize()); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void SerializeWithDotnetAPI() { diff --git a/.Lib9c.Tests/Action/CreateAvatar10Test.cs b/.Lib9c.Tests/Action/CreateAvatar10Test.cs index 49a3b0f64d..2ee2d5cb53 100644 --- a/.Lib9c.Tests/Action/CreateAvatar10Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar10Test.cs @@ -230,71 +230,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Theory] - [InlineData(0)] - [InlineData(1)] - [InlineData(2)] - public void Rehearsal(int index) - { - var agentAddress = default(Address); - var avatarAddress = _agentAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CreateAvatar2.DeriveFormat, - index - ) - ); - - var action = new CreateAvatar10() - { - index = index, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - avatarAddress.Derive(LegacyInventoryKey), - avatarAddress.Derive(LegacyQuestListKey), - avatarAddress.Derive(LegacyWorldInformationKey), - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void Serialize_With_DotnetAPI() { diff --git a/.Lib9c.Tests/Action/CreateAvatar2Test.cs b/.Lib9c.Tests/Action/CreateAvatar2Test.cs index 639b71e0a8..91ccc15972 100644 --- a/.Lib9c.Tests/Action/CreateAvatar2Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar2Test.cs @@ -230,72 +230,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Theory] - [InlineData(0)] - [InlineData(1)] - [InlineData(2)] - public void Rehearsal(int index) - { - var agentAddress = default(Address); - var avatarAddress = _agentAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CreateAvatar2.DeriveFormat, - index - ) - ); - - var action = new CreateAvatar2() - { - index = index, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - Addresses.GoldCurrency, - Addresses.Ranking, - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty) - .SetState(Addresses.Ranking, new RankingState0().Serialize()) - .SetState(GoldCurrencyState.Address, gold.Serialize()); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void SerializeWithDotnetAPI() { diff --git a/.Lib9c.Tests/Action/CreateAvatar3Test.cs b/.Lib9c.Tests/Action/CreateAvatar3Test.cs index 974cedc017..b136d04258 100644 --- a/.Lib9c.Tests/Action/CreateAvatar3Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar3Test.cs @@ -232,75 +232,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Theory] - [InlineData(0)] - [InlineData(1)] - [InlineData(2)] - public void Rehearsal(int index) - { - var agentAddress = default(Address); - var avatarAddress = _agentAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CreateAvatar3.DeriveFormat, - index - ) - ); - - var action = new CreateAvatar3() - { - index = index, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - Addresses.GoldCurrency, - Addresses.Ranking, - avatarAddress.Derive(LegacyInventoryKey), - avatarAddress.Derive(LegacyQuestListKey), - avatarAddress.Derive(LegacyWorldInformationKey), - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty) - .SetState(Addresses.Ranking, new RankingState0().Serialize()) - .SetState(GoldCurrencyState.Address, gold.Serialize()); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void Serialize_With_DotnetAPI() { diff --git a/.Lib9c.Tests/Action/CreateAvatar6Test.cs b/.Lib9c.Tests/Action/CreateAvatar6Test.cs index 97c1c04029..5909bfca91 100644 --- a/.Lib9c.Tests/Action/CreateAvatar6Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar6Test.cs @@ -232,75 +232,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Theory] - [InlineData(0)] - [InlineData(1)] - [InlineData(2)] - public void Rehearsal(int index) - { - var agentAddress = default(Address); - var avatarAddress = _agentAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CreateAvatar2.DeriveFormat, - index - ) - ); - - var action = new CreateAvatar6() - { - index = index, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - Addresses.GoldCurrency, - Addresses.Ranking, - avatarAddress.Derive(LegacyInventoryKey), - avatarAddress.Derive(LegacyQuestListKey), - avatarAddress.Derive(LegacyWorldInformationKey), - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty) - .SetState(Addresses.Ranking, new RankingState0().Serialize()) - .SetState(GoldCurrencyState.Address, gold.Serialize()); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void Serialize_With_DotnetAPI() { diff --git a/.Lib9c.Tests/Action/CreateAvatar7Test.cs b/.Lib9c.Tests/Action/CreateAvatar7Test.cs index a0f92fdf6d..39fb3a2277 100644 --- a/.Lib9c.Tests/Action/CreateAvatar7Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar7Test.cs @@ -213,71 +213,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Theory] - [InlineData(0)] - [InlineData(1)] - [InlineData(2)] - public void Rehearsal(int index) - { - var agentAddress = default(Address); - var avatarAddress = _agentAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CreateAvatar2.DeriveFormat, - index - ) - ); - - var action = new CreateAvatar7() - { - index = index, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - avatarAddress.Derive(LegacyInventoryKey), - avatarAddress.Derive(LegacyQuestListKey), - avatarAddress.Derive(LegacyWorldInformationKey), - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void Serialize_With_DotnetAPI() { diff --git a/.Lib9c.Tests/Action/CreateAvatar8Test.cs b/.Lib9c.Tests/Action/CreateAvatar8Test.cs index c8d8fba49c..4d484beeb0 100644 --- a/.Lib9c.Tests/Action/CreateAvatar8Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar8Test.cs @@ -212,71 +212,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Theory] - [InlineData(0)] - [InlineData(1)] - [InlineData(2)] - public void Rehearsal(int index) - { - var agentAddress = default(Address); - var avatarAddress = _agentAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CreateAvatar2.DeriveFormat, - index - ) - ); - - var action = new CreateAvatar8() - { - index = index, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - avatarAddress.Derive(LegacyInventoryKey), - avatarAddress.Derive(LegacyQuestListKey), - avatarAddress.Derive(LegacyWorldInformationKey), - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void Serialize_With_DotnetAPI() { diff --git a/.Lib9c.Tests/Action/CreateAvatar9Test.cs b/.Lib9c.Tests/Action/CreateAvatar9Test.cs index 32e9d10dc8..fb2da04642 100644 --- a/.Lib9c.Tests/Action/CreateAvatar9Test.cs +++ b/.Lib9c.Tests/Action/CreateAvatar9Test.cs @@ -239,71 +239,6 @@ public void ExecuteThrowAvatarIndexAlreadyUsedException(int index) ); } - [Theory] - [InlineData(0)] - [InlineData(1)] - [InlineData(2)] - public void Rehearsal(int index) - { - var agentAddress = default(Address); - var avatarAddress = _agentAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CreateAvatar2.DeriveFormat, - index - ) - ); - - var action = new CreateAvatar9() - { - index = index, - hair = 0, - ear = 0, - lens = 0, - tail = 0, - name = "test", - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - avatarAddress.Derive(LegacyInventoryKey), - avatarAddress.Derive(LegacyQuestListKey), - avatarAddress.Derive(LegacyWorldInformationKey), - }; - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - updatedAddresses.Add(slotAddress); - } - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal( - updatedAddresses.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } - [Fact] public void Serialize_With_DotnetAPI() { diff --git a/.Lib9c.Tests/Action/DailyReward4Test.cs b/.Lib9c.Tests/Action/DailyReward4Test.cs index b428880f4e..4fa13eb6e7 100644 --- a/.Lib9c.Tests/Action/DailyReward4Test.cs +++ b/.Lib9c.Tests/Action/DailyReward4Test.cs @@ -118,33 +118,5 @@ public void ExecuteThrowFailedLoadStateException() }) ); } - - [Fact] - public void Rehearsal() - { - var action = new DailyReward4 - { - avatarAddress = _avatarAddress, - }; - - var nextState = action.Execute(new ActionContext - { - BlockIndex = 0, - PreviousState = new Account(MockState.Empty), - RandomSeed = 0, - Rehearsal = true, - Signer = _agentAddress, - }); - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/DailyReward5Test.cs b/.Lib9c.Tests/Action/DailyReward5Test.cs index 2a43430b37..0fdd70f9ea 100644 --- a/.Lib9c.Tests/Action/DailyReward5Test.cs +++ b/.Lib9c.Tests/Action/DailyReward5Test.cs @@ -58,31 +58,6 @@ public DailyReward5Test(ITestOutputHelper outputHelper) .SetState(_avatarAddress, avatarState.Serialize()); } - [Fact] - public void Rehearsal() - { - var action = new DailyReward5 - { - avatarAddress = _avatarAddress, - }; - - var nextState = action.Execute(new ActionContext - { - BlockIndex = 0, - PreviousState = new Account(MockState.Empty), - RandomSeed = 0, - Rehearsal = true, - Signer = _agentAddress, - }); - - var updatedAddresses = new List
- { - _avatarAddress, - }; - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(1)] [InlineData(2)] diff --git a/.Lib9c.Tests/Action/DailyReward6Test.cs b/.Lib9c.Tests/Action/DailyReward6Test.cs index 97bd465914..1b344d4d82 100644 --- a/.Lib9c.Tests/Action/DailyReward6Test.cs +++ b/.Lib9c.Tests/Action/DailyReward6Test.cs @@ -60,34 +60,6 @@ public DailyReward6Test(ITestOutputHelper outputHelper) .SetState(_avatarAddress, avatarState.Serialize()); } - [Fact] - public void Rehearsal() - { - var action = new DailyReward6 - { - avatarAddress = _avatarAddress, - }; - - var nextState = action.Execute(new ActionContext - { - BlockIndex = 0, - PreviousState = new Account(MockState.Empty), - RandomSeed = 0, - Rehearsal = true, - Signer = _agentAddress, - }); - - var updatedAddresses = new List
- { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(1)] [InlineData(2)] diff --git a/.Lib9c.Tests/Action/DailyRewardTest.cs b/.Lib9c.Tests/Action/DailyRewardTest.cs index 8c00f14f11..d07eac4d56 100644 --- a/.Lib9c.Tests/Action/DailyRewardTest.cs +++ b/.Lib9c.Tests/Action/DailyRewardTest.cs @@ -58,27 +58,6 @@ public DailyRewardTest(ITestOutputHelper outputHelper) .SetState(_avatarAddress, avatarState.Serialize()); } - [Fact] - public void Rehearsal() - { - var action = new DailyReward - { - avatarAddress = _avatarAddress, - }; - - var nextState = action.Execute(new ActionContext - { - BlockIndex = 0, - PreviousState = new Account(MockState.Empty), - RandomSeed = 0, - Rehearsal = true, - Signer = _agentAddress, - }); - - var updatedAddress = Assert.Single(nextState.Delta.UpdatedAddresses); - Assert.Equal(_avatarAddress, updatedAddress); - } - [Theory] [InlineData(true)] [InlineData(false)] diff --git a/.Lib9c.Tests/Action/HackAndSlash0Test.cs b/.Lib9c.Tests/Action/HackAndSlash0Test.cs index 76da9db97e..6c64e632a4 100644 --- a/.Lib9c.Tests/Action/HackAndSlash0Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash0Test.cs @@ -567,42 +567,6 @@ public void ExecuteThrowNotEnoughActionPointException() SerializeException(exec); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash0() - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - WeeklyArenaAddress = _weeklyArenaState.address, - RankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _weeklyArenaState.address, - _rankingMapAddress, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void SerializeWithDotnetAPI() { diff --git a/.Lib9c.Tests/Action/HackAndSlash10Test.cs b/.Lib9c.Tests/Action/HackAndSlash10Test.cs index 6e8f371f6b..a05f433b14 100644 --- a/.Lib9c.Tests/Action/HackAndSlash10Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash10Test.cs @@ -1102,44 +1102,6 @@ x.item is IFungibleItem ownedFungibleItem && Assert.InRange(totalCount, totalMin, totalMax); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash10 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - rankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/HackAndSlash11Test.cs b/.Lib9c.Tests/Action/HackAndSlash11Test.cs index 9887b3cf9b..136de735b0 100644 --- a/.Lib9c.Tests/Action/HackAndSlash11Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash11Test.cs @@ -1048,42 +1048,6 @@ x.item is IFungibleItem ownedFungibleItem && Assert.InRange(totalCount, totalMin, totalMax); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash11 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/HackAndSlash12Test.cs b/.Lib9c.Tests/Action/HackAndSlash12Test.cs index 0b81fb66c6..95c9fe5f39 100644 --- a/.Lib9c.Tests/Action/HackAndSlash12Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash12Test.cs @@ -1044,42 +1044,6 @@ x.item is IFungibleItem ownedFungibleItem && Assert.InRange(totalCount, totalMin, totalMax); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash12 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - }; - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/HackAndSlash13Test.cs b/.Lib9c.Tests/Action/HackAndSlash13Test.cs index 049c39f8a1..1194844368 100644 --- a/.Lib9c.Tests/Action/HackAndSlash13Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash13Test.cs @@ -1083,41 +1083,6 @@ x.item is IFungibleItem ownedFungibleItem && Assert.InRange(totalCount, totalMin, totalMax); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash13 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - }; - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/HackAndSlash2Test.cs b/.Lib9c.Tests/Action/HackAndSlash2Test.cs index b3a70bd2cf..cc18f27730 100644 --- a/.Lib9c.Tests/Action/HackAndSlash2Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash2Test.cs @@ -576,42 +576,6 @@ public void ExecuteThrowNotEnoughActionPointException() SerializeException(exec); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash2() - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - WeeklyArenaAddress = _weeklyArenaState.address, - RankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _weeklyArenaState.address, - _rankingMapAddress, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void SerializeWithDotnetAPI() { diff --git a/.Lib9c.Tests/Action/HackAndSlash6Test.cs b/.Lib9c.Tests/Action/HackAndSlash6Test.cs index fc05276a55..b104abcfd7 100644 --- a/.Lib9c.Tests/Action/HackAndSlash6Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash6Test.cs @@ -786,45 +786,6 @@ public void ExecuteThrowNotEnoughActionPointException() SerializeException(exec); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash6 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - WeeklyArenaAddress = _weeklyArenaState.address, - RankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _weeklyArenaState.address, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/HackAndSlash7Test.cs b/.Lib9c.Tests/Action/HackAndSlash7Test.cs index cf656faddc..0250496732 100644 --- a/.Lib9c.Tests/Action/HackAndSlash7Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash7Test.cs @@ -849,45 +849,6 @@ public void ExecuteThrowNotEnoughActionPointException() SerializeException(exec); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash7 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - WeeklyArenaAddress = _weeklyArenaState.address, - RankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _weeklyArenaState.address, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/HackAndSlash8Test.cs b/.Lib9c.Tests/Action/HackAndSlash8Test.cs index 38ff5fcae7..034c6e71db 100644 --- a/.Lib9c.Tests/Action/HackAndSlash8Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash8Test.cs @@ -832,43 +832,6 @@ public void ExecuteThrowNotEnoughActionPointException() SerializeException(exec); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash8 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - rankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/HackAndSlash9Test.cs b/.Lib9c.Tests/Action/HackAndSlash9Test.cs index 4081e2deea..18ba2738db 100644 --- a/.Lib9c.Tests/Action/HackAndSlash9Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash9Test.cs @@ -1125,44 +1125,6 @@ x.item is IFungibleItem ownedFungibleItem && Assert.InRange(totalCount, totalMin, totalMax); } - [Fact] - public void Rehearsal() - { - var action = new HackAndSlash9 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - rankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private static void SerializeException(Exception exec) where T : Exception { diff --git a/.Lib9c.Tests/Action/ItemEnhancement0Test.cs b/.Lib9c.Tests/Action/ItemEnhancement0Test.cs index 0a984a61df..c727b0d247 100644 --- a/.Lib9c.Tests/Action/ItemEnhancement0Test.cs +++ b/.Lib9c.Tests/Action/ItemEnhancement0Test.cs @@ -473,49 +473,5 @@ public void ResultModelDeterministic() Assert.Equal(result.Serialize(), result2.Serialize()); } - - [Fact] - public void Rehearsal() - { - var agentAddress = default(Address); - var avatarAddress = agentAddress.Derive("avatar"); - var slotAddress = - avatarAddress.Derive(string.Format(CultureInfo.InvariantCulture, CombinationSlotState.DeriveFormat, 0)); - - var action = new ItemEnhancement0() - { - itemId = default, - materialIds = new[] { Guid.NewGuid() }, - avatarAddress = avatarAddress, - slotIndex = 0, - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - slotAddress, - Addresses.GoldCurrency, - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty) - .SetState(GoldCurrencyState.Address, gold.Serialize()); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/ItemEnhancement10Test.cs b/.Lib9c.Tests/Action/ItemEnhancement10Test.cs index fa4858986d..7b99927584 100644 --- a/.Lib9c.Tests/Action/ItemEnhancement10Test.cs +++ b/.Lib9c.Tests/Action/ItemEnhancement10Test.cs @@ -197,48 +197,6 @@ public void Execute(int level, int expectedGold, bool backward) Assert.Equal(costRow.Cost, slotResult.gold); } - [Fact] - public void Rehearsal() - { - var action = new ItemEnhancement10() - { - itemId = default, - materialId = default, - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - ItemEnhancement10.GetFeeStoreAddress(), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void Execute_ActionObsoletedException() { diff --git a/.Lib9c.Tests/Action/ItemEnhancement2Test.cs b/.Lib9c.Tests/Action/ItemEnhancement2Test.cs index 6fb8fd0268..d7f6c9864d 100644 --- a/.Lib9c.Tests/Action/ItemEnhancement2Test.cs +++ b/.Lib9c.Tests/Action/ItemEnhancement2Test.cs @@ -438,49 +438,5 @@ public void ResultModelDeterministic() Assert.Equal(result.Serialize(), result2.Serialize()); } - - [Fact] - public void Rehearsal() - { - var agentAddress = default(Address); - var avatarAddress = agentAddress.Derive("avatar"); - var slotAddress = - avatarAddress.Derive(string.Format(CultureInfo.InvariantCulture, CombinationSlotState.DeriveFormat, 0)); - - var action = new ItemEnhancement2() - { - itemId = default, - materialId = Guid.NewGuid(), - avatarAddress = avatarAddress, - slotIndex = 0, - }; - -#pragma warning disable CS0618 - // Use of obsolete method Currency.Legacy(): https://github.com/planetarium/lib9c/discussions/1319 - var gold = new GoldCurrencyState(Currency.Legacy("NCG", 2, null)); -#pragma warning restore CS0618 - - var updatedAddresses = new List
() - { - agentAddress, - avatarAddress, - slotAddress, - Addresses.GoldCurrency, - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty) - .SetState(GoldCurrencyState.Address, gold.Serialize()); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/ItemEnhancement7Test.cs b/.Lib9c.Tests/Action/ItemEnhancement7Test.cs index 54c3426fca..ba9891dc3d 100644 --- a/.Lib9c.Tests/Action/ItemEnhancement7Test.cs +++ b/.Lib9c.Tests/Action/ItemEnhancement7Test.cs @@ -165,47 +165,5 @@ public void Execute(int level, int expectedLevel, int expectedGold, bool backwar Assert.Equal(costRow.Cost, slotResult.gold); } - - [Fact] - public void Rehearsal() - { - var action = new ItemEnhancement7() - { - itemId = default, - materialId = default, - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/ItemEnhancement8Test.cs b/.Lib9c.Tests/Action/ItemEnhancement8Test.cs index f46c0044b2..a6dea2ac17 100644 --- a/.Lib9c.Tests/Action/ItemEnhancement8Test.cs +++ b/.Lib9c.Tests/Action/ItemEnhancement8Test.cs @@ -165,47 +165,5 @@ public void Execute(int level, int expectedLevel, int expectedGold, bool backwar Assert.Equal(costRow.Cost, slotResult.gold); } - - [Fact] - public void Rehearsal() - { - var action = new ItemEnhancement8 - { - itemId = default, - materialId = default, - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/ItemEnhancement9Test.cs b/.Lib9c.Tests/Action/ItemEnhancement9Test.cs index 70c29fdd2c..a6005c80eb 100644 --- a/.Lib9c.Tests/Action/ItemEnhancement9Test.cs +++ b/.Lib9c.Tests/Action/ItemEnhancement9Test.cs @@ -190,47 +190,5 @@ public void Execute(int level, int expectedGold, bool backward) Assert.Equal(preItemUsable.ItemId, resultEquipment.ItemId); Assert.Equal(costRow.Cost, slotResult.gold); } - - [Fact] - public void Rehearsal() - { - var action = new ItemEnhancement9() - { - itemId = default, - materialId = default, - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/RankingBattle10Test.cs b/.Lib9c.Tests/Action/RankingBattle10Test.cs index 0a9b613ae2..e142848af9 100644 --- a/.Lib9c.Tests/Action/RankingBattle10Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle10Test.cs @@ -456,40 +456,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() }); } - [Fact] - public void Rehearsal() - { - var action = new RankingBattle10 - { - avatarAddress = _avatar1Address, - enemyAddress = _avatar2Address, - weeklyArenaAddress = _weeklyArenaAddress, - costumeIds = new List(), - equipmentIds = new List(), - }; - - var updatedAddresses = new List
- { - _avatar1Address, - _weeklyArenaAddress, - _avatar1Address.Derive(LegacyInventoryKey), - _avatar1Address.Derive(LegacyWorldInformationKey), - _avatar1Address.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agent1Address, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(ItemSubType.Weapon, GameConfig.MaxEquipmentSlotCount.Weapon)] [InlineData(ItemSubType.Armor, GameConfig.MaxEquipmentSlotCount.Armor)] diff --git a/.Lib9c.Tests/Action/RankingBattle11Test.cs b/.Lib9c.Tests/Action/RankingBattle11Test.cs index 05930913ec..112d594f6f 100644 --- a/.Lib9c.Tests/Action/RankingBattle11Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle11Test.cs @@ -658,40 +658,6 @@ public void Execute_Throw_NotEnoughAvatarLevelException(int avatarLevel) } } - [Fact] - public void Rehearsal() - { - var action = new RankingBattle11 - { - avatarAddress = _avatar1Address, - enemyAddress = _avatar2Address, - weeklyArenaAddress = _weeklyArenaAddress, - costumeIds = new List(), - equipmentIds = new List(), - }; - - var updatedAddresses = new List
- { - _avatar1Address, - _weeklyArenaAddress, - _avatar1Address.Derive(LegacyInventoryKey), - _avatar1Address.Derive(LegacyWorldInformationKey), - _avatar1Address.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agent1Address, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(ItemSubType.Weapon, GameConfig.MaxEquipmentSlotCount.Weapon)] [InlineData(ItemSubType.Armor, GameConfig.MaxEquipmentSlotCount.Armor)] diff --git a/.Lib9c.Tests/Action/RankingBattle5Test.cs b/.Lib9c.Tests/Action/RankingBattle5Test.cs index 3dc4255b8b..31eb8a4b63 100644 --- a/.Lib9c.Tests/Action/RankingBattle5Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle5Test.cs @@ -420,41 +420,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() }); } - [Fact] - public void Rehearsal() - { - var action = new RankingBattle5 - { - AvatarAddress = _avatar1Address, - EnemyAddress = _avatar2Address, - WeeklyArenaAddress = _weeklyArenaAddress, - costumeIds = new List(), - equipmentIds = new List(), - consumableIds = new List(), - }; - - var updatedAddresses = new List
() - { - _avatar1Address, - _weeklyArenaAddress, - _avatar1Address.Derive(LegacyInventoryKey), - _avatar1Address.Derive(LegacyWorldInformationKey), - _avatar1Address.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agent1Address, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void SerializeWithDotnetAPI() { diff --git a/.Lib9c.Tests/Action/RankingBattle6Test.cs b/.Lib9c.Tests/Action/RankingBattle6Test.cs index 6cefff07b3..870870629d 100644 --- a/.Lib9c.Tests/Action/RankingBattle6Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle6Test.cs @@ -420,41 +420,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() }); } - [Fact] - public void Rehearsal() - { - var action = new RankingBattle6 - { - avatarAddress = _avatar1Address, - enemyAddress = _avatar2Address, - weeklyArenaAddress = _weeklyArenaAddress, - costumeIds = new List(), - equipmentIds = new List(), - consumableIds = new List(), - }; - - var updatedAddresses = new List
() - { - _avatar1Address, - _weeklyArenaAddress, - _avatar1Address.Derive(LegacyInventoryKey), - _avatar1Address.Derive(LegacyWorldInformationKey), - _avatar1Address.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agent1Address, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void SerializeWithDotnetAPI() { diff --git a/.Lib9c.Tests/Action/RankingBattle7Test.cs b/.Lib9c.Tests/Action/RankingBattle7Test.cs index f893b4deed..6a28b39206 100644 --- a/.Lib9c.Tests/Action/RankingBattle7Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle7Test.cs @@ -420,41 +420,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() }); } - [Fact] - public void Rehearsal() - { - var action = new RankingBattle7 - { - avatarAddress = _avatar1Address, - enemyAddress = _avatar2Address, - weeklyArenaAddress = _weeklyArenaAddress, - costumeIds = new List(), - equipmentIds = new List(), - consumableIds = new List(), - }; - - var updatedAddresses = new List
() - { - _avatar1Address, - _weeklyArenaAddress, - _avatar1Address.Derive(LegacyInventoryKey), - _avatar1Address.Derive(LegacyWorldInformationKey), - _avatar1Address.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agent1Address, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void SerializeWithDotnetAPI() { diff --git a/.Lib9c.Tests/Action/RankingBattle8Test.cs b/.Lib9c.Tests/Action/RankingBattle8Test.cs index aa01036a0f..f8c710ad08 100644 --- a/.Lib9c.Tests/Action/RankingBattle8Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle8Test.cs @@ -457,41 +457,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() }); } - [Fact] - public void Rehearsal() - { - var action = new RankingBattle8 - { - avatarAddress = _avatar1Address, - enemyAddress = _avatar2Address, - weeklyArenaAddress = _weeklyArenaAddress, - costumeIds = new List(), - equipmentIds = new List(), - consumableIds = new List(), - }; - - var updatedAddresses = new List
() - { - _avatar1Address, - _weeklyArenaAddress, - _avatar1Address.Derive(LegacyInventoryKey), - _avatar1Address.Derive(LegacyWorldInformationKey), - _avatar1Address.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agent1Address, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(ItemSubType.Weapon, GameConfig.MaxEquipmentSlotCount.Weapon)] [InlineData(ItemSubType.Armor, GameConfig.MaxEquipmentSlotCount.Armor)] diff --git a/.Lib9c.Tests/Action/RankingBattle9Test.cs b/.Lib9c.Tests/Action/RankingBattle9Test.cs index 28ab7acfba..181bf157ce 100644 --- a/.Lib9c.Tests/Action/RankingBattle9Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle9Test.cs @@ -457,41 +457,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() }); } - [Fact] - public void Rehearsal() - { - var action = new RankingBattle9 - { - avatarAddress = _avatar1Address, - enemyAddress = _avatar2Address, - weeklyArenaAddress = _weeklyArenaAddress, - costumeIds = new List(), - equipmentIds = new List(), - consumableIds = new List(), - }; - - var updatedAddresses = new List
() - { - _avatar1Address, - _weeklyArenaAddress, - _avatar1Address.Derive(LegacyInventoryKey), - _avatar1Address.Derive(LegacyWorldInformationKey), - _avatar1Address.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agent1Address, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(ItemSubType.Weapon, GameConfig.MaxEquipmentSlotCount.Weapon)] [InlineData(ItemSubType.Armor, GameConfig.MaxEquipmentSlotCount.Armor)] diff --git a/.Lib9c.Tests/Action/Sell10Test.cs b/.Lib9c.Tests/Action/Sell10Test.cs index a52c45926e..16819ff046 100644 --- a/.Lib9c.Tests/Action/Sell10Test.cs +++ b/.Lib9c.Tests/Action/Sell10Test.cs @@ -413,46 +413,5 @@ public void Execute_Throw_DuplicateOrderIdException() RandomSeed = 0, })); } - - [Fact] - public void Rehearsal() - { - Guid tradableId = Guid.NewGuid(); - Guid orderId = Guid.NewGuid(); - var action = new Sell10 - { - sellerAvatarAddress = _avatarAddress, - tradableId = tradableId, - count = 1, - price = _currency * ProductPrice, - itemSubType = ItemSubType.Weapon, - orderId = orderId, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/Sell11Test.cs b/.Lib9c.Tests/Action/Sell11Test.cs index b6dba51038..3fa8503515 100644 --- a/.Lib9c.Tests/Action/Sell11Test.cs +++ b/.Lib9c.Tests/Action/Sell11Test.cs @@ -461,46 +461,5 @@ public void Execute_Throw_DuplicateOrderIdException() RandomSeed = 0, })); } - - [Fact] - public void Rehearsal() - { - Guid tradableId = Guid.NewGuid(); - Guid orderId = Guid.NewGuid(); - var action = new Sell11 - { - sellerAvatarAddress = _avatarAddress, - tradableId = tradableId, - count = 1, - price = _currency * ProductPrice, - itemSubType = ItemSubType.Weapon, - orderId = orderId, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/Sell7Test.cs b/.Lib9c.Tests/Action/Sell7Test.cs index 35dc1b1eb5..8db0beadec 100644 --- a/.Lib9c.Tests/Action/Sell7Test.cs +++ b/.Lib9c.Tests/Action/Sell7Test.cs @@ -436,46 +436,5 @@ public void Execute_Throw_DuplicateOrderIdException() RandomSeed = 0, })); } - - [Fact] - public void Rehearsal() - { - Guid tradableId = Guid.NewGuid(); - Guid orderId = Guid.NewGuid(); - var action = new Sell7 - { - sellerAvatarAddress = _avatarAddress, - tradableId = tradableId, - count = 1, - price = _currency * ProductPrice, - itemSubType = ItemSubType.Weapon, - orderId = orderId, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/Sell8Test.cs b/.Lib9c.Tests/Action/Sell8Test.cs index 3d7b876a14..04299495e2 100644 --- a/.Lib9c.Tests/Action/Sell8Test.cs +++ b/.Lib9c.Tests/Action/Sell8Test.cs @@ -429,46 +429,5 @@ public void Execute_Throw_DuplicateOrderIdException() RandomSeed = 0, })); } - - [Fact] - public void Rehearsal() - { - Guid tradableId = Guid.NewGuid(); - Guid orderId = Guid.NewGuid(); - var action = new Sell8 - { - sellerAvatarAddress = _avatarAddress, - tradableId = tradableId, - count = 1, - price = _currency * ProductPrice, - itemSubType = ItemSubType.Weapon, - orderId = orderId, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/Sell9Test.cs b/.Lib9c.Tests/Action/Sell9Test.cs index ffd3f315e6..295387c8d3 100644 --- a/.Lib9c.Tests/Action/Sell9Test.cs +++ b/.Lib9c.Tests/Action/Sell9Test.cs @@ -413,46 +413,5 @@ public void Execute_Throw_DuplicateOrderIdException() RandomSeed = 0, })); } - - [Fact] - public void Rehearsal() - { - Guid tradableId = Guid.NewGuid(); - Guid orderId = Guid.NewGuid(); - var action = new Sell9 - { - sellerAvatarAddress = _avatarAddress, - tradableId = tradableId, - count = 1, - price = _currency * ProductPrice, - itemSubType = ItemSubType.Weapon, - orderId = orderId, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/SellCancellation7Test.cs b/.Lib9c.Tests/Action/SellCancellation7Test.cs index bc8ea89e6a..e7ff546836 100644 --- a/.Lib9c.Tests/Action/SellCancellation7Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation7Test.cs @@ -452,41 +452,6 @@ public void Execute_Throw_InvalidAddressException(bool useAgentAddress, bool use ); } - [Fact] - public void Rehearsal() - { - var action = new SellCancellation7() - { - sellerAvatarAddress = _avatarAddress, - orderId = default, - itemSubType = ItemSubType.Weapon, - tradableId = default, - }; - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, default(Guid)), - OrderDigestListState.DeriveAddress(_avatarAddress), - Addresses.GetItemAddress(default), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void PlainValue() { diff --git a/.Lib9c.Tests/Action/SellCancellation8Test.cs b/.Lib9c.Tests/Action/SellCancellation8Test.cs index ac2c937697..f44991a04d 100644 --- a/.Lib9c.Tests/Action/SellCancellation8Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation8Test.cs @@ -473,41 +473,6 @@ public void Execute_Throw_InvalidAddressException(bool useAgentAddress, bool use ); } - [Fact] - public void Rehearsal() - { - var action = new SellCancellation8() - { - sellerAvatarAddress = _avatarAddress, - orderId = default, - itemSubType = ItemSubType.Weapon, - tradableId = default, - }; - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, default(Guid)), - OrderDigestListState.DeriveAddress(_avatarAddress), - Addresses.GetItemAddress(default), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void PlainValue() { diff --git a/.Lib9c.Tests/Action/SellCancellationTest.cs b/.Lib9c.Tests/Action/SellCancellationTest.cs index 8d78836f14..97c76c6170 100644 --- a/.Lib9c.Tests/Action/SellCancellationTest.cs +++ b/.Lib9c.Tests/Action/SellCancellationTest.cs @@ -508,41 +508,6 @@ public void Execute_Throw_InvalidAddressException(bool useAgentAddress, bool use ); } - [Fact] - public void Rehearsal() - { - var action = new SellCancellation() - { - sellerAvatarAddress = _avatarAddress, - orderId = default, - itemSubType = ItemSubType.Weapon, - tradableId = default, - }; - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, default(Guid)), - OrderDigestListState.DeriveAddress(_avatarAddress), - Addresses.GetItemAddress(default), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void PlainValue() { diff --git a/.Lib9c.Tests/Action/SellTest.cs b/.Lib9c.Tests/Action/SellTest.cs index 7aaea10de4..22255b68fd 100644 --- a/.Lib9c.Tests/Action/SellTest.cs +++ b/.Lib9c.Tests/Action/SellTest.cs @@ -460,46 +460,5 @@ public void Execute_Throw_DuplicateOrderIdException() RandomSeed = 0, })); } - - [Fact] - public void Rehearsal() - { - Guid tradableId = Guid.NewGuid(); - Guid orderId = Guid.NewGuid(); - var action = new Sell - { - sellerAvatarAddress = _avatarAddress, - tradableId = tradableId, - count = 1, - price = _currency * ProductPrice, - itemSubType = ItemSubType.Weapon, - orderId = orderId, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/TransferAsset2Test.cs b/.Lib9c.Tests/Action/TransferAsset2Test.cs index b72d090c97..e3257f6ce7 100644 --- a/.Lib9c.Tests/Action/TransferAsset2Test.cs +++ b/.Lib9c.Tests/Action/TransferAsset2Test.cs @@ -254,35 +254,6 @@ public void ExecuteWithUnactivatedRecipient() Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAsset2( - sender: _sender, - recipient: _recipient, - amount: _currency * 100 - ); - - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency }, - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] diff --git a/.Lib9c.Tests/Action/TransferAsset3Test.cs b/.Lib9c.Tests/Action/TransferAsset3Test.cs index 8ee2eed304..00e49e17d9 100644 --- a/.Lib9c.Tests/Action/TransferAsset3Test.cs +++ b/.Lib9c.Tests/Action/TransferAsset3Test.cs @@ -277,35 +277,6 @@ public void ExecuteWithUnactivatedRecipient() Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAsset3( - sender: _sender, - recipient: _recipient, - amount: _currency * 100 - ); - - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency }, - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] diff --git a/.Lib9c.Tests/Action/TransferAsset4Test.cs b/.Lib9c.Tests/Action/TransferAsset4Test.cs index 528bac61bc..089638deef 100644 --- a/.Lib9c.Tests/Action/TransferAsset4Test.cs +++ b/.Lib9c.Tests/Action/TransferAsset4Test.cs @@ -197,36 +197,6 @@ public void Execute_Throw_InvalidTransferMinterException(bool minterAsSender) Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAsset4( - sender: _sender, - recipient: _recipient, - amount: _currency * 100 - ); - - var context = new ActionContext(); - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty).MintAsset(context, _sender, Currencies.Mead * 1), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency, Currencies.Mead, }.ToImmutableHashSet(), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] diff --git a/.Lib9c.Tests/Action/TransferAssetTest.cs b/.Lib9c.Tests/Action/TransferAssetTest.cs index b2a2a52f87..9b8ed9a1f1 100644 --- a/.Lib9c.Tests/Action/TransferAssetTest.cs +++ b/.Lib9c.Tests/Action/TransferAssetTest.cs @@ -200,36 +200,6 @@ public void Execute_Throw_InvalidTransferMinterException(bool minterAsSender) Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAsset( - sender: _sender, - recipient: _recipient, - amount: _currency * 100 - ); - - var context = new ActionContext(); - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty).MintAsset(context, _sender, Currencies.Mead * 1), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency, Currencies.Mead, }.ToImmutableHashSet(), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] diff --git a/.Lib9c.Tests/Action/TransferAssetTest0.cs b/.Lib9c.Tests/Action/TransferAssetTest0.cs index 049a7b5682..791fd24ff2 100644 --- a/.Lib9c.Tests/Action/TransferAssetTest0.cs +++ b/.Lib9c.Tests/Action/TransferAssetTest0.cs @@ -223,35 +223,6 @@ public void ExecuteWithMinterAsRecipient() Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAsset0( - sender: _sender, - recipient: _recipient, - amount: _currency * 100 - ); - - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency }, - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] diff --git a/.Lib9c.Tests/Action/TransferAssets0Test.cs b/.Lib9c.Tests/Action/TransferAssets0Test.cs index 12b0268ed7..66d9189372 100644 --- a/.Lib9c.Tests/Action/TransferAssets0Test.cs +++ b/.Lib9c.Tests/Action/TransferAssets0Test.cs @@ -311,37 +311,6 @@ public void ExecuteWithUnactivatedRecipient() Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAssets0( - sender: _sender, - new List<(Address, FungibleAssetValue)> - { - (_recipient, _currency * 100), - } - ); - - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency }, - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] diff --git a/.Lib9c.Tests/Action/TransferAssets2Test.cs b/.Lib9c.Tests/Action/TransferAssets2Test.cs index f8a55370be..0573f40501 100644 --- a/.Lib9c.Tests/Action/TransferAssets2Test.cs +++ b/.Lib9c.Tests/Action/TransferAssets2Test.cs @@ -221,37 +221,6 @@ public void Execute_Throw_InvalidTransferMinterException() Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAssets2( - sender: _sender, - new List<(Address, FungibleAssetValue)> - { - (_recipient, _currency * 100), - } - ); - - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency }, - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] diff --git a/.Lib9c.Tests/Action/TransferAssetsTest.cs b/.Lib9c.Tests/Action/TransferAssetsTest.cs index 9387ea87be..89757df3de 100644 --- a/.Lib9c.Tests/Action/TransferAssetsTest.cs +++ b/.Lib9c.Tests/Action/TransferAssetsTest.cs @@ -223,37 +223,6 @@ public void Execute_Throw_InvalidTransferMinterException() Assert.Equal(_recipient, ex.Recipient); } - [Fact] - public void Rehearsal() - { - var action = new TransferAssets( - sender: _sender, - new List<(Address, FungibleAssetValue)> - { - (_recipient, _currency * 100), - } - ); - - IAccount nextState = action.Execute(new ActionContext() - { - PreviousState = new Account(MockState.Empty), - Signer = default, - Rehearsal = true, - BlockIndex = 1, - }); - - Assert.Equal( - ImmutableHashSet.Create( - _sender, - _recipient - ), - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item1).ToImmutableHashSet() - ); - Assert.Equal( - new[] { _currency }, - nextState.Delta.UpdatedFungibleAssets.Select(pair => pair.Item2).ToImmutableHashSet()); - } - [Theory] [InlineData(null)] [InlineData("Nine Chronicles")] From 12687670467439ca3f9fd4e5fa86b472270ac21f Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Sat, 11 Nov 2023 09:30:56 +0900 Subject: [PATCH 05/19] Partial removal of rehearsal from actions --- Lib9c/Action/ActivateAccount.cs | 6 ----- Lib9c/Action/ActivateAccount0.cs | 7 ------ Lib9c/Action/AddActivatedAccount.cs | 6 ----- Lib9c/Action/AddActivatedAccount0.cs | 6 ----- Lib9c/Action/Buy.cs | 5 ---- Lib9c/Action/Buy0.cs | 14 ----------- Lib9c/Action/Buy10.cs | 35 ---------------------------- Lib9c/Action/Buy11.cs | 35 ---------------------------- Lib9c/Action/Buy2.cs | 14 ----------- Lib9c/Action/Buy3.cs | 14 ----------- Lib9c/Action/Buy4.cs | 14 ----------- Lib9c/Action/Buy5.cs | 21 ----------------- Lib9c/Action/Buy6.cs | 21 ----------------- Lib9c/Action/Buy7.cs | 21 ----------------- Lib9c/Action/Buy8.cs | 35 ---------------------------- Lib9c/Action/Buy9.cs | 35 ---------------------------- Lib9c/Action/CreateAvatar.cs | 22 ----------------- Lib9c/Action/CreateAvatar0.cs | 20 ---------------- Lib9c/Action/CreateAvatar10.cs | 22 ----------------- Lib9c/Action/CreateAvatar2.cs | 20 ---------------- Lib9c/Action/CreateAvatar3.cs | 23 ------------------ Lib9c/Action/CreateAvatar4.cs | 23 ------------------ Lib9c/Action/CreateAvatar5.cs | 23 ------------------ Lib9c/Action/CreateAvatar6.cs | 23 ------------------ Lib9c/Action/CreateAvatar7.cs | 21 ----------------- Lib9c/Action/CreateAvatar8.cs | 22 ----------------- Lib9c/Action/CreateAvatar9.cs | 22 ----------------- Lib9c/Action/DailyReward0.cs | 4 ---- Lib9c/Action/DailyReward2.cs | 4 ---- Lib9c/Action/DailyReward3.cs | 4 ---- Lib9c/Action/DailyReward4.cs | 8 ------- Lib9c/Action/HackAndSlash.cs | 5 ---- Lib9c/Action/HackAndSlash0.cs | 7 ------ Lib9c/Action/HackAndSlash10.cs | 10 -------- Lib9c/Action/HackAndSlash11.cs | 9 ------- Lib9c/Action/HackAndSlash12.cs | 9 ------- Lib9c/Action/HackAndSlash13.cs | 9 ------- Lib9c/Action/HackAndSlash14.cs | 4 ---- Lib9c/Action/HackAndSlash16.cs | 5 ---- Lib9c/Action/HackAndSlash17.cs | 4 ---- Lib9c/Action/HackAndSlash18.cs | 4 ---- Lib9c/Action/HackAndSlash19.cs | 4 ---- Lib9c/Action/HackAndSlash2.cs | 7 ------ Lib9c/Action/HackAndSlash20.cs | 4 ---- Lib9c/Action/HackAndSlash21.cs | 4 ---- Lib9c/Action/HackAndSlash3.cs | 7 ------ Lib9c/Action/HackAndSlash4.cs | 7 ------ Lib9c/Action/HackAndSlash5.cs | 7 ------ Lib9c/Action/HackAndSlash6.cs | 11 --------- Lib9c/Action/HackAndSlash7.cs | 11 --------- Lib9c/Action/HackAndSlash8.cs | 10 -------- Lib9c/Action/HackAndSlash9.cs | 10 -------- Lib9c/Action/ItemEnhancement.cs | 5 ---- Lib9c/Action/ItemEnhancement0.cs | 7 ------ Lib9c/Action/ItemEnhancement10.cs | 10 -------- Lib9c/Action/ItemEnhancement11.cs | 5 ---- Lib9c/Action/ItemEnhancement12.cs | 5 ---- Lib9c/Action/ItemEnhancement13.cs | 5 ---- Lib9c/Action/ItemEnhancement2.cs | 7 ------ Lib9c/Action/ItemEnhancement3.cs | 7 ------ Lib9c/Action/ItemEnhancement4.cs | 7 ------ Lib9c/Action/ItemEnhancement5.cs | 7 ------ Lib9c/Action/ItemEnhancement6.cs | 7 ------ Lib9c/Action/ItemEnhancement7.cs | 10 -------- Lib9c/Action/ItemEnhancement8.cs | 10 -------- Lib9c/Action/ItemEnhancement9.cs | 10 -------- Lib9c/Action/Sell.cs | 13 ----------- Lib9c/Action/Sell0.cs | 6 ----- Lib9c/Action/Sell10.cs | 13 ----------- Lib9c/Action/Sell11.cs | 13 ----------- Lib9c/Action/Sell2.cs | 6 ----- Lib9c/Action/Sell3.cs | 6 ----- Lib9c/Action/Sell4.cs | 9 ------- Lib9c/Action/Sell5.cs | 10 -------- Lib9c/Action/Sell6.cs | 10 -------- Lib9c/Action/Sell7.cs | 13 ----------- Lib9c/Action/Sell8.cs | 13 ----------- Lib9c/Action/Sell9.cs | 13 ----------- Lib9c/Action/SellCancellation0.cs | 5 ---- Lib9c/Action/SellCancellation2.cs | 5 ---- Lib9c/Action/SellCancellation3.cs | 5 ---- Lib9c/Action/SellCancellation4.cs | 5 ---- Lib9c/Action/SellCancellation5.cs | 7 ------ Lib9c/Action/TransferAsset.cs | 5 ---- Lib9c/Action/TransferAsset0.cs | 4 ---- Lib9c/Action/TransferAsset2.cs | 4 ---- Lib9c/Action/TransferAsset3.cs | 4 ---- Lib9c/Action/TransferAsset4.cs | 4 ---- Lib9c/Action/TransferAssets.cs | 4 ---- Lib9c/Action/TransferAssets0.cs | 4 ---- Lib9c/Action/TransferAssets2.cs | 4 ---- 91 files changed, 985 deletions(-) diff --git a/Lib9c/Action/ActivateAccount.cs b/Lib9c/Action/ActivateAccount.cs index d9e16e98a7..9e916e403e 100644 --- a/Lib9c/Action/ActivateAccount.cs +++ b/Lib9c/Action/ActivateAccount.cs @@ -49,12 +49,6 @@ public override IAccount Execute(IActionContext context) IAccount state = context.PreviousState; Address activatedAddress = context.Signer.Derive(ActivationKey.DeriveKey); - if (context.Rehearsal) - { - return state - .SetState(activatedAddress, MarkChanged) - .SetState(PendingAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); if (!(state.GetState(activatedAddress) is null)) diff --git a/Lib9c/Action/ActivateAccount0.cs b/Lib9c/Action/ActivateAccount0.cs index c43341b823..9f2640a22d 100644 --- a/Lib9c/Action/ActivateAccount0.cs +++ b/Lib9c/Action/ActivateAccount0.cs @@ -47,13 +47,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IAccount state = context.PreviousState; - if (context.Rehearsal) - { - return state - .SetState(ActivatedAccountsState.Address, MarkChanged) - .SetState(PendingAddress, MarkChanged); - } - CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); if (!state.TryGetState(ActivatedAccountsState.Address, out Dictionary accountsAsDict)) diff --git a/Lib9c/Action/AddActivatedAccount.cs b/Lib9c/Action/AddActivatedAccount.cs index 962866ab9c..cc71cfca8b 100644 --- a/Lib9c/Action/AddActivatedAccount.cs +++ b/Lib9c/Action/AddActivatedAccount.cs @@ -43,12 +43,6 @@ public override IAccount Execute(IActionContext context) IAccount state = context.PreviousState; var address = Address.Derive(ActivationKey.DeriveKey); - if (context.Rehearsal) - { - return state - .SetState(address, MarkChanged); - } - CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); if (!(state.GetState(address) is null)) { diff --git a/Lib9c/Action/AddActivatedAccount0.cs b/Lib9c/Action/AddActivatedAccount0.cs index 3bb8a12e80..161e857687 100644 --- a/Lib9c/Action/AddActivatedAccount0.cs +++ b/Lib9c/Action/AddActivatedAccount0.cs @@ -41,12 +41,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IAccount state = context.PreviousState; - if (context.Rehearsal) - { - return state - .SetState(ActivatedAccountsState.Address, MarkChanged); - } - if (!state.TryGetState(ActivatedAccountsState.Address, out Dictionary accountsAsDict)) { throw new ActivatedAccountsDoesNotExistsException(); diff --git a/Lib9c/Action/Buy.cs b/Lib9c/Action/Buy.cs index 74718f5c5e..633c171c00 100644 --- a/Lib9c/Action/Buy.cs +++ b/Lib9c/Action/Buy.cs @@ -72,11 +72,6 @@ public override IAccount Execute(IActionContext context) var buyerInventoryAddress = buyerAvatarAddress.Derive(LegacyInventoryKey); var buyerWorldInformationAddress = buyerAvatarAddress.Derive(LegacyWorldInformationKey); var buyerQuestListAddress = buyerAvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, buyerAvatarAddress); var sw = new Stopwatch(); diff --git a/Lib9c/Action/Buy0.cs b/Lib9c/Action/Buy0.cs index b3cc8865ee..81f3c6cb5e 100644 --- a/Lib9c/Action/Buy0.cs +++ b/Lib9c/Action/Buy0.cs @@ -56,20 +56,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - sellerAgentAddress, - GoldCurrencyState.Address); - return states.SetState(ShopState.Address, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy10.cs b/Lib9c/Action/Buy10.cs index b3671edbb5..ff9132eecf 100644 --- a/Lib9c/Action/Buy10.cs +++ b/Lib9c/Action/Buy10.cs @@ -67,41 +67,6 @@ public override IAccount Execute(IActionContext context) var buyerInventoryAddress = buyerAvatarAddress.Derive(LegacyInventoryKey); var buyerWorldInformationAddress = buyerAvatarAddress.Derive(LegacyWorldInformationKey); var buyerQuestListAddress = buyerAvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - foreach (var purchaseInfo in purchaseInfos) - { - var sellerAvatarAddress = purchaseInfo.SellerAvatarAddress; - var sellerInventoryAddress = sellerAvatarAddress.Derive(LegacyInventoryKey); - var sellerWorldInformationAddress = sellerAvatarAddress.Derive(LegacyWorldInformationKey); - var sellerQuestListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); - Address shardedShopAddress = - ShardedShopStateV2.DeriveAddress(purchaseInfo.ItemSubType, purchaseInfo.OrderId); - Address orderReceiptAddress = OrderReceipt.DeriveAddress(purchaseInfo.OrderId); - Address digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - states = states - .SetState(shardedShopAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .SetState(sellerInventoryAddress, MarkChanged) - .SetState(sellerWorldInformationAddress, MarkChanged) - .SetState(sellerQuestListAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(digestListAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - purchaseInfo.SellerAgentAddress, - GoldCurrencyState.Address); - } - - return states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(buyerInventoryAddress, MarkChanged) - .SetState(buyerWorldInformationAddress, MarkChanged) - .SetState(buyerQuestListAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100220ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy11.cs b/Lib9c/Action/Buy11.cs index 594d830a75..b93382a654 100644 --- a/Lib9c/Action/Buy11.cs +++ b/Lib9c/Action/Buy11.cs @@ -72,41 +72,6 @@ public override IAccount Execute(IActionContext context) var buyerInventoryAddress = buyerAvatarAddress.Derive(LegacyInventoryKey); var buyerWorldInformationAddress = buyerAvatarAddress.Derive(LegacyWorldInformationKey); var buyerQuestListAddress = buyerAvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - foreach (var purchaseInfo in purchaseInfos) - { - var sellerAvatarAddress = purchaseInfo.SellerAvatarAddress; - var sellerInventoryAddress = sellerAvatarAddress.Derive(LegacyInventoryKey); - var sellerWorldInformationAddress = sellerAvatarAddress.Derive(LegacyWorldInformationKey); - var sellerQuestListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); - Address shardedShopAddress = - ShardedShopStateV2.DeriveAddress(purchaseInfo.ItemSubType, purchaseInfo.OrderId); - Address orderReceiptAddress = OrderReceipt.DeriveAddress(purchaseInfo.OrderId); - Address digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - states = states - .SetState(shardedShopAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .SetState(sellerInventoryAddress, MarkChanged) - .SetState(sellerWorldInformationAddress, MarkChanged) - .SetState(sellerQuestListAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(digestListAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - purchaseInfo.SellerAgentAddress, - GetFeeStoreAddress()); - } - - return states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(buyerInventoryAddress, MarkChanged) - .SetState(buyerWorldInformationAddress, MarkChanged) - .SetState(buyerQuestListAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var arenaSheetAddress = Addresses.GetSheetAddress(); diff --git a/Lib9c/Action/Buy2.cs b/Lib9c/Action/Buy2.cs index 5d5d7431f6..1ea99d5a0f 100644 --- a/Lib9c/Action/Buy2.cs +++ b/Lib9c/Action/Buy2.cs @@ -57,20 +57,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - sellerAgentAddress, - GoldCurrencyState.Address); - return states.SetState(ShopState.Address, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy3.cs b/Lib9c/Action/Buy3.cs index 4b56538971..043e7c2d38 100644 --- a/Lib9c/Action/Buy3.cs +++ b/Lib9c/Action/Buy3.cs @@ -55,20 +55,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - sellerAgentAddress, - GoldCurrencyState.Address); - return states.SetState(ShopState.Address, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy4.cs b/Lib9c/Action/Buy4.cs index 8d9330e420..03f032a7c4 100644 --- a/Lib9c/Action/Buy4.cs +++ b/Lib9c/Action/Buy4.cs @@ -55,20 +55,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - sellerAgentAddress, - GoldCurrencyState.Address); - return states.SetState(ShopState.Address, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy5.cs b/Lib9c/Action/Buy5.cs index 82ffe31310..c3629de24d 100644 --- a/Lib9c/Action/Buy5.cs +++ b/Lib9c/Action/Buy5.cs @@ -60,27 +60,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - foreach (var purchaseInfo in purchaseInfos) - { - Address shardedShopAddress = - ShardedShopState.DeriveAddress(purchaseInfo.itemSubType, purchaseInfo.productId); - states = states - .SetState(shardedShopAddress, MarkChanged) - .SetState(purchaseInfo.sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - purchaseInfo.sellerAgentAddress, - GoldCurrencyState.Address); - } - return states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(Addresses.Shop, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy6.cs b/Lib9c/Action/Buy6.cs index d9bdcf7969..09ac72ca49 100644 --- a/Lib9c/Action/Buy6.cs +++ b/Lib9c/Action/Buy6.cs @@ -60,27 +60,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - foreach (var purchaseInfo in purchaseInfos) - { - Address shardedShopAddress = - ShardedShopState.DeriveAddress(purchaseInfo.itemSubType, purchaseInfo.productId); - states = states - .SetState(shardedShopAddress, MarkChanged) - .SetState(purchaseInfo.sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - purchaseInfo.sellerAgentAddress, - GoldCurrencyState.Address); - } - return states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(Addresses.Shop, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy7.cs b/Lib9c/Action/Buy7.cs index b61f3b955b..f7269e9afc 100644 --- a/Lib9c/Action/Buy7.cs +++ b/Lib9c/Action/Buy7.cs @@ -199,27 +199,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - foreach (var purchaseInfo in purchaseInfos) - { - Address shardedShopAddress = - ShardedShopState.DeriveAddress(purchaseInfo.itemSubType, purchaseInfo.productId); - states = states - .SetState(shardedShopAddress, MarkChanged) - .SetState(purchaseInfo.sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - purchaseInfo.sellerAgentAddress, - GoldCurrencyState.Address); - } - return states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(Addresses.Shop, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy8.cs b/Lib9c/Action/Buy8.cs index e007b2a3d8..d3342bbd83 100644 --- a/Lib9c/Action/Buy8.cs +++ b/Lib9c/Action/Buy8.cs @@ -68,41 +68,6 @@ public override IAccount Execute(IActionContext context) var buyerInventoryAddress = buyerAvatarAddress.Derive(LegacyInventoryKey); var buyerWorldInformationAddress = buyerAvatarAddress.Derive(LegacyWorldInformationKey); var buyerQuestListAddress = buyerAvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - foreach (var purchaseInfo in purchaseInfos) - { - var sellerAvatarAddress = purchaseInfo.SellerAvatarAddress; - var sellerInventoryAddress = sellerAvatarAddress.Derive(LegacyInventoryKey); - var sellerWorldInformationAddress = sellerAvatarAddress.Derive(LegacyWorldInformationKey); - var sellerQuestListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); - Address shardedShopAddress = - ShardedShopStateV2.DeriveAddress(purchaseInfo.ItemSubType, purchaseInfo.OrderId); - Address orderReceiptAddress = OrderReceipt.DeriveAddress(purchaseInfo.OrderId); - Address digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - states = states - .SetState(shardedShopAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .SetState(sellerInventoryAddress, MarkChanged) - .SetState(sellerWorldInformationAddress, MarkChanged) - .SetState(sellerQuestListAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(digestListAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - purchaseInfo.SellerAgentAddress, - GoldCurrencyState.Address); - } - - return states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(buyerInventoryAddress, MarkChanged) - .SetState(buyerWorldInformationAddress, MarkChanged) - .SetState(buyerQuestListAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Buy9.cs b/Lib9c/Action/Buy9.cs index adfde17cab..73aee18888 100644 --- a/Lib9c/Action/Buy9.cs +++ b/Lib9c/Action/Buy9.cs @@ -68,41 +68,6 @@ public override IAccount Execute(IActionContext context) var buyerInventoryAddress = buyerAvatarAddress.Derive(LegacyInventoryKey); var buyerWorldInformationAddress = buyerAvatarAddress.Derive(LegacyWorldInformationKey); var buyerQuestListAddress = buyerAvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - foreach (var purchaseInfo in purchaseInfos) - { - var sellerAvatarAddress = purchaseInfo.SellerAvatarAddress; - var sellerInventoryAddress = sellerAvatarAddress.Derive(LegacyInventoryKey); - var sellerWorldInformationAddress = sellerAvatarAddress.Derive(LegacyWorldInformationKey); - var sellerQuestListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); - Address shardedShopAddress = - ShardedShopStateV2.DeriveAddress(purchaseInfo.ItemSubType, purchaseInfo.OrderId); - Address orderReceiptAddress = OrderReceipt.DeriveAddress(purchaseInfo.OrderId); - Address digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - states = states - .SetState(shardedShopAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged) - .SetState(sellerInventoryAddress, MarkChanged) - .SetState(sellerWorldInformationAddress, MarkChanged) - .SetState(sellerQuestListAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(digestListAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - purchaseInfo.SellerAgentAddress, - GoldCurrencyState.Address); - } - - return states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(buyerInventoryAddress, MarkChanged) - .SetState(buyerWorldInformationAddress, MarkChanged) - .SetState(buyerQuestListAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CreateAvatar.cs b/Lib9c/Action/CreateAvatar.cs index ade2861fdb..e49ff608e6 100644 --- a/Lib9c/Action/CreateAvatar.cs +++ b/Lib9c/Action/CreateAvatar.cs @@ -81,28 +81,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, signer); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CreateAvatar0.cs b/Lib9c/Action/CreateAvatar0.cs index b5528a7dfa..38a38f44a1 100644 --- a/Lib9c/Action/CreateAvatar0.cs +++ b/Lib9c/Action/CreateAvatar0.cs @@ -75,26 +75,6 @@ public override IAccount Execute(IActionContext context) IActionContext ctx = context; var random = ctx.GetRandom(); var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ctx.Signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(Addresses.Ranking, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address, context.Signer); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CreateAvatar10.cs b/Lib9c/Action/CreateAvatar10.cs index f9ab62f43b..92da416a38 100644 --- a/Lib9c/Action/CreateAvatar10.cs +++ b/Lib9c/Action/CreateAvatar10.cs @@ -82,28 +82,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, signer); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CreateAvatar2.cs b/Lib9c/Action/CreateAvatar2.cs index fa03444c08..7e53d31c4c 100644 --- a/Lib9c/Action/CreateAvatar2.cs +++ b/Lib9c/Action/CreateAvatar2.cs @@ -72,26 +72,6 @@ public override IAccount Execute(IActionContext context) index ) ); - if (ctx.Rehearsal) - { - states = states.SetState(ctx.Signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(Addresses.Ranking, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address, context.Signer); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CreateAvatar3.cs b/Lib9c/Action/CreateAvatar3.cs index 76ed5c3504..8fe7191b0f 100644 --- a/Lib9c/Action/CreateAvatar3.cs +++ b/Lib9c/Action/CreateAvatar3.cs @@ -71,29 +71,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(ctx.Signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(Addresses.Ranking, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address, context.Signer); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CreateAvatar4.cs b/Lib9c/Action/CreateAvatar4.cs index c76e613825..01520dd17e 100644 --- a/Lib9c/Action/CreateAvatar4.cs +++ b/Lib9c/Action/CreateAvatar4.cs @@ -71,29 +71,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(ctx.Signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(Addresses.Ranking, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address, context.Signer); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CreateAvatar5.cs b/Lib9c/Action/CreateAvatar5.cs index d86a825077..a5773f4f66 100644 --- a/Lib9c/Action/CreateAvatar5.cs +++ b/Lib9c/Action/CreateAvatar5.cs @@ -71,29 +71,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(ctx.Signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(Addresses.Ranking, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address, context.Signer); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CreateAvatar6.cs b/Lib9c/Action/CreateAvatar6.cs index 819f00185e..78371b4432 100644 --- a/Lib9c/Action/CreateAvatar6.cs +++ b/Lib9c/Action/CreateAvatar6.cs @@ -71,29 +71,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(ctx.Signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(Addresses.Ranking, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address, context.Signer); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CreateAvatar7.cs b/Lib9c/Action/CreateAvatar7.cs index 1abcab2862..502ec936e9 100644 --- a/Lib9c/Action/CreateAvatar7.cs +++ b/Lib9c/Action/CreateAvatar7.cs @@ -75,27 +75,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(ctx.Signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CreateAvatar8.cs b/Lib9c/Action/CreateAvatar8.cs index 1fb99849ad..54c5f87237 100644 --- a/Lib9c/Action/CreateAvatar8.cs +++ b/Lib9c/Action/CreateAvatar8.cs @@ -83,28 +83,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, signer); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CreateAvatar9.cs b/Lib9c/Action/CreateAvatar9.cs index 0ce97c4b6b..9c8ebda7e9 100644 --- a/Lib9c/Action/CreateAvatar9.cs +++ b/Lib9c/Action/CreateAvatar9.cs @@ -82,28 +82,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(signer, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - i - ) - ); - states = states.SetState(slotAddress, MarkChanged); - } - - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, signer); - } var itemSheetAddress = Addresses.GetSheetAddress(); var favSheetAddress = Addresses.GetSheetAddress(); diff --git a/Lib9c/Action/DailyReward0.cs b/Lib9c/Action/DailyReward0.cs index 857329972c..7c0bd82384 100644 --- a/Lib9c/Action/DailyReward0.cs +++ b/Lib9c/Action/DailyReward0.cs @@ -25,10 +25,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states.SetState(avatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/DailyReward2.cs b/Lib9c/Action/DailyReward2.cs index 2297d8b718..ab85458936 100644 --- a/Lib9c/Action/DailyReward2.cs +++ b/Lib9c/Action/DailyReward2.cs @@ -32,10 +32,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states.SetState(avatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/DailyReward3.cs b/Lib9c/Action/DailyReward3.cs index ccf4f5c7c4..dc11297689 100644 --- a/Lib9c/Action/DailyReward3.cs +++ b/Lib9c/Action/DailyReward3.cs @@ -31,10 +31,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states.SetState(avatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/DailyReward4.cs b/Lib9c/Action/DailyReward4.cs index 824c6014e2..606a88db92 100644 --- a/Lib9c/Action/DailyReward4.cs +++ b/Lib9c/Action/DailyReward4.cs @@ -35,14 +35,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(avatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash.cs b/Lib9c/Action/HackAndSlash.cs index 50e87a35fc..c5323c991f 100644 --- a/Lib9c/Action/HackAndSlash.cs +++ b/Lib9c/Action/HackAndSlash.cs @@ -99,11 +99,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var random = context.GetRandom(); return Execute( context.PreviousState, diff --git a/Lib9c/Action/HackAndSlash0.cs b/Lib9c/Action/HackAndSlash0.cs index bcee7219d9..2d3999cb6b 100644 --- a/Lib9c/Action/HackAndSlash0.cs +++ b/Lib9c/Action/HackAndSlash0.cs @@ -75,13 +75,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states.SetState(WeeklyArenaAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash10.cs b/Lib9c/Action/HackAndSlash10.cs index 86a08916f4..e3af1088a5 100644 --- a/Lib9c/Action/HackAndSlash10.cs +++ b/Lib9c/Action/HackAndSlash10.cs @@ -76,16 +76,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(rankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100170ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash11.cs b/Lib9c/Action/HackAndSlash11.cs index 914717cb5b..606c2e4496 100644 --- a/Lib9c/Action/HackAndSlash11.cs +++ b/Lib9c/Action/HackAndSlash11.cs @@ -71,15 +71,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100190ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash12.cs b/Lib9c/Action/HackAndSlash12.cs index 061e1ed3d6..f34d2784b0 100644 --- a/Lib9c/Action/HackAndSlash12.cs +++ b/Lib9c/Action/HackAndSlash12.cs @@ -71,15 +71,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100260ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash13.cs b/Lib9c/Action/HackAndSlash13.cs index 55c41f5407..ef9f37c91c 100644 --- a/Lib9c/Action/HackAndSlash13.cs +++ b/Lib9c/Action/HackAndSlash13.cs @@ -75,15 +75,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ObsoletedBlockIndex, context); diff --git a/Lib9c/Action/HackAndSlash14.cs b/Lib9c/Action/HackAndSlash14.cs index 29f8334625..ba8561c01a 100644 --- a/Lib9c/Action/HackAndSlash14.cs +++ b/Lib9c/Action/HackAndSlash14.cs @@ -93,10 +93,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states; - } CheckObsolete(ObsoletedBlockIndex, context); diff --git a/Lib9c/Action/HackAndSlash16.cs b/Lib9c/Action/HackAndSlash16.cs index b74e061ddc..f5f07c092a 100644 --- a/Lib9c/Action/HackAndSlash16.cs +++ b/Lib9c/Action/HackAndSlash16.cs @@ -91,11 +91,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var random = context.GetRandom(); diff --git a/Lib9c/Action/HackAndSlash17.cs b/Lib9c/Action/HackAndSlash17.cs index c610ee7777..a8c6a0391a 100644 --- a/Lib9c/Action/HackAndSlash17.cs +++ b/Lib9c/Action/HackAndSlash17.cs @@ -89,10 +89,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var random = context.GetRandom(); diff --git a/Lib9c/Action/HackAndSlash18.cs b/Lib9c/Action/HackAndSlash18.cs index 03ffcaf9ad..ff7dc42b6a 100644 --- a/Lib9c/Action/HackAndSlash18.cs +++ b/Lib9c/Action/HackAndSlash18.cs @@ -89,10 +89,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } CheckObsolete(ActionObsoleteConfig.V100340ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash19.cs b/Lib9c/Action/HackAndSlash19.cs index c319f24f40..e8f7c6944a 100644 --- a/Lib9c/Action/HackAndSlash19.cs +++ b/Lib9c/Action/HackAndSlash19.cs @@ -94,10 +94,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash2.cs b/Lib9c/Action/HackAndSlash2.cs index 5152fdcf57..7212d8cfc6 100644 --- a/Lib9c/Action/HackAndSlash2.cs +++ b/Lib9c/Action/HackAndSlash2.cs @@ -73,13 +73,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states.SetState(WeeklyArenaAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash20.cs b/Lib9c/Action/HackAndSlash20.cs index 1e72e7ce0b..c159e321d5 100644 --- a/Lib9c/Action/HackAndSlash20.cs +++ b/Lib9c/Action/HackAndSlash20.cs @@ -101,10 +101,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } var random = context.GetRandom(); return Execute( diff --git a/Lib9c/Action/HackAndSlash21.cs b/Lib9c/Action/HackAndSlash21.cs index 9926128ec6..53f142d4ec 100644 --- a/Lib9c/Action/HackAndSlash21.cs +++ b/Lib9c/Action/HackAndSlash21.cs @@ -101,10 +101,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var random = context.GetRandom(); - if (context.Rehearsal) - { - return context.PreviousState; - } return Execute( context.PreviousState, diff --git a/Lib9c/Action/HackAndSlash3.cs b/Lib9c/Action/HackAndSlash3.cs index 32e7b58125..c2e9eb94f8 100644 --- a/Lib9c/Action/HackAndSlash3.cs +++ b/Lib9c/Action/HackAndSlash3.cs @@ -73,13 +73,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states.SetState(WeeklyArenaAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash4.cs b/Lib9c/Action/HackAndSlash4.cs index 4b8804d496..35a1ab97ea 100644 --- a/Lib9c/Action/HackAndSlash4.cs +++ b/Lib9c/Action/HackAndSlash4.cs @@ -73,13 +73,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states.SetState(WeeklyArenaAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash5.cs b/Lib9c/Action/HackAndSlash5.cs index 49e2d1efed..ed94cf05f7 100644 --- a/Lib9c/Action/HackAndSlash5.cs +++ b/Lib9c/Action/HackAndSlash5.cs @@ -73,13 +73,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states.SetState(WeeklyArenaAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash6.cs b/Lib9c/Action/HackAndSlash6.cs index 6de84e4658..e32933b2fd 100644 --- a/Lib9c/Action/HackAndSlash6.cs +++ b/Lib9c/Action/HackAndSlash6.cs @@ -77,17 +77,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states.SetState(WeeklyArenaAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash7.cs b/Lib9c/Action/HackAndSlash7.cs index 92a0ac6e21..bed7b64ed0 100644 --- a/Lib9c/Action/HackAndSlash7.cs +++ b/Lib9c/Action/HackAndSlash7.cs @@ -76,17 +76,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states.SetState(WeeklyArenaAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash8.cs b/Lib9c/Action/HackAndSlash8.cs index e01238e463..7310211c6d 100644 --- a/Lib9c/Action/HackAndSlash8.cs +++ b/Lib9c/Action/HackAndSlash8.cs @@ -72,16 +72,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(rankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100081ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlash9.cs b/Lib9c/Action/HackAndSlash9.cs index 11f7b0daf9..2801e507cb 100644 --- a/Lib9c/Action/HackAndSlash9.cs +++ b/Lib9c/Action/HackAndSlash9.cs @@ -76,16 +76,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(rankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100086ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement.cs b/Lib9c/Action/ItemEnhancement.cs index da9d121dd8..0b042ca014 100644 --- a/Lib9c/Action/ItemEnhancement.cs +++ b/Lib9c/Action/ItemEnhancement.cs @@ -77,11 +77,6 @@ public override IAccount Execute(IActionContext context) var ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states; - } - // Collect addresses var slotAddress = avatarAddress.Derive( string.Format( diff --git a/Lib9c/Action/ItemEnhancement0.cs b/Lib9c/Action/ItemEnhancement0.cs index dd9550daa4..42f91ff032 100644 --- a/Lib9c/Action/ItemEnhancement0.cs +++ b/Lib9c/Action/ItemEnhancement0.cs @@ -50,13 +50,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement10.cs b/Lib9c/Action/ItemEnhancement10.cs index d6662e3cb7..b217ccb292 100644 --- a/Lib9c/Action/ItemEnhancement10.cs +++ b/Lib9c/Action/ItemEnhancement10.cs @@ -134,16 +134,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, GetFeeStoreAddress()) - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var arenaSheetAddress = Addresses.GetSheetAddress(); diff --git a/Lib9c/Action/ItemEnhancement11.cs b/Lib9c/Action/ItemEnhancement11.cs index 689689254c..af87fa08e5 100644 --- a/Lib9c/Action/ItemEnhancement11.cs +++ b/Lib9c/Action/ItemEnhancement11.cs @@ -137,11 +137,6 @@ public override IAccount Execute(IActionContext context) var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states; - } - var costSheetV3Address = Addresses.GetSheetAddress(); var sheetState = states.GetState(costSheetV3Address); if (sheetState != null) diff --git a/Lib9c/Action/ItemEnhancement12.cs b/Lib9c/Action/ItemEnhancement12.cs index 56c18f4e26..f7d6416439 100644 --- a/Lib9c/Action/ItemEnhancement12.cs +++ b/Lib9c/Action/ItemEnhancement12.cs @@ -133,11 +133,6 @@ public override IAccount Execute(IActionContext context) var ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states; - } - // Collect addresses var slotAddress = avatarAddress.Derive( string.Format( diff --git a/Lib9c/Action/ItemEnhancement13.cs b/Lib9c/Action/ItemEnhancement13.cs index 241e3347bb..9d7fa89cbb 100644 --- a/Lib9c/Action/ItemEnhancement13.cs +++ b/Lib9c/Action/ItemEnhancement13.cs @@ -134,11 +134,6 @@ public override IAccount Execute(IActionContext context) var states = ctx.PreviousState; var random = context.GetRandom(); - if (ctx.Rehearsal) - { - return states; - } - // Collect addresses var slotAddress = avatarAddress.Derive( string.Format( diff --git a/Lib9c/Action/ItemEnhancement2.cs b/Lib9c/Action/ItemEnhancement2.cs index d92288eeb3..4f51c54830 100644 --- a/Lib9c/Action/ItemEnhancement2.cs +++ b/Lib9c/Action/ItemEnhancement2.cs @@ -50,13 +50,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement3.cs b/Lib9c/Action/ItemEnhancement3.cs index a97526733f..5835b47fdb 100644 --- a/Lib9c/Action/ItemEnhancement3.cs +++ b/Lib9c/Action/ItemEnhancement3.cs @@ -50,13 +50,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement4.cs b/Lib9c/Action/ItemEnhancement4.cs index c3178a55a3..a348531873 100644 --- a/Lib9c/Action/ItemEnhancement4.cs +++ b/Lib9c/Action/ItemEnhancement4.cs @@ -48,13 +48,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement5.cs b/Lib9c/Action/ItemEnhancement5.cs index 490943c600..746bc49b33 100644 --- a/Lib9c/Action/ItemEnhancement5.cs +++ b/Lib9c/Action/ItemEnhancement5.cs @@ -48,13 +48,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement6.cs b/Lib9c/Action/ItemEnhancement6.cs index aa294d28e5..74c25a2240 100644 --- a/Lib9c/Action/ItemEnhancement6.cs +++ b/Lib9c/Action/ItemEnhancement6.cs @@ -50,13 +50,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement7.cs b/Lib9c/Action/ItemEnhancement7.cs index c11a28d4b1..0281b0fde1 100644 --- a/Lib9c/Action/ItemEnhancement7.cs +++ b/Lib9c/Action/ItemEnhancement7.cs @@ -90,16 +90,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement8.cs b/Lib9c/Action/ItemEnhancement8.cs index 1013261922..33c89d53aa 100644 --- a/Lib9c/Action/ItemEnhancement8.cs +++ b/Lib9c/Action/ItemEnhancement8.cs @@ -54,16 +54,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ItemEnhancement9.cs b/Lib9c/Action/ItemEnhancement9.cs index 838a87d8e2..d0caf06bfc 100644 --- a/Lib9c/Action/ItemEnhancement9.cs +++ b/Lib9c/Action/ItemEnhancement9.cs @@ -130,16 +130,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress) - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100220ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell.cs b/Lib9c/Action/Sell.cs index f157183821..cbc68e523a 100644 --- a/Lib9c/Action/Sell.cs +++ b/Lib9c/Action/Sell.cs @@ -72,19 +72,6 @@ public override IAccount Execute(IActionContext context) Address itemAddress = Addresses.GetItemAddress(tradableId); Address orderAddress = Order.DeriveAddress(orderId); Address orderReceiptAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(orderAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); if (!(states.GetState(Addresses.Market) is null)) diff --git a/Lib9c/Action/Sell0.cs b/Lib9c/Action/Sell0.cs index e5e3365376..9b39a0c8ec 100644 --- a/Lib9c/Action/Sell0.cs +++ b/Lib9c/Action/Sell0.cs @@ -46,12 +46,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ShopState.Address, MarkChanged); - states = states.SetState(sellerAvatarAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell10.cs b/Lib9c/Action/Sell10.cs index 3045d3bbda..6302f25cbf 100644 --- a/Lib9c/Action/Sell10.cs +++ b/Lib9c/Action/Sell10.cs @@ -73,19 +73,6 @@ public override IAccount Execute(IActionContext context) Address itemAddress = Addresses.GetItemAddress(tradableId); Address orderAddress = Order.DeriveAddress(orderId); Address orderReceiptAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(orderAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100300ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell11.cs b/Lib9c/Action/Sell11.cs index 8b1772d06a..982abaa0d2 100644 --- a/Lib9c/Action/Sell11.cs +++ b/Lib9c/Action/Sell11.cs @@ -72,19 +72,6 @@ public override IAccount Execute(IActionContext context) Address itemAddress = Addresses.GetItemAddress(tradableId); Address orderAddress = Order.DeriveAddress(orderId); Address orderReceiptAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(orderAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100351ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, sellerAvatarAddress); diff --git a/Lib9c/Action/Sell2.cs b/Lib9c/Action/Sell2.cs index a803364f52..39c042bb4a 100644 --- a/Lib9c/Action/Sell2.cs +++ b/Lib9c/Action/Sell2.cs @@ -47,12 +47,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ShopState.Address, MarkChanged); - states = states.SetState(sellerAvatarAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell3.cs b/Lib9c/Action/Sell3.cs index 915cf54eb3..bd5344c30a 100644 --- a/Lib9c/Action/Sell3.cs +++ b/Lib9c/Action/Sell3.cs @@ -47,12 +47,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ShopState.Address, MarkChanged); - states = states.SetState(sellerAvatarAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell4.cs b/Lib9c/Action/Sell4.cs index aed2c6dcab..bac95c98a8 100644 --- a/Lib9c/Action/Sell4.cs +++ b/Lib9c/Action/Sell4.cs @@ -54,15 +54,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(sellerAvatarAddress, MarkChanged); - states = ShardedShopState.AddressKeys.Aggregate(states, - (current, addressKey) => - current.SetState(ShardedShopState.DeriveAddress(itemSubType, addressKey), MarkChanged)); - return states - .SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell5.cs b/Lib9c/Action/Sell5.cs index 8522389158..d6825f5594 100644 --- a/Lib9c/Action/Sell5.cs +++ b/Lib9c/Action/Sell5.cs @@ -63,16 +63,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - states = states.SetState(sellerAvatarAddress, MarkChanged); - states = ShardedShopState.AddressKeys.Aggregate( - states, - (current, addressKey) => current.SetState( - ShardedShopState.DeriveAddress(itemSubType, addressKey), - MarkChanged)); - return states.SetState(context.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell6.cs b/Lib9c/Action/Sell6.cs index c277ca8642..bd6c2f22da 100644 --- a/Lib9c/Action/Sell6.cs +++ b/Lib9c/Action/Sell6.cs @@ -62,16 +62,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - states = states.SetState(sellerAvatarAddress, MarkChanged); - states = ShardedShopState.AddressKeys.Aggregate( - states, - (current, addressKey) => current.SetState( - ShardedShopState.DeriveAddress(itemSubType, addressKey), - MarkChanged)); - return states.SetState(context.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell7.cs b/Lib9c/Action/Sell7.cs index d872721e5b..f438a90489 100644 --- a/Lib9c/Action/Sell7.cs +++ b/Lib9c/Action/Sell7.cs @@ -70,19 +70,6 @@ public override IAccount Execute(IActionContext context) Address itemAddress = Addresses.GetItemAddress(tradableId); Address orderAddress = Order.DeriveAddress(orderId); Address orderReceiptAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(orderAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell8.cs b/Lib9c/Action/Sell8.cs index fc682aadf1..eb45c4b79c 100644 --- a/Lib9c/Action/Sell8.cs +++ b/Lib9c/Action/Sell8.cs @@ -70,19 +70,6 @@ public override IAccount Execute(IActionContext context) Address itemAddress = Addresses.GetItemAddress(tradableId); Address orderAddress = Order.DeriveAddress(orderId); Address orderReceiptAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(orderAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Sell9.cs b/Lib9c/Action/Sell9.cs index 64a270e0c6..69c0cc4ad6 100644 --- a/Lib9c/Action/Sell9.cs +++ b/Lib9c/Action/Sell9.cs @@ -69,19 +69,6 @@ public override IAccount Execute(IActionContext context) Address itemAddress = Addresses.GetItemAddress(tradableId); Address orderAddress = Order.DeriveAddress(orderId); Address orderReceiptAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(orderAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/SellCancellation0.cs b/Lib9c/Action/SellCancellation0.cs index 9a28038895..7414dd1a54 100644 --- a/Lib9c/Action/SellCancellation0.cs +++ b/Lib9c/Action/SellCancellation0.cs @@ -44,11 +44,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ShopState.Address, MarkChanged); - return states.SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/SellCancellation2.cs b/Lib9c/Action/SellCancellation2.cs index befb7a492f..ea0782bf68 100644 --- a/Lib9c/Action/SellCancellation2.cs +++ b/Lib9c/Action/SellCancellation2.cs @@ -44,11 +44,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ShopState.Address, MarkChanged); - return states.SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/SellCancellation3.cs b/Lib9c/Action/SellCancellation3.cs index 8bd5e03a9b..f15ca9adda 100644 --- a/Lib9c/Action/SellCancellation3.cs +++ b/Lib9c/Action/SellCancellation3.cs @@ -44,11 +44,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ShopState.Address, MarkChanged); - return states.SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/SellCancellation4.cs b/Lib9c/Action/SellCancellation4.cs index 11d93e4f16..9dbb415d27 100644 --- a/Lib9c/Action/SellCancellation4.cs +++ b/Lib9c/Action/SellCancellation4.cs @@ -44,11 +44,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(ShopState.Address, MarkChanged); - return states.SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/SellCancellation5.cs b/Lib9c/Action/SellCancellation5.cs index 710a3a4b74..80928c2188 100644 --- a/Lib9c/Action/SellCancellation5.cs +++ b/Lib9c/Action/SellCancellation5.cs @@ -51,13 +51,6 @@ public override IAccount Execute(IActionContext context) IActionContext ctx = context; var states = ctx.PreviousState; Address shardedShopAddress = ShardedShopState.DeriveAddress(itemSubType, productId); - if (ctx.Rehearsal) - { - states = states.SetState(shardedShopAddress, MarkChanged); - return states - .SetState(Addresses.Shop, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/TransferAsset.cs b/Lib9c/Action/TransferAsset.cs index 2859eaa862..b6b4212d1d 100644 --- a/Lib9c/Action/TransferAsset.cs +++ b/Lib9c/Action/TransferAsset.cs @@ -88,11 +88,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(4); Address signer = context.Signer; var state = context.PreviousState; - if (context.Rehearsal) - { - return state.MarkBalanceChanged(context, Amount.Currency, new[] {Sender, Recipient}); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, signer); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}TransferAsset5 exec started", addressesHex); diff --git a/Lib9c/Action/TransferAsset0.cs b/Lib9c/Action/TransferAsset0.cs index 6c4bbc29c0..3c6b0e7248 100644 --- a/Lib9c/Action/TransferAsset0.cs +++ b/Lib9c/Action/TransferAsset0.cs @@ -78,10 +78,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(4); var state = context.PreviousState; - if (context.Rehearsal) - { - return state.MarkBalanceChanged(context, Amount.Currency, new[] { Sender, Recipient }); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/TransferAsset2.cs b/Lib9c/Action/TransferAsset2.cs index bf465ccf50..8ccdf99b7e 100644 --- a/Lib9c/Action/TransferAsset2.cs +++ b/Lib9c/Action/TransferAsset2.cs @@ -84,10 +84,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(4); var state = context.PreviousState; - if (context.Rehearsal) - { - return state.MarkBalanceChanged(context, Amount.Currency, new[] { Sender, Recipient }); - } CheckObsolete(TransferAsset3.CrystalTransferringRestrictionStartIndex - 1, context); var addressesHex = GetSignerAndOtherAddressesHex(context, context.Signer); diff --git a/Lib9c/Action/TransferAsset3.cs b/Lib9c/Action/TransferAsset3.cs index a679bcec1c..1f43d17c0f 100644 --- a/Lib9c/Action/TransferAsset3.cs +++ b/Lib9c/Action/TransferAsset3.cs @@ -97,10 +97,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(4); var state = context.PreviousState; - if (context.Rehearsal) - { - return state.MarkBalanceChanged(context, Amount.Currency, new[] { Sender, Recipient }); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, context.Signer); diff --git a/Lib9c/Action/TransferAsset4.cs b/Lib9c/Action/TransferAsset4.cs index 18cf7feeb5..0f8bc34a4f 100644 --- a/Lib9c/Action/TransferAsset4.cs +++ b/Lib9c/Action/TransferAsset4.cs @@ -89,10 +89,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(4); Address signer = context.Signer; var state = context.PreviousState; - if (context.Rehearsal) - { - return state.MarkBalanceChanged(context, Amount.Currency, new[] {Sender, Recipient}); - } var addressesHex = GetSignerAndOtherAddressesHex(context, signer); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/TransferAssets.cs b/Lib9c/Action/TransferAssets.cs index 5247d35e27..15ea73cd00 100644 --- a/Lib9c/Action/TransferAssets.cs +++ b/Lib9c/Action/TransferAssets.cs @@ -83,10 +83,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(4); var state = context.PreviousState; - if (context.Rehearsal) - { - return Recipients.Aggregate(state, (current, t) => current.MarkBalanceChanged(context, t.amount.Currency, new[] {Sender, t.recipient})); - } if (Recipients.Count > RecipientsCapacity) { diff --git a/Lib9c/Action/TransferAssets0.cs b/Lib9c/Action/TransferAssets0.cs index e3fb49f138..641c1070d5 100644 --- a/Lib9c/Action/TransferAssets0.cs +++ b/Lib9c/Action/TransferAssets0.cs @@ -83,10 +83,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(4); var state = context.PreviousState; - if (context.Rehearsal) - { - return Recipients.Aggregate(state, (current, t) => current.MarkBalanceChanged(context, t.amount.Currency, new[] {Sender, t.recipient})); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); if (Recipients.Count > RecipientsCapacity) diff --git a/Lib9c/Action/TransferAssets2.cs b/Lib9c/Action/TransferAssets2.cs index 2fac24362d..b86c6a137c 100644 --- a/Lib9c/Action/TransferAssets2.cs +++ b/Lib9c/Action/TransferAssets2.cs @@ -85,10 +85,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(4); var state = context.PreviousState; CheckObsolete(ActionObsoleteConfig.V200090ObsoleteIndex, context); - if (context.Rehearsal) - { - return Recipients.Aggregate(state, (current, t) => current.MarkBalanceChanged(context, t.amount.Currency, new[] {Sender, t.recipient})); - } if (Recipients.Count > RecipientsCapacity) { From e210c10b23114f66397e308eff58484f2d822f67 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Sat, 11 Nov 2023 12:51:11 +0900 Subject: [PATCH 06/19] More test scrubbing --- .../ClaimMonsterCollectionReward2Test.cs | 31 ------------- .../ClaimMonsterCollectionRewardTest.cs | 26 ----------- .../Action/CombinationEquipment10Test.cs | 42 ------------------ .../Action/CombinationEquipment11Test.cs | 42 ------------------ .../Action/CombinationEquipment6Test.cs | 42 ------------------ .../Action/CombinationEquipment7Test.cs | 42 ------------------ .../Action/CombinationEquipment8Test.cs | 42 ------------------ .../Action/CombinationEquipment9Test.cs | 42 ------------------ .Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs | 38 ---------------- .Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs | 37 ---------------- .Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs | 38 ---------------- .Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs | 38 ---------------- .Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs | 36 --------------- .Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs | 36 --------------- .Lib9c.Tests/Action/MonsterCollect0Test.cs | 25 ----------- .Lib9c.Tests/Action/MonsterCollect2Test.cs | 26 ----------- .Lib9c.Tests/Action/MonsterCollectTest.cs | 26 ----------- .Lib9c.Tests/Action/RapidCombination4Test.cs | 39 ---------------- .Lib9c.Tests/Action/RapidCombination5Test.cs | 39 ---------------- .Lib9c.Tests/Action/RapidCombination6Test.cs | 39 ---------------- .Lib9c.Tests/Action/RapidCombination7Test.cs | 39 ---------------- .Lib9c.Tests/Action/RapidCombination8Test.cs | 39 ---------------- .Lib9c.Tests/Action/RapidCombination9Test.cs | 39 ---------------- .Lib9c.Tests/Action/UpdateSell0Test.cs | 44 ------------------- .Lib9c.Tests/Action/UpdateSell2Test.cs | 44 ------------------- 25 files changed, 931 deletions(-) diff --git a/.Lib9c.Tests/Action/ClaimMonsterCollectionReward2Test.cs b/.Lib9c.Tests/Action/ClaimMonsterCollectionReward2Test.cs index 537170a477..84de887a55 100644 --- a/.Lib9c.Tests/Action/ClaimMonsterCollectionReward2Test.cs +++ b/.Lib9c.Tests/Action/ClaimMonsterCollectionReward2Test.cs @@ -200,37 +200,6 @@ public void Execute_Throw_RequiredBlockIndexException() ); } - [Fact] - public void Rehearsal() - { - ClaimMonsterCollectionReward2 action = new ClaimMonsterCollectionReward2 - { - avatarAddress = _avatarAddress, - }; - - IAccount nextState = action.Execute(new ActionContext - { - PreviousState = new Account(MockState.Empty), - Signer = _signer, - BlockIndex = 0, - Rehearsal = true, - } - ); - - List
updatedAddresses = new List
- { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - MonsterCollectionState.DeriveAddress(_signer, 0), - MonsterCollectionState.DeriveAddress(_signer, 1), - MonsterCollectionState.DeriveAddress(_signer, 2), - MonsterCollectionState.DeriveAddress(_signer, 3), - }; - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private class ExecuteFixture : IEnumerable { private readonly List _data = new List diff --git a/.Lib9c.Tests/Action/ClaimMonsterCollectionRewardTest.cs b/.Lib9c.Tests/Action/ClaimMonsterCollectionRewardTest.cs index 010c600443..69a0eee019 100644 --- a/.Lib9c.Tests/Action/ClaimMonsterCollectionRewardTest.cs +++ b/.Lib9c.Tests/Action/ClaimMonsterCollectionRewardTest.cs @@ -182,32 +182,6 @@ public void Execute_Throw_RequiredBlockIndexException() ); } - [Fact] - public void Rehearsal() - { - IAccount nextState = _action.Execute(new ActionContext - { - PreviousState = new Account(MockState.Empty), - Signer = _signer, - BlockIndex = 0, - Rehearsal = true, - } - ); - - List
updatedAddresses = new List
- { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - MonsterCollectionState.DeriveAddress(_signer, 0), - MonsterCollectionState.DeriveAddress(_signer, 1), - MonsterCollectionState.DeriveAddress(_signer, 2), - MonsterCollectionState.DeriveAddress(_signer, 3), - }; - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - private class ExecuteFixture : IEnumerable { private readonly List _data = new List diff --git a/.Lib9c.Tests/Action/CombinationEquipment10Test.cs b/.Lib9c.Tests/Action/CombinationEquipment10Test.cs index c5707b6c44..b354f207bc 100644 --- a/.Lib9c.Tests/Action/CombinationEquipment10Test.cs +++ b/.Lib9c.Tests/Action/CombinationEquipment10Test.cs @@ -115,48 +115,6 @@ public void Execute_Throw_InsufficientBalanceException(bool backward) backward, recipeId, subRecipeId, 0)); } - [Fact] - public void Rehearsal() - { - var action = new CombinationEquipment10 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - recipeId = 1, - subRecipeId = 255, - }; - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void AddAndUnlockOption() { diff --git a/.Lib9c.Tests/Action/CombinationEquipment11Test.cs b/.Lib9c.Tests/Action/CombinationEquipment11Test.cs index 90f766e707..ce86353acf 100644 --- a/.Lib9c.Tests/Action/CombinationEquipment11Test.cs +++ b/.Lib9c.Tests/Action/CombinationEquipment11Test.cs @@ -121,48 +121,6 @@ public void Execute_Throw_InsufficientBalanceException(bool backward) backward, recipeId, subRecipeId, 0)); } - [Fact] - public void Rehearsal() - { - var action = new CombinationEquipment11 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - recipeId = 1, - subRecipeId = 255, - }; - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - ItemEnhancement10.GetFeeStoreAddress(), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void AddAndUnlockOption() { diff --git a/.Lib9c.Tests/Action/CombinationEquipment6Test.cs b/.Lib9c.Tests/Action/CombinationEquipment6Test.cs index 58ae9a58d0..502efe37f1 100644 --- a/.Lib9c.Tests/Action/CombinationEquipment6Test.cs +++ b/.Lib9c.Tests/Action/CombinationEquipment6Test.cs @@ -229,48 +229,6 @@ public void ExecuteThrowInsufficientBalanceException() })); } - [Fact] - public void Rehearsal() - { - var action = new CombinationEquipment6 - { - AvatarAddress = _avatarAddress, - RecipeId = 1, - SlotIndex = 0, - SubRecipeId = 255, - }; - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void SelectOption() { diff --git a/.Lib9c.Tests/Action/CombinationEquipment7Test.cs b/.Lib9c.Tests/Action/CombinationEquipment7Test.cs index 6a075dd6bf..7952588831 100644 --- a/.Lib9c.Tests/Action/CombinationEquipment7Test.cs +++ b/.Lib9c.Tests/Action/CombinationEquipment7Test.cs @@ -228,48 +228,6 @@ public void ExecuteThrowInsufficientBalanceException() })); } - [Fact] - public void Rehearsal() - { - var action = new CombinationEquipment7 - { - AvatarAddress = _avatarAddress, - RecipeId = 1, - SlotIndex = 0, - SubRecipeId = 255, - }; - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void SelectOption() { diff --git a/.Lib9c.Tests/Action/CombinationEquipment8Test.cs b/.Lib9c.Tests/Action/CombinationEquipment8Test.cs index 17fe93c6a5..5479610e2f 100644 --- a/.Lib9c.Tests/Action/CombinationEquipment8Test.cs +++ b/.Lib9c.Tests/Action/CombinationEquipment8Test.cs @@ -114,48 +114,6 @@ public void Execute_Throw_InsufficientBalanceException(bool backward) backward, recipeId, subRecipeId, 0)); } - [Fact] - public void Rehearsal() - { - var action = new CombinationEquipment8 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - recipeId = 1, - subRecipeId = 255, - }; - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void AddAndUnlockOption() { diff --git a/.Lib9c.Tests/Action/CombinationEquipment9Test.cs b/.Lib9c.Tests/Action/CombinationEquipment9Test.cs index cc975e9369..3f4c19220b 100644 --- a/.Lib9c.Tests/Action/CombinationEquipment9Test.cs +++ b/.Lib9c.Tests/Action/CombinationEquipment9Test.cs @@ -114,48 +114,6 @@ public void Execute_Throw_InsufficientBalanceException(bool backward) backward, recipeId, subRecipeId, 0)); } - [Fact] - public void Rehearsal() - { - var action = new CombinationEquipment9 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - recipeId = 1, - subRecipeId = 255, - }; - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - slotAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.Blacksmith, - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Fact] public void AddAndUnlockOption() { diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs index 6e0f8333ba..16dbecae07 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs @@ -585,43 +585,5 @@ public void ExecuteEquippableItemValidation() RandomSeed = 0, }); } - - [Fact] - public void Rehearsal() - { - var action = new MimisbrunnrBattle4() - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - WeeklyArenaAddress = _weeklyArenaState.address, - RankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _avatarAddress, - _weeklyArenaState.address, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs index 813f264458..1e0dbf0ad9 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs @@ -570,42 +570,5 @@ public void ExecuteEquippableItemValidation() RandomSeed = 0, }); } - - [Fact] - public void Rehearsal() - { - var action = new MimisbrunnrBattle5() - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - avatarAddress = _avatarAddress, - rankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs index 6888047b80..0a07bcdcb9 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs @@ -728,43 +728,5 @@ x.item is IFungibleItem ownedFungibleItem && var totalCount = rewardItem.Sum(x => x.count); Assert.InRange(totalCount, totalMin, totalMax); } - - [Fact] - public void Rehearsal() - { - var action = new MimisbrunnrBattle6() - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - rankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs index 1ca49ae271..1eae59601a 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs @@ -728,43 +728,5 @@ x.item is IFungibleItem ownedFungibleItem && var totalCount = rewardItem.Sum(x => x.count); Assert.InRange(totalCount, totalMin, totalMax); } - - [Fact] - public void Rehearsal() - { - var action = new MimisbrunnrBattle7() - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - rankingMapAddress = _rankingMapAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _rankingMapAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs index 1f4b48fb8d..5f1a32d5d4 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs @@ -679,41 +679,5 @@ x.item is IFungibleItem ownedFungibleItem && var totalCount = rewardItem.Sum(x => x.count); Assert.InRange(totalCount, totalMin, totalMax); } - - [Fact] - public void Rehearsal() - { - var action = new MimisbrunnrBattle8() - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs index 7dd4502673..519be580bf 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs @@ -730,41 +730,5 @@ x.item is IFungibleItem && var totalCount = rewardItem.Sum(x => x.count); Assert.InRange(totalCount, totalMin, totalMax); } - - [Fact] - public void Rehearsal() - { - var action = new MimisbrunnrBattle9 - { - costumes = new List(), - equipments = new List(), - foods = new List(), - worldId = 1, - stageId = 1, - playCount = 1, - avatarAddress = _avatarAddress, - }; - - var updatedAddresses = new List
- { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MonsterCollect0Test.cs b/.Lib9c.Tests/Action/MonsterCollect0Test.cs index f342f3ac91..77adb0f4ed 100644 --- a/.Lib9c.Tests/Action/MonsterCollect0Test.cs +++ b/.Lib9c.Tests/Action/MonsterCollect0Test.cs @@ -226,30 +226,5 @@ public void Execute_Throw_InvalidLevelException(int prevLevel, int level) BlockIndex = 1, })); } - - [Fact] - public void Rehearsal() - { - Address collectionAddress = MonsterCollectionState0.DeriveAddress(_signer, 1); - MonsterCollect0 action = new MonsterCollect0 - { - level = 1, - collectionRound = 1, - }; - IAccount nextState = action.Execute(new ActionContext - { - PreviousState = new Account(MockState.Empty), - Signer = _signer, - Rehearsal = true, - }); - - List
updatedAddresses = new List
() - { - _signer, - collectionAddress, - }; - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MonsterCollect2Test.cs b/.Lib9c.Tests/Action/MonsterCollect2Test.cs index cd752b522f..66626e5a27 100644 --- a/.Lib9c.Tests/Action/MonsterCollect2Test.cs +++ b/.Lib9c.Tests/Action/MonsterCollect2Test.cs @@ -154,31 +154,5 @@ public void Execute_Throw_InsufficientBalanceException() BlockIndex = 1, })); } - - [Fact] - public void Rehearsal() - { - var action = new MonsterCollect2 - { - level = 1, - }; - IAccount nextState = action.Execute(new ActionContext - { - PreviousState = new Account(MockState.Empty), - Signer = _signer, - Rehearsal = true, - }); - - List
updatedAddresses = new List
() - { - _signer, - MonsterCollectionState.DeriveAddress(_signer, 0), - MonsterCollectionState.DeriveAddress(_signer, 1), - MonsterCollectionState.DeriveAddress(_signer, 2), - MonsterCollectionState.DeriveAddress(_signer, 3), - }; - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/MonsterCollectTest.cs b/.Lib9c.Tests/Action/MonsterCollectTest.cs index be48e0f9a6..d728a49419 100644 --- a/.Lib9c.Tests/Action/MonsterCollectTest.cs +++ b/.Lib9c.Tests/Action/MonsterCollectTest.cs @@ -175,31 +175,5 @@ public void Execute_Throw_InvalidOperationException() BlockIndex = 1, })); } - - [Fact] - public void Rehearsal() - { - MonsterCollect action = new MonsterCollect - { - level = 1, - }; - IAccount nextState = action.Execute(new ActionContext - { - PreviousState = new Account(MockState.Empty), - Signer = _signer, - Rehearsal = true, - }); - - List
updatedAddresses = new List
() - { - _signer, - MonsterCollectionState.DeriveAddress(_signer, 0), - MonsterCollectionState.DeriveAddress(_signer, 1), - MonsterCollectionState.DeriveAddress(_signer, 2), - MonsterCollectionState.DeriveAddress(_signer, 3), - }; - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/RapidCombination4Test.cs b/.Lib9c.Tests/Action/RapidCombination4Test.cs index 674c12439b..ad00e974e8 100644 --- a/.Lib9c.Tests/Action/RapidCombination4Test.cs +++ b/.Lib9c.Tests/Action/RapidCombination4Test.cs @@ -362,45 +362,6 @@ public void Execute_Throw_NotEnoughMaterialException(int materialCount, int trad })); } - [Fact] - public void Rehearsal() - { - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - slotAddress, - }; - - var state = new Account(MockState.Empty); - - var action = new RapidCombination4 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(null)] [InlineData(1)] diff --git a/.Lib9c.Tests/Action/RapidCombination5Test.cs b/.Lib9c.Tests/Action/RapidCombination5Test.cs index 8fdf14d652..74d435df67 100644 --- a/.Lib9c.Tests/Action/RapidCombination5Test.cs +++ b/.Lib9c.Tests/Action/RapidCombination5Test.cs @@ -362,45 +362,6 @@ public void Execute_Throw_NotEnoughMaterialException(int materialCount, int trad })); } - [Fact] - public void Rehearsal() - { - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - slotAddress, - }; - - var state = new Account(MockState.Empty); - - var action = new RapidCombination5 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(null)] [InlineData(1)] diff --git a/.Lib9c.Tests/Action/RapidCombination6Test.cs b/.Lib9c.Tests/Action/RapidCombination6Test.cs index 104a8efa28..8661ecc2ae 100644 --- a/.Lib9c.Tests/Action/RapidCombination6Test.cs +++ b/.Lib9c.Tests/Action/RapidCombination6Test.cs @@ -364,45 +364,6 @@ public void Execute_Throw_NotEnoughMaterialException(int materialCount, int trad })); } - [Fact] - public void Rehearsal() - { - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - slotAddress, - }; - - var state = new Account(MockState.Empty); - - var action = new RapidCombination6 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(null)] [InlineData(1)] diff --git a/.Lib9c.Tests/Action/RapidCombination7Test.cs b/.Lib9c.Tests/Action/RapidCombination7Test.cs index 3af440cf51..4b3e410f8f 100644 --- a/.Lib9c.Tests/Action/RapidCombination7Test.cs +++ b/.Lib9c.Tests/Action/RapidCombination7Test.cs @@ -364,45 +364,6 @@ public void Execute_Throw_NotEnoughMaterialException(int materialCount, int trad })); } - [Fact] - public void Rehearsal() - { - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - slotAddress, - }; - - var state = new Account(MockState.Empty); - - var action = new RapidCombination7 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(null)] [InlineData(1)] diff --git a/.Lib9c.Tests/Action/RapidCombination8Test.cs b/.Lib9c.Tests/Action/RapidCombination8Test.cs index a7a1a1545c..e7b0bf69c5 100644 --- a/.Lib9c.Tests/Action/RapidCombination8Test.cs +++ b/.Lib9c.Tests/Action/RapidCombination8Test.cs @@ -366,45 +366,6 @@ public void Execute_Throw_NotEnoughMaterialException(int materialCount, int trad })); } - [Fact] - public void Rehearsal() - { - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - slotAddress, - }; - - var state = new Account(MockState.Empty); - - var action = new RapidCombination8 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(null)] [InlineData(1)] diff --git a/.Lib9c.Tests/Action/RapidCombination9Test.cs b/.Lib9c.Tests/Action/RapidCombination9Test.cs index 23be0d5426..feed6308f1 100644 --- a/.Lib9c.Tests/Action/RapidCombination9Test.cs +++ b/.Lib9c.Tests/Action/RapidCombination9Test.cs @@ -381,45 +381,6 @@ public void Execute_Throw_NotEnoughMaterialException(int materialCount, int trad })); } - [Fact] - public void Rehearsal() - { - var slotAddress = _avatarAddress.Derive( - string.Format( - CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, - 0 - ) - ); - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - slotAddress, - }; - - var state = new Account(MockState.Empty); - - var action = new RapidCombination9 - { - avatarAddress = _avatarAddress, - slotIndex = 0, - }; - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } - [Theory] [InlineData(null)] [InlineData(1)] diff --git a/.Lib9c.Tests/Action/UpdateSell0Test.cs b/.Lib9c.Tests/Action/UpdateSell0Test.cs index 56f4be7baf..e3f2e64780 100644 --- a/.Lib9c.Tests/Action/UpdateSell0Test.cs +++ b/.Lib9c.Tests/Action/UpdateSell0Test.cs @@ -334,49 +334,5 @@ public void Execute_Throw_NotEnoughClearedStageLevelException() Signer = _agentAddress, })); } - - [Fact] - public void Rehearsal() - { - var tradableId = Guid.NewGuid(); - var orderId = Guid.NewGuid(); - var updateSellOrderId = Guid.NewGuid(); - var action = new UpdateSell0 - { - orderId = orderId, - updateSellOrderId = updateSellOrderId, - tradableId = tradableId, - sellerAvatarAddress = _avatarAddress, - itemSubType = ItemSubType.Weapon, - price = _currency * ProductPrice, - count = 1, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(updateSellOrderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, updateSellOrderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/UpdateSell2Test.cs b/.Lib9c.Tests/Action/UpdateSell2Test.cs index 6c4103521a..d6161ae5e9 100644 --- a/.Lib9c.Tests/Action/UpdateSell2Test.cs +++ b/.Lib9c.Tests/Action/UpdateSell2Test.cs @@ -315,49 +315,5 @@ public void Execute_Throw_NotEnoughClearedStageLevelException() Signer = _agentAddress, })); } - - [Fact] - public void Rehearsal() - { - var tradableId = Guid.NewGuid(); - var orderId = Guid.NewGuid(); - var updateSellOrderId = Guid.NewGuid(); - var action = new UpdateSell2 - { - orderId = orderId, - updateSellOrderId = updateSellOrderId, - tradableId = tradableId, - sellerAvatarAddress = _avatarAddress, - itemSubType = ItemSubType.Weapon, - price = _currency * ProductPrice, - count = 1, - }; - - var updatedAddresses = new List
() - { - _agentAddress, - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - Addresses.GetItemAddress(tradableId), - Order.DeriveAddress(updateSellOrderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, orderId), - ShardedShopStateV2.DeriveAddress(ItemSubType.Weapon, updateSellOrderId), - OrderDigestListState.DeriveAddress(_avatarAddress), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } From ccf07b944216c5317e65bfd41ebc4cb19a8c642a Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Sat, 11 Nov 2023 13:08:21 +0900 Subject: [PATCH 07/19] More action scrubbing --- Lib9c/Action/BattleArena.cs | 5 ----- Lib9c/Action/BattleArena1.cs | 4 ---- Lib9c/Action/BattleArena10.cs | 5 ----- Lib9c/Action/BattleArena11.cs | 5 ----- Lib9c/Action/BattleArena12.cs | 4 ---- Lib9c/Action/BattleArena13.cs | 5 ----- Lib9c/Action/BattleArena2.cs | 4 ---- Lib9c/Action/BattleArena3.cs | 4 ---- Lib9c/Action/BattleArena4.cs | 4 ---- Lib9c/Action/BattleArena5.cs | 4 ---- Lib9c/Action/BattleArena6.cs | 4 ---- Lib9c/Action/BattleArena7.cs | 4 ---- Lib9c/Action/BattleArena8.cs | 4 ---- Lib9c/Action/BattleArena9.cs | 4 ---- Lib9c/Action/BuyProduct.cs | 4 ---- Lib9c/Action/BuyProduct0.cs | 4 ---- Lib9c/Action/BuyProduct2.cs | 4 ---- Lib9c/Action/ClaimMonsterCollectionReward.cs | 13 ------------- Lib9c/Action/ClaimMonsterCollectionReward0.cs | 8 -------- Lib9c/Action/ClaimMonsterCollectionReward2.cs | 13 ------------- Lib9c/Action/ClaimStakeReward.cs | 5 ----- Lib9c/Action/ClaimStakeReward2.cs | 4 ---- Lib9c/Action/ClaimStakeReward3.cs | 4 ---- Lib9c/Action/ClaimStakeReward4.cs | 5 ----- Lib9c/Action/ClaimStakeReward5.cs | 5 ----- Lib9c/Action/ClaimStakeReward6.cs | 5 ----- Lib9c/Action/ClaimStakeReward7.cs | 5 ----- Lib9c/Action/ClaimStakeReward8.cs | 5 ----- Lib9c/Action/CombinationConsumable.cs | 10 ---------- Lib9c/Action/CombinationConsumable0.cs | 7 ------- Lib9c/Action/CombinationConsumable2.cs | 7 ------- Lib9c/Action/CombinationConsumable3.cs | 7 ------- Lib9c/Action/CombinationConsumable4.cs | 7 ------- Lib9c/Action/CombinationConsumable5.cs | 7 ------- Lib9c/Action/CombinationConsumable6.cs | 10 ---------- Lib9c/Action/CombinationConsumable7.cs | 10 ---------- Lib9c/Action/CombinationConsumable8.cs | 10 ---------- Lib9c/Action/CombinationEquipment.cs | 4 ---- Lib9c/Action/CombinationEquipment0.cs | 8 -------- Lib9c/Action/CombinationEquipment10.cs | 11 ----------- Lib9c/Action/CombinationEquipment11.cs | 11 ----------- Lib9c/Action/CombinationEquipment12.cs | 4 ---- Lib9c/Action/CombinationEquipment13.cs | 4 ---- Lib9c/Action/CombinationEquipment14.cs | 4 ---- Lib9c/Action/CombinationEquipment15.cs | 4 ---- Lib9c/Action/CombinationEquipment16.cs | 4 ---- Lib9c/Action/CombinationEquipment2.cs | 8 -------- Lib9c/Action/CombinationEquipment3.cs | 8 -------- Lib9c/Action/CombinationEquipment4.cs | 8 -------- Lib9c/Action/CombinationEquipment5.cs | 8 -------- Lib9c/Action/CombinationEquipment6.cs | 11 ----------- Lib9c/Action/CombinationEquipment7.cs | 11 ----------- Lib9c/Action/CombinationEquipment8.cs | 11 ----------- Lib9c/Action/CombinationEquipment9.cs | 11 ----------- Lib9c/Action/DailyReward.cs | 7 ------- Lib9c/Action/DailyReward5.cs | 4 ---- Lib9c/Action/DailyReward6.cs | 9 --------- Lib9c/Action/EventConsumableItemCrafts.cs | 5 ----- Lib9c/Action/EventConsumableItemCrafts0.cs | 5 ----- Lib9c/Action/EventDungeonBattle.cs | 5 ----- Lib9c/Action/EventDungeonBattleV1.cs | 4 ---- Lib9c/Action/EventDungeonBattleV2.cs | 4 ---- Lib9c/Action/EventDungeonBattleV3.cs | 4 ---- Lib9c/Action/EventDungeonBattleV4.cs | 5 ----- Lib9c/Action/EventDungeonBattleV5.cs | 5 ----- Lib9c/Action/EventMaterialItemCrafts.cs | 5 ----- Lib9c/Action/EventMaterialItemCrafts0.cs | 5 ----- Lib9c/Action/HackAndSlashSweep.cs | 5 ----- Lib9c/Action/HackAndSlashSweep1.cs | 8 -------- Lib9c/Action/HackAndSlashSweep2.cs | 8 -------- Lib9c/Action/HackAndSlashSweep3.cs | 8 -------- Lib9c/Action/HackAndSlashSweep4.cs | 8 -------- Lib9c/Action/HackAndSlashSweep5.cs | 4 ---- Lib9c/Action/HackAndSlashSweep6.cs | 4 ---- Lib9c/Action/HackAndSlashSweep7.cs | 4 ---- Lib9c/Action/HackAndSlashSweep8.cs | 4 ---- Lib9c/Action/HackAndSlashSweep9.cs | 4 ---- Lib9c/Action/JoinArena.cs | 5 ----- Lib9c/Action/JoinArena1.cs | 4 ---- Lib9c/Action/JoinArena2.cs | 4 ---- Lib9c/Action/JoinArena3.cs | 5 ----- Lib9c/Action/MimisbrunnrBattle.cs | 4 ---- Lib9c/Action/MimisbrunnrBattle0.cs | 6 ------ Lib9c/Action/MimisbrunnrBattle10.cs | 4 ---- Lib9c/Action/MimisbrunnrBattle11.cs | 4 ---- Lib9c/Action/MimisbrunnrBattle12.cs | 4 ---- Lib9c/Action/MimisbrunnrBattle2.cs | 6 ------ Lib9c/Action/MimisbrunnrBattle3.cs | 6 ------ Lib9c/Action/MimisbrunnrBattle4.cs | 10 ---------- Lib9c/Action/MimisbrunnrBattle5.cs | 10 ---------- Lib9c/Action/MimisbrunnrBattle6.cs | 10 ---------- Lib9c/Action/MimisbrunnrBattle7.cs | 10 ---------- Lib9c/Action/MimisbrunnrBattle8.cs | 9 --------- Lib9c/Action/MimisbrunnrBattle9.cs | 9 --------- Lib9c/Action/MonsterCollect.cs | 14 -------------- Lib9c/Action/MonsterCollect0.cs | 7 ------- Lib9c/Action/MonsterCollect2.cs | 13 ------------- Lib9c/Action/Raid.cs | 5 ----- Lib9c/Action/Raid1.cs | 4 ---- Lib9c/Action/Raid2.cs | 4 ---- Lib9c/Action/Raid3.cs | 4 ---- Lib9c/Action/Raid4.cs | 5 ----- Lib9c/Action/Raid5.cs | 5 ----- Lib9c/Action/Raid6.cs | 5 ----- Lib9c/Action/RankingBattle.cs | 9 --------- Lib9c/Action/RankingBattle0.cs | 8 -------- Lib9c/Action/RankingBattle10.cs | 9 --------- Lib9c/Action/RankingBattle11.cs | 9 --------- Lib9c/Action/RankingBattle2.cs | 8 -------- Lib9c/Action/RankingBattle3.cs | 8 -------- Lib9c/Action/RankingBattle4.cs | 8 -------- Lib9c/Action/RankingBattle5.cs | 9 --------- Lib9c/Action/RankingBattle6.cs | 9 --------- Lib9c/Action/RankingBattle7.cs | 9 --------- Lib9c/Action/RankingBattle8.cs | 9 --------- Lib9c/Action/RankingBattle9.cs | 9 --------- Lib9c/Action/RapidCombination.cs | 10 ---------- Lib9c/Action/RapidCombination0.cs | 6 ------ Lib9c/Action/RapidCombination2.cs | 6 ------ Lib9c/Action/RapidCombination3.cs | 6 ------ Lib9c/Action/RapidCombination4.cs | 9 --------- Lib9c/Action/RapidCombination5.cs | 9 --------- Lib9c/Action/RapidCombination6.cs | 10 +--------- Lib9c/Action/RapidCombination7.cs | 10 +--------- Lib9c/Action/RapidCombination8.cs | 9 --------- Lib9c/Action/RapidCombination9.cs | 9 --------- Lib9c/Action/RegisterProduct.cs | 4 ---- Lib9c/Action/RegisterProduct0.cs | 4 ---- Lib9c/Action/RegisterProduct2.cs | 4 ---- Lib9c/Action/SellCancellation.cs | 12 ------------ Lib9c/Action/SellCancellation6.cs | 7 ------- Lib9c/Action/SellCancellation7.cs | 11 ----------- Lib9c/Action/SellCancellation8.cs | 11 ----------- Lib9c/Action/Stake.cs | 10 ---------- Lib9c/Action/Stake0.cs | 10 ---------- Lib9c/Action/Stake2.cs | 10 ---------- Lib9c/Action/UpdateSell.cs | 4 ---- Lib9c/Action/UpdateSell0.cs | 14 -------------- Lib9c/Action/UpdateSell2.cs | 14 -------------- Lib9c/Action/UpdateSell3.cs | 4 ---- Lib9c/Action/UpdateSell4.cs | 4 ---- 141 files changed, 2 insertions(+), 958 deletions(-) diff --git a/Lib9c/Action/BattleArena.cs b/Lib9c/Action/BattleArena.cs index 442af4d66b..fafb8d0409 100644 --- a/Lib9c/Action/BattleArena.cs +++ b/Lib9c/Action/BattleArena.cs @@ -90,11 +90,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex( context, myAvatarAddress, diff --git a/Lib9c/Action/BattleArena1.cs b/Lib9c/Action/BattleArena1.cs index 1a80652e7e..2259256f26 100644 --- a/Lib9c/Action/BattleArena1.cs +++ b/Lib9c/Action/BattleArena1.cs @@ -88,10 +88,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100290ObsoleteIndex, context); diff --git a/Lib9c/Action/BattleArena10.cs b/Lib9c/Action/BattleArena10.cs index 9c40c0467b..082f8a71cc 100644 --- a/Lib9c/Action/BattleArena10.cs +++ b/Lib9c/Action/BattleArena10.cs @@ -93,11 +93,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex( context, myAvatarAddress, diff --git a/Lib9c/Action/BattleArena11.cs b/Lib9c/Action/BattleArena11.cs index 817bf1c288..aa5a7182a0 100644 --- a/Lib9c/Action/BattleArena11.cs +++ b/Lib9c/Action/BattleArena11.cs @@ -91,11 +91,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex( context, myAvatarAddress, diff --git a/Lib9c/Action/BattleArena12.cs b/Lib9c/Action/BattleArena12.cs index 6c74329779..14ff41e2bd 100644 --- a/Lib9c/Action/BattleArena12.cs +++ b/Lib9c/Action/BattleArena12.cs @@ -91,10 +91,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200070ObsoleteIndex, context); if (championshipId == 6 && round >= 2 || championshipId > 6) diff --git a/Lib9c/Action/BattleArena13.cs b/Lib9c/Action/BattleArena13.cs index 544b9e0b8f..0349f968cf 100644 --- a/Lib9c/Action/BattleArena13.cs +++ b/Lib9c/Action/BattleArena13.cs @@ -92,11 +92,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); var states = context.PreviousState; var random = context.GetRandom(); - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex( context, myAvatarAddress, diff --git a/Lib9c/Action/BattleArena2.cs b/Lib9c/Action/BattleArena2.cs index 7e2bb48e2c..6d690bbacd 100644 --- a/Lib9c/Action/BattleArena2.cs +++ b/Lib9c/Action/BattleArena2.cs @@ -87,10 +87,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100290ObsoleteIndex, context); diff --git a/Lib9c/Action/BattleArena3.cs b/Lib9c/Action/BattleArena3.cs index b0898715c7..df8ddb80d3 100644 --- a/Lib9c/Action/BattleArena3.cs +++ b/Lib9c/Action/BattleArena3.cs @@ -87,10 +87,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100290ObsoleteIndex, context); diff --git a/Lib9c/Action/BattleArena4.cs b/Lib9c/Action/BattleArena4.cs index 905012c8f9..1d6e9b1433 100644 --- a/Lib9c/Action/BattleArena4.cs +++ b/Lib9c/Action/BattleArena4.cs @@ -87,10 +87,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100320ObsoleteIndex, context); diff --git a/Lib9c/Action/BattleArena5.cs b/Lib9c/Action/BattleArena5.cs index b68211ba8c..a36ffd61a0 100644 --- a/Lib9c/Action/BattleArena5.cs +++ b/Lib9c/Action/BattleArena5.cs @@ -88,10 +88,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100320ObsoleteIndex, context); diff --git a/Lib9c/Action/BattleArena6.cs b/Lib9c/Action/BattleArena6.cs index 5aecca6594..35ca737097 100644 --- a/Lib9c/Action/BattleArena6.cs +++ b/Lib9c/Action/BattleArena6.cs @@ -89,10 +89,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (championshipId > 2) { diff --git a/Lib9c/Action/BattleArena7.cs b/Lib9c/Action/BattleArena7.cs index bc048bfea6..3ce8849245 100644 --- a/Lib9c/Action/BattleArena7.cs +++ b/Lib9c/Action/BattleArena7.cs @@ -95,10 +95,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/BattleArena8.cs b/Lib9c/Action/BattleArena8.cs index 0ce0b28816..a60080b5cf 100644 --- a/Lib9c/Action/BattleArena8.cs +++ b/Lib9c/Action/BattleArena8.cs @@ -97,10 +97,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex( diff --git a/Lib9c/Action/BattleArena9.cs b/Lib9c/Action/BattleArena9.cs index 4c92f0fe30..02b9d6171a 100644 --- a/Lib9c/Action/BattleArena9.cs +++ b/Lib9c/Action/BattleArena9.cs @@ -96,10 +96,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } var addressesHex = GetSignerAndOtherAddressesHex( context, diff --git a/Lib9c/Action/BuyProduct.cs b/Lib9c/Action/BuyProduct.cs index 0793833d55..3ee300f256 100644 --- a/Lib9c/Action/BuyProduct.cs +++ b/Lib9c/Action/BuyProduct.cs @@ -34,10 +34,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } var sw = new Stopwatch(); sw.Start(); diff --git a/Lib9c/Action/BuyProduct0.cs b/Lib9c/Action/BuyProduct0.cs index 45c17f03ab..5a660d1ebe 100644 --- a/Lib9c/Action/BuyProduct0.cs +++ b/Lib9c/Action/BuyProduct0.cs @@ -35,10 +35,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } var sw = new Stopwatch(); sw.Start(); diff --git a/Lib9c/Action/BuyProduct2.cs b/Lib9c/Action/BuyProduct2.cs index 49fede92b3..0031ed0d08 100644 --- a/Lib9c/Action/BuyProduct2.cs +++ b/Lib9c/Action/BuyProduct2.cs @@ -35,10 +35,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } var sw = new Stopwatch(); sw.Start(); diff --git a/Lib9c/Action/ClaimMonsterCollectionReward.cs b/Lib9c/Action/ClaimMonsterCollectionReward.cs index 85bfb70c3c..7abf842e7b 100644 --- a/Lib9c/Action/ClaimMonsterCollectionReward.cs +++ b/Lib9c/Action/ClaimMonsterCollectionReward.cs @@ -47,19 +47,6 @@ public static IAccount Claim(IActionContext context, Address avatarAddress, stri var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}ClaimMonsterCollection exec started", addressesHex); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 0), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 1), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 2), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 3), MarkChanged); - } - if (!states.TryGetAgentAvatarStatesV2(context.Signer, avatarAddress, out AgentState agentState, out AvatarState avatarState, out _)) { throw new FailedLoadStateException($"Aborted as the avatar state of the signer failed to load."); diff --git a/Lib9c/Action/ClaimMonsterCollectionReward0.cs b/Lib9c/Action/ClaimMonsterCollectionReward0.cs index b82cfd089f..52692d5a4b 100644 --- a/Lib9c/Action/ClaimMonsterCollectionReward0.cs +++ b/Lib9c/Action/ClaimMonsterCollectionReward0.cs @@ -32,14 +32,6 @@ public override IAccount Execute(IActionContext context) IAccount states = context.PreviousState; Address collectionAddress = MonsterCollectionState0.DeriveAddress(context.Signer, collectionRound); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(avatarAddress, MarkChanged) - .SetState(collectionAddress, MarkChanged); - } - CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); if (!states.TryGetAgentAvatarStates(context.Signer, avatarAddress, out AgentState agentState, out AvatarState avatarState)) diff --git a/Lib9c/Action/ClaimMonsterCollectionReward2.cs b/Lib9c/Action/ClaimMonsterCollectionReward2.cs index fbe7ba910a..00d2ef3603 100644 --- a/Lib9c/Action/ClaimMonsterCollectionReward2.cs +++ b/Lib9c/Action/ClaimMonsterCollectionReward2.cs @@ -33,19 +33,6 @@ public override IAccount Execute(IActionContext context) Address worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); Address questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 0), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 1), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 2), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 3), MarkChanged); - } - CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); if (!states.TryGetAgentAvatarStatesV2(context.Signer, avatarAddress, out AgentState agentState, out AvatarState avatarState, out _)) diff --git a/Lib9c/Action/ClaimStakeReward.cs b/Lib9c/Action/ClaimStakeReward.cs index 6cff524dd7..84b8d3bb50 100644 --- a/Lib9c/Action/ClaimStakeReward.cs +++ b/Lib9c/Action/ClaimStakeReward.cs @@ -53,11 +53,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var stakeStateAddr = StakeState.DeriveAddress(context.Signer); diff --git a/Lib9c/Action/ClaimStakeReward2.cs b/Lib9c/Action/ClaimStakeReward2.cs index 4f1478a6cd..53dc346a1f 100644 --- a/Lib9c/Action/ClaimStakeReward2.cs +++ b/Lib9c/Action/ClaimStakeReward2.cs @@ -38,10 +38,6 @@ public ClaimStakeReward2() public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } var states = context.PreviousState; CheckObsolete(ObsoletedIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); diff --git a/Lib9c/Action/ClaimStakeReward3.cs b/Lib9c/Action/ClaimStakeReward3.cs index 8f4e22c109..d70517af59 100644 --- a/Lib9c/Action/ClaimStakeReward3.cs +++ b/Lib9c/Action/ClaimStakeReward3.cs @@ -169,10 +169,6 @@ private IAccount ProcessReward( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } CheckActionAvailable(ClaimStakeReward2.ObsoletedIndex, context); CheckObsolete(ObsoleteBlockIndex, context); diff --git a/Lib9c/Action/ClaimStakeReward4.cs b/Lib9c/Action/ClaimStakeReward4.cs index fc3b176b45..b308bfe3d2 100644 --- a/Lib9c/Action/ClaimStakeReward4.cs +++ b/Lib9c/Action/ClaimStakeReward4.cs @@ -127,11 +127,6 @@ public override IAccount Execute(IActionContext context) { CheckObsolete(ObsoleteBlockIndex, context); context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); if (!states.TryGetStakeState(context.Signer, out var stakeState)) diff --git a/Lib9c/Action/ClaimStakeReward5.cs b/Lib9c/Action/ClaimStakeReward5.cs index 7b067813c1..e9c25f8303 100644 --- a/Lib9c/Action/ClaimStakeReward5.cs +++ b/Lib9c/Action/ClaimStakeReward5.cs @@ -127,11 +127,6 @@ public override IAccount Execute(IActionContext context) { CheckObsolete(ObsoleteBlockIndex, context); context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); if (!states.TryGetStakeState(context.Signer, out var stakeState)) diff --git a/Lib9c/Action/ClaimStakeReward6.cs b/Lib9c/Action/ClaimStakeReward6.cs index 01138a3d4a..0cd05be353 100644 --- a/Lib9c/Action/ClaimStakeReward6.cs +++ b/Lib9c/Action/ClaimStakeReward6.cs @@ -202,11 +202,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); if (!states.TryGetStakeState(context.Signer, out var stakeState)) diff --git a/Lib9c/Action/ClaimStakeReward7.cs b/Lib9c/Action/ClaimStakeReward7.cs index c14f31636e..a69f215ab7 100644 --- a/Lib9c/Action/ClaimStakeReward7.cs +++ b/Lib9c/Action/ClaimStakeReward7.cs @@ -203,11 +203,6 @@ public override IAccount Execute(IActionContext context) { CheckObsolete(ObsoleteBlockIndex, context); context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); if (!states.TryGetStakeState(context.Signer, out var stakeState)) diff --git a/Lib9c/Action/ClaimStakeReward8.cs b/Lib9c/Action/ClaimStakeReward8.cs index 335d4065fd..3c8f08503a 100644 --- a/Lib9c/Action/ClaimStakeReward8.cs +++ b/Lib9c/Action/ClaimStakeReward8.cs @@ -202,11 +202,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); if (!states.TryGetStakeState(context.Signer, out var stakeState)) diff --git a/Lib9c/Action/CombinationConsumable.cs b/Lib9c/Action/CombinationConsumable.cs index 37d1a1ba96..f272ff0ff2 100644 --- a/Lib9c/Action/CombinationConsumable.cs +++ b/Lib9c/Action/CombinationConsumable.cs @@ -70,16 +70,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/CombinationConsumable0.cs b/Lib9c/Action/CombinationConsumable0.cs index 9ef362b126..8e0af591f1 100644 --- a/Lib9c/Action/CombinationConsumable0.cs +++ b/Lib9c/Action/CombinationConsumable0.cs @@ -79,13 +79,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationConsumable2.cs b/Lib9c/Action/CombinationConsumable2.cs index e8b9f65501..a05ee7422d 100644 --- a/Lib9c/Action/CombinationConsumable2.cs +++ b/Lib9c/Action/CombinationConsumable2.cs @@ -79,13 +79,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationConsumable3.cs b/Lib9c/Action/CombinationConsumable3.cs index 01d4b2d35f..9a86b85513 100644 --- a/Lib9c/Action/CombinationConsumable3.cs +++ b/Lib9c/Action/CombinationConsumable3.cs @@ -79,13 +79,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationConsumable4.cs b/Lib9c/Action/CombinationConsumable4.cs index e1b9e2823e..41eb8191ba 100644 --- a/Lib9c/Action/CombinationConsumable4.cs +++ b/Lib9c/Action/CombinationConsumable4.cs @@ -79,13 +79,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationConsumable5.cs b/Lib9c/Action/CombinationConsumable5.cs index c74b8e0481..114633f3fe 100644 --- a/Lib9c/Action/CombinationConsumable5.cs +++ b/Lib9c/Action/CombinationConsumable5.cs @@ -117,13 +117,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationConsumable6.cs b/Lib9c/Action/CombinationConsumable6.cs index 2335e58417..3ce1493bf5 100644 --- a/Lib9c/Action/CombinationConsumable6.cs +++ b/Lib9c/Action/CombinationConsumable6.cs @@ -78,16 +78,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationConsumable7.cs b/Lib9c/Action/CombinationConsumable7.cs index f5d7cd8569..faeaae310f 100644 --- a/Lib9c/Action/CombinationConsumable7.cs +++ b/Lib9c/Action/CombinationConsumable7.cs @@ -79,16 +79,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationConsumable8.cs b/Lib9c/Action/CombinationConsumable8.cs index dbe673e17b..3260fc4228 100644 --- a/Lib9c/Action/CombinationConsumable8.cs +++ b/Lib9c/Action/CombinationConsumable8.cs @@ -74,16 +74,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/CombinationEquipment.cs b/Lib9c/Action/CombinationEquipment.cs index 1812f35b0e..c9053fbd0f 100644 --- a/Lib9c/Action/CombinationEquipment.cs +++ b/Lib9c/Action/CombinationEquipment.cs @@ -97,10 +97,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/CombinationEquipment0.cs b/Lib9c/Action/CombinationEquipment0.cs index 34d430919a..a02f40ca6b 100644 --- a/Lib9c/Action/CombinationEquipment0.cs +++ b/Lib9c/Action/CombinationEquipment0.cs @@ -49,14 +49,6 @@ public override IAccount Execute(IActionContext context) SlotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment10.cs b/Lib9c/Action/CombinationEquipment10.cs index 6e863121f6..4793570328 100644 --- a/Lib9c/Action/CombinationEquipment10.cs +++ b/Lib9c/Action/CombinationEquipment10.cs @@ -74,17 +74,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100220ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment11.cs b/Lib9c/Action/CombinationEquipment11.cs index 60f7355f8e..e8a7f0b0c1 100644 --- a/Lib9c/Action/CombinationEquipment11.cs +++ b/Lib9c/Action/CombinationEquipment11.cs @@ -75,17 +75,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, ItemEnhancement10.GetFeeStoreAddress()); - } CheckObsolete(ActionObsoleteConfig.V100270ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment12.cs b/Lib9c/Action/CombinationEquipment12.cs index 7c95e62fe6..bb72fb2b85 100644 --- a/Lib9c/Action/CombinationEquipment12.cs +++ b/Lib9c/Action/CombinationEquipment12.cs @@ -83,10 +83,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment13.cs b/Lib9c/Action/CombinationEquipment13.cs index 4d0210aa40..ea4eaeb514 100644 --- a/Lib9c/Action/CombinationEquipment13.cs +++ b/Lib9c/Action/CombinationEquipment13.cs @@ -91,10 +91,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100282ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment14.cs b/Lib9c/Action/CombinationEquipment14.cs index b38d35b5b2..51d248b6fa 100644 --- a/Lib9c/Action/CombinationEquipment14.cs +++ b/Lib9c/Action/CombinationEquipment14.cs @@ -92,10 +92,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CombinationEquipment15.cs b/Lib9c/Action/CombinationEquipment15.cs index 1ffa368155..cc626d5296 100644 --- a/Lib9c/Action/CombinationEquipment15.cs +++ b/Lib9c/Action/CombinationEquipment15.cs @@ -92,10 +92,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/CombinationEquipment16.cs b/Lib9c/Action/CombinationEquipment16.cs index a2068fd7bf..31ac61e9e7 100644 --- a/Lib9c/Action/CombinationEquipment16.cs +++ b/Lib9c/Action/CombinationEquipment16.cs @@ -99,10 +99,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/CombinationEquipment2.cs b/Lib9c/Action/CombinationEquipment2.cs index 2c18b7c1c4..c8c343ab23 100644 --- a/Lib9c/Action/CombinationEquipment2.cs +++ b/Lib9c/Action/CombinationEquipment2.cs @@ -49,14 +49,6 @@ public override IAccount Execute(IActionContext context) SlotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment3.cs b/Lib9c/Action/CombinationEquipment3.cs index 3d02d22744..f50da4718f 100644 --- a/Lib9c/Action/CombinationEquipment3.cs +++ b/Lib9c/Action/CombinationEquipment3.cs @@ -49,14 +49,6 @@ public override IAccount Execute(IActionContext context) SlotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment4.cs b/Lib9c/Action/CombinationEquipment4.cs index cccb637d86..de5a1f8ef1 100644 --- a/Lib9c/Action/CombinationEquipment4.cs +++ b/Lib9c/Action/CombinationEquipment4.cs @@ -49,14 +49,6 @@ public override IAccount Execute(IActionContext context) SlotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment5.cs b/Lib9c/Action/CombinationEquipment5.cs index 076e0ff05e..c7dff1e535 100644 --- a/Lib9c/Action/CombinationEquipment5.cs +++ b/Lib9c/Action/CombinationEquipment5.cs @@ -49,14 +49,6 @@ public override IAccount Execute(IActionContext context) SlotIndex ) ); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment6.cs b/Lib9c/Action/CombinationEquipment6.cs index d9a9c952cf..f564c99f32 100644 --- a/Lib9c/Action/CombinationEquipment6.cs +++ b/Lib9c/Action/CombinationEquipment6.cs @@ -53,17 +53,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment7.cs b/Lib9c/Action/CombinationEquipment7.cs index e3cdf12901..98dd8b4c91 100644 --- a/Lib9c/Action/CombinationEquipment7.cs +++ b/Lib9c/Action/CombinationEquipment7.cs @@ -52,17 +52,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment8.cs b/Lib9c/Action/CombinationEquipment8.cs index 0844814a03..226f11ac49 100644 --- a/Lib9c/Action/CombinationEquipment8.cs +++ b/Lib9c/Action/CombinationEquipment8.cs @@ -74,17 +74,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V100086ObsoleteIndex, context); diff --git a/Lib9c/Action/CombinationEquipment9.cs b/Lib9c/Action/CombinationEquipment9.cs index 79cd08f4f7..54e2d682dc 100644 --- a/Lib9c/Action/CombinationEquipment9.cs +++ b/Lib9c/Action/CombinationEquipment9.cs @@ -74,17 +74,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, BlacksmithAddress); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/DailyReward.cs b/Lib9c/Action/DailyReward.cs index 3e43a88758..3a3513a9e4 100644 --- a/Lib9c/Action/DailyReward.cs +++ b/Lib9c/Action/DailyReward.cs @@ -32,13 +32,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, avatarAddress); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}DailyReward exec started", addressesHex); diff --git a/Lib9c/Action/DailyReward5.cs b/Lib9c/Action/DailyReward5.cs index 2b2fd9e7e8..b060069188 100644 --- a/Lib9c/Action/DailyReward5.cs +++ b/Lib9c/Action/DailyReward5.cs @@ -26,10 +26,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states.SetState(avatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/DailyReward6.cs b/Lib9c/Action/DailyReward6.cs index 7fad85616d..37cef1a0eb 100644 --- a/Lib9c/Action/DailyReward6.cs +++ b/Lib9c/Action/DailyReward6.cs @@ -36,15 +36,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, avatarAddress); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/EventConsumableItemCrafts.cs b/Lib9c/Action/EventConsumableItemCrafts.cs index 3be87289a3..d07f8e07f4 100644 --- a/Lib9c/Action/EventConsumableItemCrafts.cs +++ b/Lib9c/Action/EventConsumableItemCrafts.cs @@ -83,11 +83,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Verbose( diff --git a/Lib9c/Action/EventConsumableItemCrafts0.cs b/Lib9c/Action/EventConsumableItemCrafts0.cs index c8d86ac9f9..dbc6987ebe 100644 --- a/Lib9c/Action/EventConsumableItemCrafts0.cs +++ b/Lib9c/Action/EventConsumableItemCrafts0.cs @@ -82,11 +82,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); var states = context.PreviousState; var random = context.GetRandom(); - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Verbose( diff --git a/Lib9c/Action/EventDungeonBattle.cs b/Lib9c/Action/EventDungeonBattle.cs index ec984be138..ddb71e8348 100644 --- a/Lib9c/Action/EventDungeonBattle.cs +++ b/Lib9c/Action/EventDungeonBattle.cs @@ -119,11 +119,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Verbose( diff --git a/Lib9c/Action/EventDungeonBattleV1.cs b/Lib9c/Action/EventDungeonBattleV1.cs index e63f5ba983..1cc9401927 100644 --- a/Lib9c/Action/EventDungeonBattleV1.cs +++ b/Lib9c/Action/EventDungeonBattleV1.cs @@ -113,10 +113,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); diff --git a/Lib9c/Action/EventDungeonBattleV2.cs b/Lib9c/Action/EventDungeonBattleV2.cs index 447e9a17ba..6e459479f6 100644 --- a/Lib9c/Action/EventDungeonBattleV2.cs +++ b/Lib9c/Action/EventDungeonBattleV2.cs @@ -113,10 +113,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100340ObsoleteIndex, context); diff --git a/Lib9c/Action/EventDungeonBattleV3.cs b/Lib9c/Action/EventDungeonBattleV3.cs index cb355470db..df14159656 100644 --- a/Lib9c/Action/EventDungeonBattleV3.cs +++ b/Lib9c/Action/EventDungeonBattleV3.cs @@ -121,10 +121,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/EventDungeonBattleV4.cs b/Lib9c/Action/EventDungeonBattleV4.cs index 369657190f..b852a2cbb9 100644 --- a/Lib9c/Action/EventDungeonBattleV4.cs +++ b/Lib9c/Action/EventDungeonBattleV4.cs @@ -120,11 +120,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Verbose( diff --git a/Lib9c/Action/EventDungeonBattleV5.cs b/Lib9c/Action/EventDungeonBattleV5.cs index 5065a78dde..58bb32109c 100644 --- a/Lib9c/Action/EventDungeonBattleV5.cs +++ b/Lib9c/Action/EventDungeonBattleV5.cs @@ -121,11 +121,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); var states = context.PreviousState; var random = context.GetRandom(); - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Verbose( diff --git a/Lib9c/Action/EventMaterialItemCrafts.cs b/Lib9c/Action/EventMaterialItemCrafts.cs index 0e39c381a7..882e21a887 100644 --- a/Lib9c/Action/EventMaterialItemCrafts.cs +++ b/Lib9c/Action/EventMaterialItemCrafts.cs @@ -91,11 +91,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug( diff --git a/Lib9c/Action/EventMaterialItemCrafts0.cs b/Lib9c/Action/EventMaterialItemCrafts0.cs index e703804145..89092de361 100644 --- a/Lib9c/Action/EventMaterialItemCrafts0.cs +++ b/Lib9c/Action/EventMaterialItemCrafts0.cs @@ -89,11 +89,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug( diff --git a/Lib9c/Action/HackAndSlashSweep.cs b/Lib9c/Action/HackAndSlashSweep.cs index 5bc3c94ef4..a9834e1471 100644 --- a/Lib9c/Action/HackAndSlashSweep.cs +++ b/Lib9c/Action/HackAndSlashSweep.cs @@ -78,11 +78,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}HackAndSlashSweep exec started", addressesHex); diff --git a/Lib9c/Action/HackAndSlashSweep1.cs b/Lib9c/Action/HackAndSlashSweep1.cs index bea3a829c5..7e1b94bcde 100644 --- a/Lib9c/Action/HackAndSlashSweep1.cs +++ b/Lib9c/Action/HackAndSlashSweep1.cs @@ -59,14 +59,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(avatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100193ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlashSweep2.cs b/Lib9c/Action/HackAndSlashSweep2.cs index f44a11bedc..f8b1268d96 100644 --- a/Lib9c/Action/HackAndSlashSweep2.cs +++ b/Lib9c/Action/HackAndSlashSweep2.cs @@ -59,14 +59,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(avatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100200ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlashSweep3.cs b/Lib9c/Action/HackAndSlashSweep3.cs index 4b7f9b81a8..b6a50937c1 100644 --- a/Lib9c/Action/HackAndSlashSweep3.cs +++ b/Lib9c/Action/HackAndSlashSweep3.cs @@ -75,14 +75,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(avatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged); - } var arenaSheetAddress = Addresses.GetSheetAddress(); var arenaSheetState = states.GetState(arenaSheetAddress); diff --git a/Lib9c/Action/HackAndSlashSweep4.cs b/Lib9c/Action/HackAndSlashSweep4.cs index 5df83a6ba5..4607ef7f24 100644 --- a/Lib9c/Action/HackAndSlashSweep4.cs +++ b/Lib9c/Action/HackAndSlashSweep4.cs @@ -75,14 +75,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(avatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100300ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlashSweep5.cs b/Lib9c/Action/HackAndSlashSweep5.cs index d609659613..9a5fc2a81a 100644 --- a/Lib9c/Action/HackAndSlashSweep5.cs +++ b/Lib9c/Action/HackAndSlashSweep5.cs @@ -74,10 +74,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100300ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlashSweep6.cs b/Lib9c/Action/HackAndSlashSweep6.cs index fdfbb7b7c6..ed76cbea25 100644 --- a/Lib9c/Action/HackAndSlashSweep6.cs +++ b/Lib9c/Action/HackAndSlashSweep6.cs @@ -74,10 +74,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/HackAndSlashSweep7.cs b/Lib9c/Action/HackAndSlashSweep7.cs index 9815e6af14..f243f8a141 100644 --- a/Lib9c/Action/HackAndSlashSweep7.cs +++ b/Lib9c/Action/HackAndSlashSweep7.cs @@ -73,10 +73,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100340ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlashSweep8.cs b/Lib9c/Action/HackAndSlashSweep8.cs index e089d21416..db7a93bfa1 100644 --- a/Lib9c/Action/HackAndSlashSweep8.cs +++ b/Lib9c/Action/HackAndSlashSweep8.cs @@ -79,10 +79,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/HackAndSlashSweep9.cs b/Lib9c/Action/HackAndSlashSweep9.cs index 1edec10011..963b806db0 100644 --- a/Lib9c/Action/HackAndSlashSweep9.cs +++ b/Lib9c/Action/HackAndSlashSweep9.cs @@ -80,10 +80,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); var states = context.PreviousState; var random = context.GetRandom(); - if (context.Rehearsal) - { - return states; - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/JoinArena.cs b/Lib9c/Action/JoinArena.cs index 9be265d12d..fa03c5726c 100644 --- a/Lib9c/Action/JoinArena.cs +++ b/Lib9c/Action/JoinArena.cs @@ -70,11 +70,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}JoinArena exec started", addressesHex); diff --git a/Lib9c/Action/JoinArena1.cs b/Lib9c/Action/JoinArena1.cs index 3e6228a7d1..0b27ba1fb9 100644 --- a/Lib9c/Action/JoinArena1.cs +++ b/Lib9c/Action/JoinArena1.cs @@ -65,10 +65,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (championshipId > 2) { diff --git a/Lib9c/Action/JoinArena2.cs b/Lib9c/Action/JoinArena2.cs index 6f4b7ec28d..f7eae1b27d 100644 --- a/Lib9c/Action/JoinArena2.cs +++ b/Lib9c/Action/JoinArena2.cs @@ -71,10 +71,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/JoinArena3.cs b/Lib9c/Action/JoinArena3.cs index 6616e27cd2..5e5184d610 100644 --- a/Lib9c/Action/JoinArena3.cs +++ b/Lib9c/Action/JoinArena3.cs @@ -71,11 +71,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}JoinArena exec started", addressesHex); diff --git a/Lib9c/Action/MimisbrunnrBattle.cs b/Lib9c/Action/MimisbrunnrBattle.cs index 131262f6c5..1569effa05 100644 --- a/Lib9c/Action/MimisbrunnrBattle.cs +++ b/Lib9c/Action/MimisbrunnrBattle.cs @@ -85,10 +85,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); diff --git a/Lib9c/Action/MimisbrunnrBattle0.cs b/Lib9c/Action/MimisbrunnrBattle0.cs index fad076b425..49ecdfe3cc 100644 --- a/Lib9c/Action/MimisbrunnrBattle0.cs +++ b/Lib9c/Action/MimisbrunnrBattle0.cs @@ -74,12 +74,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - return states.SetState(WeeklyArenaAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle10.cs b/Lib9c/Action/MimisbrunnrBattle10.cs index c56c05227b..a534172660 100644 --- a/Lib9c/Action/MimisbrunnrBattle10.cs +++ b/Lib9c/Action/MimisbrunnrBattle10.cs @@ -76,10 +76,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/MimisbrunnrBattle11.cs b/Lib9c/Action/MimisbrunnrBattle11.cs index 17253ea84a..dcfede31df 100644 --- a/Lib9c/Action/MimisbrunnrBattle11.cs +++ b/Lib9c/Action/MimisbrunnrBattle11.cs @@ -85,10 +85,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle12.cs b/Lib9c/Action/MimisbrunnrBattle12.cs index 2c22b0b86e..1aa7d4f081 100644 --- a/Lib9c/Action/MimisbrunnrBattle12.cs +++ b/Lib9c/Action/MimisbrunnrBattle12.cs @@ -86,10 +86,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var sw = new Stopwatch(); diff --git a/Lib9c/Action/MimisbrunnrBattle2.cs b/Lib9c/Action/MimisbrunnrBattle2.cs index 66bbb6241e..1c5f70dd7a 100644 --- a/Lib9c/Action/MimisbrunnrBattle2.cs +++ b/Lib9c/Action/MimisbrunnrBattle2.cs @@ -74,12 +74,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - return states.SetState(WeeklyArenaAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle3.cs b/Lib9c/Action/MimisbrunnrBattle3.cs index b9e4f0bae6..28e4a7ee30 100644 --- a/Lib9c/Action/MimisbrunnrBattle3.cs +++ b/Lib9c/Action/MimisbrunnrBattle3.cs @@ -74,12 +74,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - return states.SetState(WeeklyArenaAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle4.cs b/Lib9c/Action/MimisbrunnrBattle4.cs index 9ca20fb513..495fbcf1b6 100644 --- a/Lib9c/Action/MimisbrunnrBattle4.cs +++ b/Lib9c/Action/MimisbrunnrBattle4.cs @@ -76,16 +76,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(RankingMapAddress, MarkChanged); - states = states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(WeeklyArenaAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle5.cs b/Lib9c/Action/MimisbrunnrBattle5.cs index 4179f76609..030a7d058a 100644 --- a/Lib9c/Action/MimisbrunnrBattle5.cs +++ b/Lib9c/Action/MimisbrunnrBattle5.cs @@ -70,16 +70,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(rankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100083ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle6.cs b/Lib9c/Action/MimisbrunnrBattle6.cs index fbbb9d8e2a..9792d22ff3 100644 --- a/Lib9c/Action/MimisbrunnrBattle6.cs +++ b/Lib9c/Action/MimisbrunnrBattle6.cs @@ -74,16 +74,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(rankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100086ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle7.cs b/Lib9c/Action/MimisbrunnrBattle7.cs index 366b51f1d7..d5fbba984d 100644 --- a/Lib9c/Action/MimisbrunnrBattle7.cs +++ b/Lib9c/Action/MimisbrunnrBattle7.cs @@ -74,16 +74,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(rankingMapAddress, MarkChanged); - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100170ObsoleteIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle8.cs b/Lib9c/Action/MimisbrunnrBattle8.cs index e11a3f7965..aa9f3f16d1 100644 --- a/Lib9c/Action/MimisbrunnrBattle8.cs +++ b/Lib9c/Action/MimisbrunnrBattle8.cs @@ -76,15 +76,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ObsoletedBlockIndex, context); diff --git a/Lib9c/Action/MimisbrunnrBattle9.cs b/Lib9c/Action/MimisbrunnrBattle9.cs index 17fb1a5a48..3e6cc2a210 100644 --- a/Lib9c/Action/MimisbrunnrBattle9.cs +++ b/Lib9c/Action/MimisbrunnrBattle9.cs @@ -75,15 +75,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = states.SetState(avatarAddress, MarkChanged); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - return states.SetState(ctx.Signer, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100340ObsoleteIndex, context); diff --git a/Lib9c/Action/MonsterCollect.cs b/Lib9c/Action/MonsterCollect.cs index 5ebf4d83c9..3f5235a166 100644 --- a/Lib9c/Action/MonsterCollect.cs +++ b/Lib9c/Action/MonsterCollect.cs @@ -31,20 +31,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 0), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 1), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 2), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 3), MarkChanged) - .SetState(context.Signer, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 0)) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 1)) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 2)) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 3)); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, context.Signer); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}MonsterCollect exec started", addressesHex); diff --git a/Lib9c/Action/MonsterCollect0.cs b/Lib9c/Action/MonsterCollect0.cs index 9e5ac8b2d8..a0c57dd037 100644 --- a/Lib9c/Action/MonsterCollect0.cs +++ b/Lib9c/Action/MonsterCollect0.cs @@ -29,13 +29,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IAccount states = context.PreviousState; Address monsterCollectionAddress = MonsterCollectionState0.DeriveAddress(context.Signer, collectionRound); - if (context.Rehearsal) - { - return states - .SetState(monsterCollectionAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, monsterCollectionAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/MonsterCollect2.cs b/Lib9c/Action/MonsterCollect2.cs index a1765fb60f..999df1ad86 100644 --- a/Lib9c/Action/MonsterCollect2.cs +++ b/Lib9c/Action/MonsterCollect2.cs @@ -26,19 +26,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 0), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 1), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 2), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 3), MarkChanged) - .SetState(context.Signer, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 0)) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 1)) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 2)) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, MonsterCollectionState.DeriveAddress(context.Signer, 3)); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Raid.cs b/Lib9c/Action/Raid.cs index 097252d1b3..f28daa0ca6 100644 --- a/Lib9c/Action/Raid.cs +++ b/Lib9c/Action/Raid.cs @@ -46,11 +46,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressHex}Raid exec started", addressHex); diff --git a/Lib9c/Action/Raid1.cs b/Lib9c/Action/Raid1.cs index d141be667b..6bc5454a27 100644 --- a/Lib9c/Action/Raid1.cs +++ b/Lib9c/Action/Raid1.cs @@ -39,10 +39,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/Raid2.cs b/Lib9c/Action/Raid2.cs index 93be5d8925..ca7d54e13c 100644 --- a/Lib9c/Action/Raid2.cs +++ b/Lib9c/Action/Raid2.cs @@ -43,10 +43,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100340ObsoleteIndex, context); diff --git a/Lib9c/Action/Raid3.cs b/Lib9c/Action/Raid3.cs index 147a32495e..5cd945daa0 100644 --- a/Lib9c/Action/Raid3.cs +++ b/Lib9c/Action/Raid3.cs @@ -47,10 +47,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/Raid4.cs b/Lib9c/Action/Raid4.cs index d39f221364..beb72d1b19 100644 --- a/Lib9c/Action/Raid4.cs +++ b/Lib9c/Action/Raid4.cs @@ -48,11 +48,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressHex}Raid exec started", addressHex); diff --git a/Lib9c/Action/Raid5.cs b/Lib9c/Action/Raid5.cs index 53277bd859..04b6f16c6f 100644 --- a/Lib9c/Action/Raid5.cs +++ b/Lib9c/Action/Raid5.cs @@ -47,11 +47,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressHex}Raid exec started", addressHex); diff --git a/Lib9c/Action/Raid6.cs b/Lib9c/Action/Raid6.cs index 9085c3fe0d..a98e1af7ab 100644 --- a/Lib9c/Action/Raid6.cs +++ b/Lib9c/Action/Raid6.cs @@ -48,11 +48,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IAccount states = context.PreviousState; var random = context.GetRandom(); - if (context.Rehearsal) - { - return states; - } - var addressHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressHex}Raid exec started", addressHex); diff --git a/Lib9c/Action/RankingBattle.cs b/Lib9c/Action/RankingBattle.cs index d443c944db..c8d73f7fcb 100644 --- a/Lib9c/Action/RankingBattle.cs +++ b/Lib9c/Action/RankingBattle.cs @@ -52,15 +52,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(weeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress, enemyAddress); diff --git a/Lib9c/Action/RankingBattle0.cs b/Lib9c/Action/RankingBattle0.cs index c84b9ea7b2..2775bc6f9f 100644 --- a/Lib9c/Action/RankingBattle0.cs +++ b/Lib9c/Action/RankingBattle0.cs @@ -44,14 +44,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states.SetState(ctx.Signer, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(WeeklyArenaAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, WeeklyArenaAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RankingBattle10.cs b/Lib9c/Action/RankingBattle10.cs index 3322a0f565..f8fcd863d7 100644 --- a/Lib9c/Action/RankingBattle10.cs +++ b/Lib9c/Action/RankingBattle10.cs @@ -50,15 +50,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(weeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100190ObsoleteIndex, ctx); diff --git a/Lib9c/Action/RankingBattle11.cs b/Lib9c/Action/RankingBattle11.cs index 693cd025c2..0f9c0b8989 100644 --- a/Lib9c/Action/RankingBattle11.cs +++ b/Lib9c/Action/RankingBattle11.cs @@ -58,15 +58,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(weeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); // Avoid InvalidBlockStateRootHashException diff --git a/Lib9c/Action/RankingBattle2.cs b/Lib9c/Action/RankingBattle2.cs index 81e1d2d3a8..06bca02454 100644 --- a/Lib9c/Action/RankingBattle2.cs +++ b/Lib9c/Action/RankingBattle2.cs @@ -45,14 +45,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states.SetState(ctx.Signer, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(WeeklyArenaAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, WeeklyArenaAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RankingBattle3.cs b/Lib9c/Action/RankingBattle3.cs index 2089d594cd..d70f189e8c 100644 --- a/Lib9c/Action/RankingBattle3.cs +++ b/Lib9c/Action/RankingBattle3.cs @@ -45,14 +45,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states.SetState(ctx.Signer, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(WeeklyArenaAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, WeeklyArenaAddress); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RankingBattle4.cs b/Lib9c/Action/RankingBattle4.cs index 33662ffcd8..39525b5566 100644 --- a/Lib9c/Action/RankingBattle4.cs +++ b/Lib9c/Action/RankingBattle4.cs @@ -45,14 +45,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - return states.SetState(ctx.Signer, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(WeeklyArenaAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged) - .MarkBalanceChanged(ctx, GoldCurrencyMock, ctx.Signer, WeeklyArenaAddress); - } // Avoid InvalidBlockStateRootHashException if (ctx.BlockIndex == 680341 && Id.Equals(new Guid("df37dbd8-5703-4dff-918b-ad22ee4c34c6"))) diff --git a/Lib9c/Action/RankingBattle5.cs b/Lib9c/Action/RankingBattle5.cs index c8d2f3d5f8..9288cd2a29 100644 --- a/Lib9c/Action/RankingBattle5.cs +++ b/Lib9c/Action/RankingBattle5.cs @@ -49,15 +49,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(WeeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RankingBattle6.cs b/Lib9c/Action/RankingBattle6.cs index 9f6d911485..e77fa29109 100644 --- a/Lib9c/Action/RankingBattle6.cs +++ b/Lib9c/Action/RankingBattle6.cs @@ -48,15 +48,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(weeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, ctx); diff --git a/Lib9c/Action/RankingBattle7.cs b/Lib9c/Action/RankingBattle7.cs index 4714ba87c5..1cf7a51d75 100644 --- a/Lib9c/Action/RankingBattle7.cs +++ b/Lib9c/Action/RankingBattle7.cs @@ -48,15 +48,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(weeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100086ObsoleteIndex, context); diff --git a/Lib9c/Action/RankingBattle8.cs b/Lib9c/Action/RankingBattle8.cs index 12d6385148..b29e5df390 100644 --- a/Lib9c/Action/RankingBattle8.cs +++ b/Lib9c/Action/RankingBattle8.cs @@ -51,15 +51,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(weeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100089ObsoleteIndex, context); diff --git a/Lib9c/Action/RankingBattle9.cs b/Lib9c/Action/RankingBattle9.cs index ed91901c47..91c840b2ac 100644 --- a/Lib9c/Action/RankingBattle9.cs +++ b/Lib9c/Action/RankingBattle9.cs @@ -51,15 +51,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(weeklyArenaAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100093ObsoleteIndex, context); diff --git a/Lib9c/Action/RapidCombination.cs b/Lib9c/Action/RapidCombination.cs index e24a3a3a31..35006d2cba 100644 --- a/Lib9c/Action/RapidCombination.cs +++ b/Lib9c/Action/RapidCombination.cs @@ -46,16 +46,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}RapidCombination exec started", addressesHex); diff --git a/Lib9c/Action/RapidCombination0.cs b/Lib9c/Action/RapidCombination0.cs index 69963e53b1..59f3ee5e07 100644 --- a/Lib9c/Action/RapidCombination0.cs +++ b/Lib9c/Action/RapidCombination0.cs @@ -61,12 +61,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RapidCombination2.cs b/Lib9c/Action/RapidCombination2.cs index 88a618347e..4c9b8f57a6 100644 --- a/Lib9c/Action/RapidCombination2.cs +++ b/Lib9c/Action/RapidCombination2.cs @@ -36,12 +36,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RapidCombination3.cs b/Lib9c/Action/RapidCombination3.cs index 1240e5b05a..f851ab8036 100644 --- a/Lib9c/Action/RapidCombination3.cs +++ b/Lib9c/Action/RapidCombination3.cs @@ -36,12 +36,6 @@ public override IAccount Execute(IActionContext context) slotIndex ) ); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RapidCombination4.cs b/Lib9c/Action/RapidCombination4.cs index db5dacf778..f968fe7c6f 100644 --- a/Lib9c/Action/RapidCombination4.cs +++ b/Lib9c/Action/RapidCombination4.cs @@ -40,15 +40,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RapidCombination5.cs b/Lib9c/Action/RapidCombination5.cs index 151c244022..02122248cd 100644 --- a/Lib9c/Action/RapidCombination5.cs +++ b/Lib9c/Action/RapidCombination5.cs @@ -67,15 +67,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100083ObsoleteIndex, context); diff --git a/Lib9c/Action/RapidCombination6.cs b/Lib9c/Action/RapidCombination6.cs index 3ef020308c..b2edda19ca 100644 --- a/Lib9c/Action/RapidCombination6.cs +++ b/Lib9c/Action/RapidCombination6.cs @@ -46,15 +46,7 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } + CheckObsolete(ActionObsoleteConfig.V100310ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/RapidCombination7.cs b/Lib9c/Action/RapidCombination7.cs index 664be118ce..0d1e4bcc09 100644 --- a/Lib9c/Action/RapidCombination7.cs +++ b/Lib9c/Action/RapidCombination7.cs @@ -44,15 +44,7 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } + CheckObsolete(ActionObsoleteConfig.V100310ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/RapidCombination8.cs b/Lib9c/Action/RapidCombination8.cs index b8fb61d388..f8a5b90441 100644 --- a/Lib9c/Action/RapidCombination8.cs +++ b/Lib9c/Action/RapidCombination8.cs @@ -45,15 +45,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); diff --git a/Lib9c/Action/RapidCombination9.cs b/Lib9c/Action/RapidCombination9.cs index 478a81dbd3..07950d0f94 100644 --- a/Lib9c/Action/RapidCombination9.cs +++ b/Lib9c/Action/RapidCombination9.cs @@ -47,15 +47,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(slotAddress, MarkChanged); - } var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/RegisterProduct.cs b/Lib9c/Action/RegisterProduct.cs index 6dd795c756..b07b51ee66 100644 --- a/Lib9c/Action/RegisterProduct.cs +++ b/Lib9c/Action/RegisterProduct.cs @@ -33,10 +33,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } sw.Start(); if (!RegisterInfos.Any()) diff --git a/Lib9c/Action/RegisterProduct0.cs b/Lib9c/Action/RegisterProduct0.cs index 5734a367db..72c3e028c8 100644 --- a/Lib9c/Action/RegisterProduct0.cs +++ b/Lib9c/Action/RegisterProduct0.cs @@ -30,10 +30,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (!RegisterInfos.Any()) { diff --git a/Lib9c/Action/RegisterProduct2.cs b/Lib9c/Action/RegisterProduct2.cs index 4e54a44bc2..d349536579 100644 --- a/Lib9c/Action/RegisterProduct2.cs +++ b/Lib9c/Action/RegisterProduct2.cs @@ -31,10 +31,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); var states = context.PreviousState; var random = context.GetRandom(); - if (context.Rehearsal) - { - return states; - } if (!RegisterInfos.Any()) { diff --git a/Lib9c/Action/SellCancellation.cs b/Lib9c/Action/SellCancellation.cs index b8f85edc11..39681828b9 100644 --- a/Lib9c/Action/SellCancellation.cs +++ b/Lib9c/Action/SellCancellation.cs @@ -98,18 +98,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); var digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); var itemAddress = Addresses.GetItemAddress(tradableId); - if (context.Rehearsal) - { - states = states.SetState(shardedShopAddress, MarkChanged); - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(digestListAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, sellerAvatarAddress); if (!states.TryGetAvatarStateV2(context.Signer, sellerAvatarAddress, out var avatarState, out _)) diff --git a/Lib9c/Action/SellCancellation6.cs b/Lib9c/Action/SellCancellation6.cs index c275c47dff..c9593a1399 100644 --- a/Lib9c/Action/SellCancellation6.cs +++ b/Lib9c/Action/SellCancellation6.cs @@ -52,13 +52,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); var states = context.PreviousState; var shardedShopAddress = ShardedShopState.DeriveAddress(itemSubType, productId); - if (context.Rehearsal) - { - states = states.SetState(shardedShopAddress, MarkChanged); - return states - .SetState(Addresses.Shop, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/SellCancellation7.cs b/Lib9c/Action/SellCancellation7.cs index 748591269a..7132bf3aa2 100644 --- a/Lib9c/Action/SellCancellation7.cs +++ b/Lib9c/Action/SellCancellation7.cs @@ -92,17 +92,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); var orderDigestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); var itemAddress = Addresses.GetItemAddress(tradableId); - if (context.Rehearsal) - { - states = states.SetState(shardedShopAddress, MarkChanged); - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(orderDigestListAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/SellCancellation8.cs b/Lib9c/Action/SellCancellation8.cs index e9205ca963..3aeed53427 100644 --- a/Lib9c/Action/SellCancellation8.cs +++ b/Lib9c/Action/SellCancellation8.cs @@ -92,17 +92,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); var digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); var itemAddress = Addresses.GetItemAddress(tradableId); - if (context.Rehearsal) - { - states = states.SetState(shardedShopAddress, MarkChanged); - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(digestListAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/Stake.cs b/Lib9c/Action/Stake.cs index 03598da395..731a96ac60 100644 --- a/Lib9c/Action/Stake.cs +++ b/Lib9c/Action/Stake.cs @@ -60,16 +60,6 @@ public override IAccount Execute(IActionContext context) throw new MonsterCollectionExistingException(); } - if (context.Rehearsal) - { - return states.SetState(StakeState.DeriveAddress(context.Signer), MarkChanged) - .MarkBalanceChanged( - context, - GoldCurrencyMock, - context.Signer, - StakeState.DeriveAddress(context.Signer)); - } - // NOTE: When the amount is less than 0. if (Amount < 0) { diff --git a/Lib9c/Action/Stake0.cs b/Lib9c/Action/Stake0.cs index 9ef4eac687..145a5b49ba 100644 --- a/Lib9c/Action/Stake0.cs +++ b/Lib9c/Action/Stake0.cs @@ -57,16 +57,6 @@ public override IAccount Execute(IActionContext context) throw new MonsterCollectionExistingException(); } - if (context.Rehearsal) - { - return states.SetState(StakeState.DeriveAddress(context.Signer), MarkChanged) - .MarkBalanceChanged( - context, - GoldCurrencyMock, - context.Signer, - StakeState.DeriveAddress(context.Signer)); - } - CheckObsolete(ObsoleteIndex, context); if (Amount < 0) diff --git a/Lib9c/Action/Stake2.cs b/Lib9c/Action/Stake2.cs index 60764a53a0..8165a4a7a8 100644 --- a/Lib9c/Action/Stake2.cs +++ b/Lib9c/Action/Stake2.cs @@ -57,16 +57,6 @@ public override IAccount Execute(IActionContext context) throw new MonsterCollectionExistingException(); } - if (context.Rehearsal) - { - return states.SetState(StakeState.DeriveAddress(context.Signer), MarkChanged) - .MarkBalanceChanged( - context, - GoldCurrencyMock, - context.Signer, - StakeState.DeriveAddress(context.Signer)); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, context.Signer); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}Stake exec started", addressesHex); diff --git a/Lib9c/Action/UpdateSell.cs b/Lib9c/Action/UpdateSell.cs index 3acb49c6fc..c0d7852701 100644 --- a/Lib9c/Action/UpdateSell.cs +++ b/Lib9c/Action/UpdateSell.cs @@ -59,10 +59,6 @@ public override IAccount Execute(IActionContext context) var worldInformationAddress = sellerAvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); var digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); if (!(states.GetState(Addresses.Market) is null)) diff --git a/Lib9c/Action/UpdateSell0.cs b/Lib9c/Action/UpdateSell0.cs index 4b53ccff82..74ecaa4fa6 100644 --- a/Lib9c/Action/UpdateSell0.cs +++ b/Lib9c/Action/UpdateSell0.cs @@ -77,20 +77,6 @@ public override IAccount Execute(IActionContext context) var updateSellOrderAddress = Order.DeriveAddress(updateSellOrderId); var itemAddress = Addresses.GetItemAddress(tradableId); var orderReceiptAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(updateSellShopAddress, MarkChanged) - .SetState(updateSellOrderAddress, MarkChanged) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/UpdateSell2.cs b/Lib9c/Action/UpdateSell2.cs index 7bae25a70b..49e45acde4 100644 --- a/Lib9c/Action/UpdateSell2.cs +++ b/Lib9c/Action/UpdateSell2.cs @@ -81,20 +81,6 @@ public override IAccount Execute(IActionContext context) var updateSellOrderAddress = Order.DeriveAddress(updateSellOrderId); var itemAddress = Addresses.GetItemAddress(tradableId); var digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states - .SetState(context.Signer, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(digestListAddress, MarkChanged) - .SetState(shopAddress, MarkChanged) - .SetState(updateSellShopAddress, MarkChanged) - .SetState(updateSellOrderAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(sellerAvatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100270ObsoleteIndex, context); diff --git a/Lib9c/Action/UpdateSell3.cs b/Lib9c/Action/UpdateSell3.cs index 31d4fcacb1..036caa0c55 100644 --- a/Lib9c/Action/UpdateSell3.cs +++ b/Lib9c/Action/UpdateSell3.cs @@ -60,10 +60,6 @@ public override IAccount Execute(IActionContext context) var worldInformationAddress = sellerAvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); var digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100320ObsoleteIndex, context); diff --git a/Lib9c/Action/UpdateSell4.cs b/Lib9c/Action/UpdateSell4.cs index 2b615c8569..1b6ccb1014 100644 --- a/Lib9c/Action/UpdateSell4.cs +++ b/Lib9c/Action/UpdateSell4.cs @@ -61,10 +61,6 @@ public override IAccount Execute(IActionContext context) var worldInformationAddress = sellerAvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = sellerAvatarAddress.Derive(LegacyQuestListKey); var digestListAddress = OrderDigestListState.DeriveAddress(sellerAvatarAddress); - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100351ObsoleteIndex, context); From d589ee56bfd92ab8139e5928b9b9750b8be6761d Mon Sep 17 00:00:00 2001 From: area363 Date: Fri, 10 Nov 2023 19:15:33 +0900 Subject: [PATCH 08/19] Revert "fix RewardGoldTest" This reverts commit fefa24749fe4815233da217b4f563c8d2f2befb9. --- .Lib9c.Tests/Action/RewardGoldTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Lib9c.Tests/Action/RewardGoldTest.cs b/.Lib9c.Tests/Action/RewardGoldTest.cs index 9e1dc27504..dd515ca590 100644 --- a/.Lib9c.Tests/Action/RewardGoldTest.cs +++ b/.Lib9c.Tests/Action/RewardGoldTest.cs @@ -482,7 +482,7 @@ void AssertMinerReward(int blockIndex, string expected) public async Task Genesis_StateRootHash(bool mainnet) { BlockPolicySource blockPolicySource = new BlockPolicySource(); - IStagePolicy stagePolicy = new VolatileStagePolicy(); + NCStagePolicy stagePolicy = new NCStagePolicy(default, 2); IBlockPolicy policy = blockPolicySource.GetPolicy(); Block genesis; if (mainnet) From 91265c269688ef7c9dcc82a9c9e3acc22a6b688b Mon Sep 17 00:00:00 2001 From: area363 Date: Fri, 10 Nov 2023 19:15:44 +0900 Subject: [PATCH 09/19] Revert "remove unused test" This reverts commit e5b1772eefa05947348b98a8eadfef5491e2bbb4. --- .Lib9c.Tests/StagePolicyTest.cs | 257 ++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 .Lib9c.Tests/StagePolicyTest.cs diff --git a/.Lib9c.Tests/StagePolicyTest.cs b/.Lib9c.Tests/StagePolicyTest.cs new file mode 100644 index 0000000000..506b134d7a --- /dev/null +++ b/.Lib9c.Tests/StagePolicyTest.cs @@ -0,0 +1,257 @@ +namespace Lib9c.Tests +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Lib9c.Renderers; + using Lib9c.Tests.TestHelper; + using Libplanet.Action; + using Libplanet.Blockchain; + using Libplanet.Blockchain.Policies; + using Libplanet.Crypto; + using Libplanet.Types.Tx; + using Nekoyume.Action; + using Nekoyume.Blockchain; + using Nekoyume.Blockchain.Policy; + using Serilog.Core; + using Xunit; + + public class StagePolicyTest + { + private readonly PrivateKey[] _accounts; + + private readonly Dictionary _txs; + + public StagePolicyTest() + { + _accounts = new[] + { + new PrivateKey(), + new PrivateKey(), + new PrivateKey(), + new PrivateKey(), + }; + _txs = _accounts.ToDictionary( + acc => acc.ToAddress(), + acc => Enumerable + .Range(0, 10) + .Select( + n => Transaction.Create( + n, + acc, + default, + new ActionBase[0].ToPlainValues() + ) + ) + .ToArray() + ); + } + + [Fact] + public void Stage() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][0]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][1]); + stagePolicy.Stage(chain, _txs[_accounts[1].ToAddress()][0]); + stagePolicy.Stage(chain, _txs[_accounts[2].ToAddress()][0]); + + AssertTxs( + chain, + stagePolicy, + _txs[_accounts[0].ToAddress()][0], + _txs[_accounts[0].ToAddress()][1], + _txs[_accounts[1].ToAddress()][0], + _txs[_accounts[2].ToAddress()][0] + ); + } + + [Fact] + public void StageOverQuota() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][0]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][1]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][2]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][3]); + + AssertTxs( + chain, + stagePolicy, + _txs[_accounts[0].ToAddress()][0], + _txs[_accounts[0].ToAddress()][1] + ); + } + + [Fact] + public void StageOverQuotaInverseOrder() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][3]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][2]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][1]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][0]); + + AssertTxs( + chain, + stagePolicy, + _txs[_accounts[0].ToAddress()][0], + _txs[_accounts[0].ToAddress()][1] + ); + } + + [Fact] + public void StageOverQuotaOutOfOrder() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][2]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][1]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][3]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][0]); + + AssertTxs( + chain, + stagePolicy, + _txs[_accounts[0].ToAddress()][0], + _txs[_accounts[0].ToAddress()][1] + ); + } + + [Fact] + public void StageSameNonce() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + var txA = Transaction.Create(0, _accounts[0], default, new ActionBase[0].ToPlainValues()); + var txB = Transaction.Create(0, _accounts[0], default, new ActionBase[0].ToPlainValues()); + var txC = Transaction.Create(0, _accounts[0], default, new ActionBase[0].ToPlainValues()); + + stagePolicy.Stage(chain, txA); + stagePolicy.Stage(chain, txB); + stagePolicy.Stage(chain, txC); + + AssertTxs(chain, stagePolicy, txA, txB); + } + + [Fact] + public async Task StateFromMultiThread() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + + await Task.WhenAll( + Enumerable + .Range(0, 40) + .Select(i => Task.Run(() => + { + stagePolicy.Stage(chain, _txs[_accounts[i / 10].ToAddress()][i % 10]); + })) + ); + AssertTxs( + chain, + stagePolicy, + _txs[_accounts[0].ToAddress()][0], + _txs[_accounts[0].ToAddress()][1], + _txs[_accounts[1].ToAddress()][0], + _txs[_accounts[1].ToAddress()][1], + _txs[_accounts[2].ToAddress()][0], + _txs[_accounts[2].ToAddress()][1], + _txs[_accounts[3].ToAddress()][0], + _txs[_accounts[3].ToAddress()][1] + ); + } + + [Fact] + public void IterateAfterUnstage() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][0]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][1]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][2]); + stagePolicy.Stage(chain, _txs[_accounts[0].ToAddress()][3]); + + AssertTxs( + chain, + stagePolicy, + _txs[_accounts[0].ToAddress()][0], + _txs[_accounts[0].ToAddress()][1] + ); + + stagePolicy.Unstage(chain, _txs[_accounts[0].ToAddress()][0].Id); + + AssertTxs( + chain, + stagePolicy, + _txs[_accounts[0].ToAddress()][1], + _txs[_accounts[0].ToAddress()][2] + ); + } + + [Fact] + public void CalculateNextTxNonceCorrectWhenTxOverQuota() + { + NCStagePolicy stagePolicy = new NCStagePolicy(TimeSpan.FromHours(1), 2); + BlockChain chain = MakeChainWithStagePolicy(stagePolicy); + + long nextTxNonce = chain.GetNextTxNonce(_accounts[0].ToAddress()); + Assert.Equal(0, nextTxNonce); + var txA = Transaction.Create(nextTxNonce, _accounts[0], default, new ActionBase[0].ToPlainValues()); + stagePolicy.Stage(chain, txA); + + nextTxNonce = chain.GetNextTxNonce(_accounts[0].ToAddress()); + Assert.Equal(1, nextTxNonce); + var txB = Transaction.Create(nextTxNonce, _accounts[0], default, new ActionBase[0].ToPlainValues()); + stagePolicy.Stage(chain, txB); + + nextTxNonce = chain.GetNextTxNonce(_accounts[0].ToAddress()); + Assert.Equal(2, nextTxNonce); + var txC = Transaction.Create(nextTxNonce, _accounts[0], default, new ActionBase[0].ToPlainValues()); + stagePolicy.Stage(chain, txC); + + nextTxNonce = chain.GetNextTxNonce(_accounts[0].ToAddress()); + Assert.Equal(3, nextTxNonce); + + AssertTxs( + chain, + stagePolicy, + txA, + txB); + } + + private void AssertTxs(BlockChain blockChain, NCStagePolicy policy, params Transaction[] txs) + { + foreach (Transaction tx in txs) + { + Assert.Equal(tx, policy.Get(blockChain, tx.Id, filtered: true)); + } + + Assert.Equal( + txs.ToHashSet(), + policy.Iterate(blockChain, filtered: true).ToHashSet() + ); + } + + private BlockChain MakeChainWithStagePolicy(NCStagePolicy stagePolicy) + { + BlockPolicySource blockPolicySource = new BlockPolicySource(); + IBlockPolicy policy = blockPolicySource.GetPolicy(); + BlockChain chain = + BlockChainHelper.MakeBlockChain( + blockRenderers: new[] { new BlockRenderer() }, + policy: policy, + stagePolicy: stagePolicy); + return chain; + } + } +} From 76ceee1d2f725a4d909067cc9380328060a0c850 Mon Sep 17 00:00:00 2001 From: area363 Date: Fri, 10 Nov 2023 19:15:53 +0900 Subject: [PATCH 10/19] Revert "move NCStagePolicy and IAccessControlService to headless" This reverts commit 92bb173f9c4852dfc841734a14fdeb43f872cb7c. --- .../IAccessControlService.cs | 9 ++ Lib9c.Policy/NCStagePolicy.cs | 140 ++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 Lib9c.Policy/AccessControlService/IAccessControlService.cs create mode 100644 Lib9c.Policy/NCStagePolicy.cs diff --git a/Lib9c.Policy/AccessControlService/IAccessControlService.cs b/Lib9c.Policy/AccessControlService/IAccessControlService.cs new file mode 100644 index 0000000000..42e7dc1208 --- /dev/null +++ b/Lib9c.Policy/AccessControlService/IAccessControlService.cs @@ -0,0 +1,9 @@ +using Libplanet.Crypto; + +namespace Nekoyume.Blockchain +{ + public interface IAccessControlService + { + public int? GetTxQuota(Address address); + } +} diff --git a/Lib9c.Policy/NCStagePolicy.cs b/Lib9c.Policy/NCStagePolicy.cs new file mode 100644 index 0000000000..0dbd00c1f5 --- /dev/null +++ b/Lib9c.Policy/NCStagePolicy.cs @@ -0,0 +1,140 @@ +namespace Nekoyume.Blockchain +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Collections.Immutable; + using System.Linq; + using Libplanet.Blockchain; + using Libplanet.Blockchain.Policies; + using Libplanet.Crypto; + using Libplanet.Types.Tx; + + public class NCStagePolicy : IStagePolicy + { + private readonly VolatileStagePolicy _impl; + private readonly ConcurrentDictionary> _txs; + private readonly int _quotaPerSigner; + private IAccessControlService? _accessControlService; + + public NCStagePolicy(TimeSpan txLifeTime, int quotaPerSigner, IAccessControlService? accessControlService = null) + { + if (quotaPerSigner < 1) + { + throw new ArgumentOutOfRangeException( + $"{nameof(quotaPerSigner)} must be positive: ${quotaPerSigner}"); + } + + _txs = new ConcurrentDictionary>(); + _quotaPerSigner = quotaPerSigner; + _impl = (txLifeTime == default) + ? new VolatileStagePolicy() + : new VolatileStagePolicy(txLifeTime); + + _accessControlService = accessControlService; + } + + public Transaction Get(BlockChain blockChain, TxId id, bool filtered = true) + => _impl.Get(blockChain, id, filtered); + + public long GetNextTxNonce(BlockChain blockChain, Address address) + => _impl.GetNextTxNonce(blockChain, address); + + public void Ignore(BlockChain blockChain, TxId id) + => _impl.Ignore(blockChain, id); + + public bool Ignores(BlockChain blockChain, TxId id) + => _impl.Ignores(blockChain, id); + + public IEnumerable Iterate(BlockChain blockChain, bool filtered = true) + { + if (filtered) + { + var txsPerSigner = new Dictionary>(); + foreach (Transaction tx in _impl.Iterate(blockChain, filtered)) + { + if (!txsPerSigner.TryGetValue(tx.Signer, out var s)) + { + txsPerSigner[tx.Signer] = s = new SortedSet(new TxComparer()); + } + + s.Add(tx); + int txQuotaPerSigner = _quotaPerSigner; + + // update txQuotaPerSigner if ACS returns a value for the signer. + if (_accessControlService?.GetTxQuota(tx.Signer) is { } acsTxQuota) + { + txQuotaPerSigner = acsTxQuota; + } + + + if (s.Count > txQuotaPerSigner) + { + s.Remove(s.Max); + } + } + +#pragma warning disable LAA1002 // DictionariesOrSetsShouldBeOrderedToEnumerate + return txsPerSigner.Values.SelectMany(i => i); +#pragma warning restore LAA1002 // DictionariesOrSetsShouldBeOrderedToEnumerate + } + else + { + return _impl.Iterate(blockChain, filtered); + } + } + + public bool Stage(BlockChain blockChain, Transaction transaction) + { + if (_accessControlService?.GetTxQuota(transaction.Signer) is { } acsTxQuota + && acsTxQuota == 0) + { + return false; + } + + var deniedTxs = new[] + { + // CreatePledge Transaction with 50000 addresses + TxId.FromHex("300826da62b595d8cd663dadf04995a7411534d1cdc17dac75ce88754472f774"), + // CreatePledge Transaction with 5000 addresses + TxId.FromHex("210d1374d8f068de657de6b991e63888da9cadbc68e505ac917b35568b5340f8"), + }; + if (deniedTxs.Contains(transaction.Id)) + { + return false; + } + + return _impl.Stage(blockChain, transaction); + } + + public bool Unstage(BlockChain blockChain, TxId id) + => _impl.Unstage(blockChain, id); + + private class TxComparer : IComparer + { + public int Compare(Transaction x, Transaction y) + { + if (x.Nonce < y.Nonce) + { + return -1; + } + else if (x.Nonce > y.Nonce) + { + return 1; + } + else if (x.Timestamp < y.Timestamp) + { + return -1; + } + else if (x.Timestamp > y.Timestamp) + { + return 1; + } + else + { + return 0; + } + } + } + } +} From 1f4c33a75420569e23f943c4c2343b18bf867e26 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Mon, 13 Nov 2023 13:55:30 +0900 Subject: [PATCH 11/19] Remove leftover rehearsal related code --- .Lib9c.Tests/Action/AddRedeemCodeTest.cs | 21 ---------- .Lib9c.Tests/Action/ChargeActionPointTest.cs | 29 ------------- .../Action/Coupons/IssueCouponsTest.cs | 18 -------- .../Action/Coupons/RedeemCouponTest.cs | 38 ----------------- .../Action/Coupons/TransferCouponsTest.cs | 41 ------------------- .../Action/CreatePendingActivationTest.cs | 24 ----------- .Lib9c.Tests/Action/RedeemCode0Test.cs | 23 ----------- .Lib9c.Tests/Action/RedeemCodeTest.cs | 32 --------------- .../Action/Craft/UnlockCraftAction.cs | 5 --- .../Action/Craft/UnlockRecipe.cs | 5 --- .../Action/CreateArenaDummy.cs | 4 -- .../Action/CreateOrReplaceAvatar.cs | 5 --- Lib9c.DevExtensions/Action/CreateTestbed.cs | 37 ----------------- Lib9c.DevExtensions/Action/FaucetCurrency.cs | 5 --- Lib9c.DevExtensions/Action/FaucetRune.cs | 5 --- Lib9c.DevExtensions/Action/ManipulateState.cs | 5 --- .../Action/Stage/ClearStage.cs | 5 --- Lib9c/Action/AddRedeemCode.cs | 5 --- Lib9c/Action/AuraSummon.cs | 5 --- Lib9c/Action/BattleGrandFinale.cs | 5 --- Lib9c/Action/BattleGrandFinale1.cs | 4 -- Lib9c/Action/BattleGrandFinale2.cs | 5 --- Lib9c/Action/BuyMultiple.cs | 23 ----------- Lib9c/Action/CancelMonsterCollect.cs | 6 --- Lib9c/Action/CancelProductRegistration.cs | 4 -- Lib9c/Action/CancelProductRegistration0.cs | 4 -- Lib9c/Action/ChargeActionPoint.cs | 10 ----- Lib9c/Action/ChargeActionPoint0.cs | 4 -- Lib9c/Action/ChargeActionPoint2.cs | 4 -- Lib9c/Action/ClaimRaidReward.cs | 4 -- Lib9c/Action/ClaimWordBossKillReward.cs | 4 -- Lib9c/Action/Coupons/IssueCoupons.cs | 7 ---- Lib9c/Action/Coupons/RedeemCoupon.cs | 12 ------ Lib9c/Action/CreatePendingActivation.cs | 4 -- .../Action/Garages/DeliverToOthersGarages.cs | 5 --- Lib9c/Action/Garages/LoadIntoMyGarages.cs | 5 --- Lib9c/Action/Garages/UnloadFromMyGarages.cs | 5 --- Lib9c/Action/Grinding.cs | 17 -------- Lib9c/Action/Grinding0.cs | 17 -------- Lib9c/Action/InitializeStates.cs | 31 -------------- .../Action/MigrationActivatedAccountsState.cs | 4 -- Lib9c/Action/MigrationAvatarState.cs | 4 -- Lib9c/Action/MigrationLegacyShop.cs | 13 ------ Lib9c/Action/MigrationLegacyShop0.cs | 8 ---- Lib9c/Action/PatchTableSheet.cs | 7 ---- Lib9c/Action/PetEnhancement.cs | 5 --- Lib9c/Action/PrepareRewardAssets.cs | 7 ---- Lib9c/Action/ReRegisterProduct.cs | 4 -- Lib9c/Action/ReRegisterProduct0.cs | 4 -- Lib9c/Action/RedeemCode.cs | 13 ------ Lib9c/Action/RedeemCode0.cs | 9 ---- Lib9c/Action/RedeemCode2.cs | 12 ------ Lib9c/Action/RenewAdminState.cs | 5 --- Lib9c/Action/RuneEnhancement.cs | 4 -- Lib9c/Action/RuneEnhancement0.cs | 4 -- Lib9c/Action/SecureMiningReward.cs | 8 ---- Lib9c/Action/UnlockEquipmentRecipe.cs | 11 ----- Lib9c/Action/UnlockEquipmentRecipe1.cs | 10 ----- Lib9c/Action/UnlockRuneSlot.cs | 5 --- Lib9c/Action/UnlockWorld.cs | 10 ----- Lib9c/Action/UnlockWorld1.cs | 9 ---- 61 files changed, 648 deletions(-) diff --git a/.Lib9c.Tests/Action/AddRedeemCodeTest.cs b/.Lib9c.Tests/Action/AddRedeemCodeTest.cs index 95dd080a1c..f527e8beec 100644 --- a/.Lib9c.Tests/Action/AddRedeemCodeTest.cs +++ b/.Lib9c.Tests/Action/AddRedeemCodeTest.cs @@ -105,26 +105,5 @@ public void ExecuteThrowSheetRowValidateException() }) ); } - - [Fact] - public void Rehearsal() - { - var action = new AddRedeemCode - { - redeemCsv = "test", - }; - - var nextState = action.Execute(new ActionContext - { - BlockIndex = 0, - PreviousState = new Account(MockState.Empty), - Rehearsal = true, - }); - - Assert.Equal( - nextState.Delta.UpdatedAddresses, - new[] { Addresses.RedeemCode }.ToImmutableHashSet() - ); - } } } diff --git a/.Lib9c.Tests/Action/ChargeActionPointTest.cs b/.Lib9c.Tests/Action/ChargeActionPointTest.cs index 37a8326ab0..c02d549f7f 100644 --- a/.Lib9c.Tests/Action/ChargeActionPointTest.cs +++ b/.Lib9c.Tests/Action/ChargeActionPointTest.cs @@ -168,34 +168,5 @@ public void Execute_Throw_Exception(bool useAvatarAddress, bool useTradable, boo }) ); } - - [Fact] - public void Rehearsal() - { - var action = new ChargeActionPoint - { - avatarAddress = _avatarAddress, - }; - - var updatedAddresses = new List
() - { - _avatarAddress, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }; - - var state = new Account(MockState.Empty); - - var nextState = action.Execute(new ActionContext() - { - PreviousState = state, - Signer = _agentAddress, - BlockIndex = 0, - Rehearsal = true, - }); - - Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.Delta.UpdatedAddresses); - } } } diff --git a/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs b/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs index 6d24341603..4a2f2a5060 100644 --- a/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs +++ b/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs @@ -69,24 +69,6 @@ public void Execute() }) .GetCouponWallet(CouponsFixture.AgentAddress1)); - Assert.Equal( - Bencodex.Types.Null.Value, - new IssueCoupons( - ImmutableDictionary.Empty - .Add(CouponsFixture.RewardSet1, 1) - .Add(CouponsFixture.RewardSet2, 2), - CouponsFixture.AgentAddress1) - .Execute( - new ActionContext - { - PreviousState = state, - Rehearsal = true, - RandomSeed = random.Seed, - BlockIndex = 0, - Signer = CouponsFixture.AgentAddress1, - }) - .GetState(CouponsFixture.AgentAddress1.Derive(SerializeKeys.CouponWalletKey))); - state = new IssueCoupons( ImmutableDictionary.Empty .Add(CouponsFixture.RewardSet1, 1) diff --git a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs index 5133261171..1c1d0d6336 100644 --- a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs +++ b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs @@ -137,44 +137,6 @@ public void Execute() CouponsFixture.Guid3, new Coupon(CouponsFixture.Guid3, CouponsFixture.RewardSet3)); - state = state - .SetCouponWallet(CouponsFixture.AgentAddress1, agent1CouponWallet) - .SetCouponWallet(CouponsFixture.AgentAddress2, agent2CouponWallet); - - var rehearsedState = new RedeemCoupon(CouponsFixture.Guid1, agent1Avatar0Address) - .Execute( - new ActionContext - { - PreviousState = state, - Rehearsal = true, - Signer = CouponsFixture.AgentAddress1, - RandomSeed = random.Seed, - }); - - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState(agent1Avatar0Address)); - - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState( - agent1Avatar0Address.Derive(SerializeKeys.LegacyInventoryKey))); - - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState( - agent1Avatar0Address.Derive(SerializeKeys.LegacyWorldInformationKey))); - - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState( - agent1Avatar0Address.Derive(SerializeKeys.LegacyQuestListKey))); - - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState( - CouponsFixture.AgentAddress1.Derive(SerializeKeys.CouponWalletKey))); - // can't redeem other person's coupon var expected = state.GetAvatarStateV2(agent1Avatar0Address); state = new RedeemCoupon(CouponsFixture.Guid3, agent1Avatar0Address) diff --git a/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs b/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs index fab6b8e805..c97dbe6b6b 100644 --- a/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs +++ b/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs @@ -135,47 +135,6 @@ public void Execute() Rehearsal = false, })); - state = state - .SetCouponWallet( - CouponsFixture.AgentAddress1, - ImmutableDictionary.Empty - .Add(CouponsFixture.Guid1, coupon1) - .Add(CouponsFixture.Guid2, coupon2) - .Add(CouponsFixture.Guid3, coupon3)) - .SetCouponWallet( - CouponsFixture.AgentAddress2, - ImmutableDictionary.Empty) - .SetCouponWallet( - CouponsFixture.AgentAddress3, - ImmutableDictionary.Empty); - - var rehearsedState = new TransferCoupons( - ImmutableDictionary>.Empty - .Add(CouponsFixture.AgentAddress2, ImmutableHashSet.Empty - .Add(CouponsFixture.Guid1) - .Add(CouponsFixture.Guid2)) - .Add(CouponsFixture.AgentAddress3, ImmutableHashSet.Empty - .Add(CouponsFixture.Guid3))) - .Execute( - new ActionContext - { - PreviousState = state, - Signer = CouponsFixture.AgentAddress1, - Rehearsal = true, - }); - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState( - CouponsFixture.AgentAddress1.Derive(SerializeKeys.CouponWalletKey))); - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState( - CouponsFixture.AgentAddress2.Derive(SerializeKeys.CouponWalletKey))); - Assert.Equal( - ActionBase.MarkChanged, - rehearsedState.GetState( - CouponsFixture.AgentAddress3.Derive(SerializeKeys.CouponWalletKey))); - // multiple transfer state = new TransferCoupons( ImmutableDictionary>.Empty diff --git a/.Lib9c.Tests/Action/CreatePendingActivationTest.cs b/.Lib9c.Tests/Action/CreatePendingActivationTest.cs index df64cc87dc..9ae2a4f868 100644 --- a/.Lib9c.Tests/Action/CreatePendingActivationTest.cs +++ b/.Lib9c.Tests/Action/CreatePendingActivationTest.cs @@ -71,29 +71,5 @@ public void CheckPermission() }) ); } - - [Fact] - public void Rehearsal() - { - var nonce = new byte[] { 0x00, 0x01, 0x02, 0x03 }; - var pubKey = new PublicKey( - ByteUtil.ParseHex("02ed49dbe0f2c34d9dff8335d6dd9097f7a3ef17dfb5f048382eebc7f451a50aa1") - ); - var pendingActivation = new PendingActivationState(nonce, pubKey); - var action = new CreatePendingActivation(pendingActivation); - IAccount nextState = action.Execute( - new ActionContext() - { - BlockIndex = 101, - Signer = default, - Rehearsal = true, - PreviousState = new Account(MockState.Empty), - } - ); - Assert.Equal( - ImmutableHashSet.Create(pendingActivation.address), - nextState.Delta.UpdatedAddresses - ); - } } } diff --git a/.Lib9c.Tests/Action/RedeemCode0Test.cs b/.Lib9c.Tests/Action/RedeemCode0Test.cs index 366fea6497..1e3cb7bb37 100644 --- a/.Lib9c.Tests/Action/RedeemCode0Test.cs +++ b/.Lib9c.Tests/Action/RedeemCode0Test.cs @@ -112,28 +112,5 @@ public void Execute() nextRedeemCodeState.Redeem(redeemCode.Code, redeemCode.AvatarAddress); }); } - - [Fact] - public void Rehearsal() - { - var redeemCode = new RedeemCode0( - string.Empty, - _avatarAddress - ); - - IAccount nextState = redeemCode.Execute(new ActionContext() - { - BlockIndex = 1, - Miner = default, - PreviousState = new Account(MockState.Empty), - Rehearsal = true, - Signer = _agentAddress, - }); - - Assert.Equal( - nextState.Delta.UpdatedAddresses, - new[] { _avatarAddress, _agentAddress, RedeemCodeState.Address, GoldCurrencyState.Address }.ToImmutableHashSet() - ); - } } } diff --git a/.Lib9c.Tests/Action/RedeemCodeTest.cs b/.Lib9c.Tests/Action/RedeemCodeTest.cs index f3efda7057..63a732fa1e 100644 --- a/.Lib9c.Tests/Action/RedeemCodeTest.cs +++ b/.Lib9c.Tests/Action/RedeemCodeTest.cs @@ -127,37 +127,5 @@ public void Execute(bool backward) nextRedeemCodeState.Redeem(redeemCode.Code, redeemCode.AvatarAddress); }); } - - [Fact] - public void Rehearsal() - { - var redeemCode = new RedeemCode( - string.Empty, - _avatarAddress - ); - - IAccount nextState = redeemCode.Execute(new ActionContext() - { - BlockIndex = 1, - Miner = default, - PreviousState = new Account(MockState.Empty), - Rehearsal = true, - Signer = _agentAddress, - }); - - Assert.Equal( - new[] - { - _avatarAddress, - _agentAddress, - RedeemCodeState.Address, - GoldCurrencyState.Address, - _avatarAddress.Derive(LegacyInventoryKey), - _avatarAddress.Derive(LegacyWorldInformationKey), - _avatarAddress.Derive(LegacyQuestListKey), - }.ToImmutableHashSet(), - nextState.Delta.UpdatedAddresses - ); - } } } diff --git a/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs b/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs index 8adf7f651a..9e37655d7a 100644 --- a/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs +++ b/Lib9c.DevExtensions/Action/Craft/UnlockCraftAction.cs @@ -26,11 +26,6 @@ public class UnlockCraftAction : GameAction public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; int targetStage; diff --git a/Lib9c.DevExtensions/Action/Craft/UnlockRecipe.cs b/Lib9c.DevExtensions/Action/Craft/UnlockRecipe.cs index e02549225d..b00bb21735 100644 --- a/Lib9c.DevExtensions/Action/Craft/UnlockRecipe.cs +++ b/Lib9c.DevExtensions/Action/Craft/UnlockRecipe.cs @@ -21,11 +21,6 @@ public class UnlockRecipe : GameAction public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var recipeIdList = List.Empty; for (var i = 1; i <= TargetStage; i++) diff --git a/Lib9c.DevExtensions/Action/CreateArenaDummy.cs b/Lib9c.DevExtensions/Action/CreateArenaDummy.cs index ea46bcccaf..ef74b1a783 100644 --- a/Lib9c.DevExtensions/Action/CreateArenaDummy.cs +++ b/Lib9c.DevExtensions/Action/CreateArenaDummy.cs @@ -57,10 +57,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } for (var i = 0; i < accountCount; i++) { diff --git a/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs b/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs index 40036f080a..0b6e8df3c9 100644 --- a/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs +++ b/Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs @@ -367,11 +367,6 @@ public CreateOrReplaceAvatar( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var random = context.GetRandom(); return Execute( context.PreviousState, diff --git a/Lib9c.DevExtensions/Action/CreateTestbed.cs b/Lib9c.DevExtensions/Action/CreateTestbed.cs index 36b9540021..da77b7f942 100644 --- a/Lib9c.DevExtensions/Action/CreateTestbed.cs +++ b/Lib9c.DevExtensions/Action/CreateTestbed.cs @@ -94,43 +94,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = avatarAddress.Derive(LegacyQuestListKey); var orderReceiptAddress = OrderDigestListState.DeriveAddress(avatarAddress); - if (context.Rehearsal) - { - states = states.SetState(agentAddress, MarkChanged); - for (var i = 0; i < AvatarState.CombinationSlotCapacity; i++) - { - var slotAddress = avatarAddress.Derive( - string.Format(CultureInfo.InvariantCulture, - CombinationSlotState.DeriveFormat, i)); - states = states.SetState(slotAddress, MarkChanged); - } - - states = states.SetState(avatarAddress, MarkChanged) - .SetState(Addresses.Ranking, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged); - - for (var i = 0; i < sellData.Items.Length; i++) - { - var itemAddress = Addresses.GetItemAddress(addedItemInfos[i].TradableId); - var orderAddress = Order.DeriveAddress(addedItemInfos[i].OrderId); - var shopAddress = ShardedShopStateV2.DeriveAddress( - sellData.Items[i].ItemSubType, - addedItemInfos[i].OrderId); - - states = states.SetState(avatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .MarkBalanceChanged( - context, GoldCurrencyMock, agentAddress, GoldCurrencyState.Address) - .SetState(orderReceiptAddress, MarkChanged) - .SetState(itemAddress, MarkChanged) - .SetState(orderAddress, MarkChanged) - .SetState(shopAddress, MarkChanged); - } - return states; - } - // Create Agent and avatar var existingAgentState = states.GetAgentState(agentAddress); var agentState = existingAgentState ?? new AgentState(agentAddress); diff --git a/Lib9c.DevExtensions/Action/FaucetCurrency.cs b/Lib9c.DevExtensions/Action/FaucetCurrency.cs index f3fe300fa5..06331a9983 100644 --- a/Lib9c.DevExtensions/Action/FaucetCurrency.cs +++ b/Lib9c.DevExtensions/Action/FaucetCurrency.cs @@ -23,11 +23,6 @@ public class FaucetCurrency : GameAction, IFaucetCurrency public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; if (FaucetNcg > 0) { diff --git a/Lib9c.DevExtensions/Action/FaucetRune.cs b/Lib9c.DevExtensions/Action/FaucetRune.cs index c913d0d38f..ad90cf1331 100644 --- a/Lib9c.DevExtensions/Action/FaucetRune.cs +++ b/Lib9c.DevExtensions/Action/FaucetRune.cs @@ -25,11 +25,6 @@ public class FaucetRune : GameAction, IFaucetRune public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; if (!(FaucetRuneInfos is null)) { diff --git a/Lib9c.DevExtensions/Action/ManipulateState.cs b/Lib9c.DevExtensions/Action/ManipulateState.cs index b746bf4ccf..5388497127 100644 --- a/Lib9c.DevExtensions/Action/ManipulateState.cs +++ b/Lib9c.DevExtensions/Action/ManipulateState.cs @@ -47,11 +47,6 @@ protected override void LoadPlainValueInternal( public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - return Execute(context, context.PreviousState, StateList, BalanceList); } diff --git a/Lib9c.DevExtensions/Action/Stage/ClearStage.cs b/Lib9c.DevExtensions/Action/Stage/ClearStage.cs index 62d68b2365..41b8f7dfc5 100644 --- a/Lib9c.DevExtensions/Action/Stage/ClearStage.cs +++ b/Lib9c.DevExtensions/Action/Stage/ClearStage.cs @@ -23,11 +23,6 @@ public class ClearStage : GameAction public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState; - } - var states = context.PreviousState; var worldInformation = new WorldInformation( context.BlockIndex, diff --git a/Lib9c/Action/AddRedeemCode.cs b/Lib9c/Action/AddRedeemCode.cs index 6c4a0ae816..1e81fcc3b7 100644 --- a/Lib9c/Action/AddRedeemCode.cs +++ b/Lib9c/Action/AddRedeemCode.cs @@ -21,11 +21,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states - .SetState(Addresses.RedeemCode, MarkChanged); - } CheckPermission(context); diff --git a/Lib9c/Action/AuraSummon.cs b/Lib9c/Action/AuraSummon.cs index f1e6fb614d..3146614dc4 100644 --- a/Lib9c/Action/AuraSummon.cs +++ b/Lib9c/Action/AuraSummon.cs @@ -181,11 +181,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug($"{addressesHex} AuraSummon Exec. Started."); diff --git a/Lib9c/Action/BattleGrandFinale.cs b/Lib9c/Action/BattleGrandFinale.cs index db1abd02d9..56e5ae31ee 100644 --- a/Lib9c/Action/BattleGrandFinale.cs +++ b/Lib9c/Action/BattleGrandFinale.cs @@ -81,11 +81,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex( context, myAvatarAddress, diff --git a/Lib9c/Action/BattleGrandFinale1.cs b/Lib9c/Action/BattleGrandFinale1.cs index fb300d663d..bc94a48bb1 100644 --- a/Lib9c/Action/BattleGrandFinale1.cs +++ b/Lib9c/Action/BattleGrandFinale1.cs @@ -80,10 +80,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex( diff --git a/Lib9c/Action/BattleGrandFinale2.cs b/Lib9c/Action/BattleGrandFinale2.cs index 524c890776..17214b3fb0 100644 --- a/Lib9c/Action/BattleGrandFinale2.cs +++ b/Lib9c/Action/BattleGrandFinale2.cs @@ -81,11 +81,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addressesHex = GetSignerAndOtherAddressesHex( context, myAvatarAddress, diff --git a/Lib9c/Action/BuyMultiple.cs b/Lib9c/Action/BuyMultiple.cs index cbcdcec2bb..a60001c882 100644 --- a/Lib9c/Action/BuyMultiple.cs +++ b/Lib9c/Action/BuyMultiple.cs @@ -222,29 +222,6 @@ public override IAccount Execute(IActionContext context) IActionContext ctx = context; var states = ctx.PreviousState; - if (ctx.Rehearsal) - { - states = states - .SetState(buyerAvatarAddress, MarkChanged) - .SetState(ctx.Signer, MarkChanged); - - foreach (var info in purchaseInfos) - { - var sellerAgentAddress = info.sellerAgentAddress; - var sellerAvatarAddress = info.sellerAvatarAddress; - - states = states.SetState(sellerAvatarAddress, MarkChanged) - .MarkBalanceChanged( - ctx, - GoldCurrencyMock, - ctx.Signer, - sellerAgentAddress, - GoldCurrencyState.Address); - } - - return states.SetState(ShopState.Address, MarkChanged); - } - CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); var availableInfos = purchaseInfos.Where(p => !(p is null)); diff --git a/Lib9c/Action/CancelMonsterCollect.cs b/Lib9c/Action/CancelMonsterCollect.cs index 8f22c04ad2..519582874f 100644 --- a/Lib9c/Action/CancelMonsterCollect.cs +++ b/Lib9c/Action/CancelMonsterCollect.cs @@ -37,12 +37,6 @@ public override IAccount Execute(IActionContext context) context.UseGas(1); IAccount states = context.PreviousState; Address collectionAddress = MonsterCollectionState0.DeriveAddress(context.Signer, collectRound); - if (context.Rehearsal) - { - return states - .SetState(collectionAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, collectionAddress, context.Signer); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/CancelProductRegistration.cs b/Lib9c/Action/CancelProductRegistration.cs index f16ce8d2bd..5462cc6ea2 100644 --- a/Lib9c/Action/CancelProductRegistration.cs +++ b/Lib9c/Action/CancelProductRegistration.cs @@ -29,10 +29,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (!ProductInfos.Any()) { diff --git a/Lib9c/Action/CancelProductRegistration0.cs b/Lib9c/Action/CancelProductRegistration0.cs index 62dc761cbb..e913e91e94 100644 --- a/Lib9c/Action/CancelProductRegistration0.cs +++ b/Lib9c/Action/CancelProductRegistration0.cs @@ -30,10 +30,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (!ProductInfos.Any()) { diff --git a/Lib9c/Action/ChargeActionPoint.cs b/Lib9c/Action/ChargeActionPoint.cs index fb9b92f5bb..49e8811d3b 100644 --- a/Lib9c/Action/ChargeActionPoint.cs +++ b/Lib9c/Action/ChargeActionPoint.cs @@ -38,16 +38,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = avatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = avatarAddress.Derive(LegacyQuestListKey); - - if (context.Rehearsal) - { - return states - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(avatarAddress, MarkChanged); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, avatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}ChargeActionPoint exec started", addressesHex); diff --git a/Lib9c/Action/ChargeActionPoint0.cs b/Lib9c/Action/ChargeActionPoint0.cs index 736a5a9be5..2b1be05e6b 100644 --- a/Lib9c/Action/ChargeActionPoint0.cs +++ b/Lib9c/Action/ChargeActionPoint0.cs @@ -28,10 +28,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states.SetState(avatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ChargeActionPoint2.cs b/Lib9c/Action/ChargeActionPoint2.cs index 9c27aa9b09..3bfceed128 100644 --- a/Lib9c/Action/ChargeActionPoint2.cs +++ b/Lib9c/Action/ChargeActionPoint2.cs @@ -27,10 +27,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states.SetState(avatarAddress, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/ClaimRaidReward.cs b/Lib9c/Action/ClaimRaidReward.cs index 0df5dee0e8..eca6152364 100644 --- a/Lib9c/Action/ClaimRaidReward.cs +++ b/Lib9c/Action/ClaimRaidReward.cs @@ -37,10 +37,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; diff --git a/Lib9c/Action/ClaimWordBossKillReward.cs b/Lib9c/Action/ClaimWordBossKillReward.cs index 3fb56aa21e..8e1e3df28f 100644 --- a/Lib9c/Action/ClaimWordBossKillReward.cs +++ b/Lib9c/Action/ClaimWordBossKillReward.cs @@ -27,10 +27,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } Dictionary sheets = states.GetSheets(sheetTypes: new [] { typeof(WorldBossCharacterSheet), diff --git a/Lib9c/Action/Coupons/IssueCoupons.cs b/Lib9c/Action/Coupons/IssueCoupons.cs index e3c8aca247..1e26c9014b 100644 --- a/Lib9c/Action/Coupons/IssueCoupons.cs +++ b/Lib9c/Action/Coupons/IssueCoupons.cs @@ -31,13 +31,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states.SetCouponWallet( - Recipient, - ImmutableDictionary.Create(), - rehearsal: true); - } CheckPermission(context); diff --git a/Lib9c/Action/Coupons/RedeemCoupon.cs b/Lib9c/Action/Coupons/RedeemCoupon.cs index 334fffe076..9e10145015 100644 --- a/Lib9c/Action/Coupons/RedeemCoupon.cs +++ b/Lib9c/Action/Coupons/RedeemCoupon.cs @@ -36,18 +36,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(AvatarAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetCouponWallet( - context.Signer, - ImmutableDictionary.Create(), - rehearsal: true); - } if (!states.TryGetAvatarStateV2( context.Signer, diff --git a/Lib9c/Action/CreatePendingActivation.cs b/Lib9c/Action/CreatePendingActivation.cs index 1d9c3d3f65..efd4617853 100644 --- a/Lib9c/Action/CreatePendingActivation.cs +++ b/Lib9c/Action/CreatePendingActivation.cs @@ -45,10 +45,6 @@ public CreatePendingActivation(PendingActivationState activationKey) public override IAccount Execute(IActionContext context) { context.UseGas(1); - if (context.Rehearsal) - { - return context.PreviousState.SetState(PendingActivation.address, MarkChanged); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); CheckPermission(context); diff --git a/Lib9c/Action/Garages/DeliverToOthersGarages.cs b/Lib9c/Action/Garages/DeliverToOthersGarages.cs index 28787beaff..32b830ac63 100644 --- a/Lib9c/Action/Garages/DeliverToOthersGarages.cs +++ b/Lib9c/Action/Garages/DeliverToOthersGarages.cs @@ -165,11 +165,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var state = context.PreviousState; - if (context.Rehearsal) - { - return state; - } - var addressesHex = GetSignerAndOtherAddressesHex(context); ValidateFields(addressesHex); state = SendBalances(context, state); diff --git a/Lib9c/Action/Garages/LoadIntoMyGarages.cs b/Lib9c/Action/Garages/LoadIntoMyGarages.cs index 7c61522a31..71d68511c7 100644 --- a/Lib9c/Action/Garages/LoadIntoMyGarages.cs +++ b/Lib9c/Action/Garages/LoadIntoMyGarages.cs @@ -127,11 +127,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var state = context.PreviousState; - if (context.Rehearsal) - { - return state; - } - var addressesHex = GetSignerAndOtherAddressesHex(context); ValidateFields(context.Signer, addressesHex); diff --git a/Lib9c/Action/Garages/UnloadFromMyGarages.cs b/Lib9c/Action/Garages/UnloadFromMyGarages.cs index 2c1ca799ab..961967afa0 100644 --- a/Lib9c/Action/Garages/UnloadFromMyGarages.cs +++ b/Lib9c/Action/Garages/UnloadFromMyGarages.cs @@ -122,11 +122,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var state = context.PreviousState; - if (context.Rehearsal) - { - return state; - } - var addressesHex = GetSignerAndOtherAddressesHex(context); ValidateFields(addressesHex); state = TransferFungibleAssetValues(context, state); diff --git a/Lib9c/Action/Grinding.cs b/Lib9c/Action/Grinding.cs index 39d994b088..61c68d73a2 100644 --- a/Lib9c/Action/Grinding.cs +++ b/Lib9c/Action/Grinding.cs @@ -41,23 +41,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = EquipmentIds.Aggregate(states, - (current, guid) => - current.SetState(Addresses.GetItemAddress(guid), MarkChanged)); - return states - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 0), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 1), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 2), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 3), MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}Grinding exec started", addressesHex); diff --git a/Lib9c/Action/Grinding0.cs b/Lib9c/Action/Grinding0.cs index f698652313..37a8233d3e 100644 --- a/Lib9c/Action/Grinding0.cs +++ b/Lib9c/Action/Grinding0.cs @@ -41,23 +41,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (ctx.Rehearsal) - { - states = EquipmentIds.Aggregate(states, - (current, guid) => - current.SetState(Addresses.GetItemAddress(guid), MarkChanged)); - return states - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 0), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 1), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 2), MarkChanged) - .SetState(MonsterCollectionState.DeriveAddress(context.Signer, 3), MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}Grinding exec started", addressesHex); diff --git a/Lib9c/Action/InitializeStates.cs b/Lib9c/Action/InitializeStates.cs index 3cc1c5c7e6..b59799c76a 100644 --- a/Lib9c/Action/InitializeStates.cs +++ b/Lib9c/Action/InitializeStates.cs @@ -114,37 +114,6 @@ public override IAccount Execute(IActionContext context) var weeklyArenaState = new WeeklyArenaState(0); var rankingState = new RankingState0(Ranking); - if (ctx.Rehearsal) - { - states = states.SetState(RankingState0.Address, MarkChanged); - states = states.SetState(ShopState.Address, MarkChanged); -#pragma warning disable LAA1002 - states = TableSheets - .Aggregate(states, (current, pair) => - current.SetState(Addresses.TableSheet.Derive(pair.Key), MarkChanged)); - states = rankingState.RankingMap - .Aggregate(states, (current, pair) => - current.SetState(pair.Key, MarkChanged)); -#pragma warning restore LAA1002 - states = states.SetState(weeklyArenaState.address, MarkChanged); - states = states.SetState(GameConfigState.Address, MarkChanged); - states = states.SetState(RedeemCodeState.Address, MarkChanged); - states = states.SetState(AdminState.Address, MarkChanged); - states = states.SetState(ActivatedAccountsState.Address, MarkChanged); - states = states.SetState(GoldCurrencyState.Address, MarkChanged); - states = states.SetState(Addresses.GoldDistribution, MarkChanged); - foreach (var rawPending in PendingActivations) - { - states = states.SetState( - new PendingActivationState((Dictionary)rawPending).address, - MarkChanged - ); - } - - states = states.SetState(AuthorizedMinersState.Address, MarkChanged); - states = states.SetState(CreditsState.Address, MarkChanged); - return states; - } if (ctx.BlockIndex != 0) { diff --git a/Lib9c/Action/MigrationActivatedAccountsState.cs b/Lib9c/Action/MigrationActivatedAccountsState.cs index df6739e5e4..98ee40e5a9 100644 --- a/Lib9c/Action/MigrationActivatedAccountsState.cs +++ b/Lib9c/Action/MigrationActivatedAccountsState.cs @@ -22,10 +22,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states.SetState(Nekoyume.Addresses.ActivatedAccount, MarkChanged); - } CheckPermission(context); diff --git a/Lib9c/Action/MigrationAvatarState.cs b/Lib9c/Action/MigrationAvatarState.cs index 2e4a45474c..33c969ebb2 100644 --- a/Lib9c/Action/MigrationAvatarState.cs +++ b/Lib9c/Action/MigrationAvatarState.cs @@ -26,10 +26,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckPermission(context); diff --git a/Lib9c/Action/MigrationLegacyShop.cs b/Lib9c/Action/MigrationLegacyShop.cs index 74ecbc303d..81a4a20d92 100644 --- a/Lib9c/Action/MigrationLegacyShop.cs +++ b/Lib9c/Action/MigrationLegacyShop.cs @@ -30,19 +30,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var sellerAvatarAddresses = _avatarAddressesHex.Select(a => new Address(a)).ToList(); - if (context.Rehearsal) - { - foreach (var avatarAddress in sellerAvatarAddresses) - { - var inventoryAddress = avatarAddress.Derive(LegacyInventoryKey); - states = states - .SetState(inventoryAddress, MarkChanged) - .SetState(avatarAddress, MarkChanged); - } - - return states.SetState(Addresses.Shop, MarkChanged); - } - CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); CheckPermission(context); diff --git a/Lib9c/Action/MigrationLegacyShop0.cs b/Lib9c/Action/MigrationLegacyShop0.cs index a38fa660a4..283ff9a8eb 100644 --- a/Lib9c/Action/MigrationLegacyShop0.cs +++ b/Lib9c/Action/MigrationLegacyShop0.cs @@ -23,14 +23,6 @@ public override IAccount Execute(IActionContext context) var states = context.PreviousState; var sellerAvatarAddresses = _avatarAddressesHex.Select(a => new Address(a)).ToList(); - if (context.Rehearsal) - { - states = sellerAvatarAddresses.Aggregate(states, - (current, sellerAvatarAddress) => current.SetState(sellerAvatarAddress, MarkChanged)); - - return states.SetState(Addresses.Shop, MarkChanged); - } - CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); CheckPermission(context); diff --git a/Lib9c/Action/PatchTableSheet.cs b/Lib9c/Action/PatchTableSheet.cs index 4ac1a61c44..4b6a187fde 100644 --- a/Lib9c/Action/PatchTableSheet.cs +++ b/Lib9c/Action/PatchTableSheet.cs @@ -43,13 +43,6 @@ public override IAccount Execute(IActionContext context) IActionContext ctx = context; var states = ctx.PreviousState; var sheetAddress = Addresses.TableSheet.Derive(TableName); - if (ctx.Rehearsal) - { - return states - .SetState(sheetAddress, MarkChanged) - .SetState(GameConfigState.Address, MarkChanged); - } - var addressesHex = GetSignerAndOtherAddressesHex(context); #if !LIB9C_DEV_EXTENSIONS && !UNITY_EDITOR diff --git a/Lib9c/Action/PetEnhancement.cs b/Lib9c/Action/PetEnhancement.cs index 4299ef0d2b..d82e4d841f 100644 --- a/Lib9c/Action/PetEnhancement.cs +++ b/Lib9c/Action/PetEnhancement.cs @@ -43,11 +43,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var addresses = GetSignerAndOtherAddressesHex(context, AvatarAddress); // NOTE: The `AvatarAddress` must contained in `Signer`'s `AgentState.avatarAddresses`. if (!Addresses.CheckAvatarAddrIsContainedInAgent(context.Signer, AvatarAddress)) diff --git a/Lib9c/Action/PrepareRewardAssets.cs b/Lib9c/Action/PrepareRewardAssets.cs index c5d2499cbd..017e94e633 100644 --- a/Lib9c/Action/PrepareRewardAssets.cs +++ b/Lib9c/Action/PrepareRewardAssets.cs @@ -46,13 +46,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - foreach (var asset in Assets) - { - return states.MarkBalanceChanged(context, asset.Currency, RewardPoolAddress); - } - } CheckPermission(context); diff --git a/Lib9c/Action/ReRegisterProduct.cs b/Lib9c/Action/ReRegisterProduct.cs index 83413d4d99..833dc24f91 100644 --- a/Lib9c/Action/ReRegisterProduct.cs +++ b/Lib9c/Action/ReRegisterProduct.cs @@ -28,10 +28,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (!ReRegisterInfos.Any()) { diff --git a/Lib9c/Action/ReRegisterProduct0.cs b/Lib9c/Action/ReRegisterProduct0.cs index 310a0f43c7..dabd435e5b 100644 --- a/Lib9c/Action/ReRegisterProduct0.cs +++ b/Lib9c/Action/ReRegisterProduct0.cs @@ -28,10 +28,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (!ReRegisterInfos.Any()) { diff --git a/Lib9c/Action/RedeemCode.cs b/Lib9c/Action/RedeemCode.cs index d9eb122206..c1ea1bddc2 100644 --- a/Lib9c/Action/RedeemCode.cs +++ b/Lib9c/Action/RedeemCode.cs @@ -48,19 +48,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(RedeemCodeState.Address, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}RedeemCode exec started", addressesHex); diff --git a/Lib9c/Action/RedeemCode0.cs b/Lib9c/Action/RedeemCode0.cs index 1976866c3e..3cbea4423d 100644 --- a/Lib9c/Action/RedeemCode0.cs +++ b/Lib9c/Action/RedeemCode0.cs @@ -40,15 +40,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - states = states.SetState(RedeemCodeState.Address, MarkChanged); - states = states.SetState(AvatarAddress, MarkChanged); - states = states.SetState(context.Signer, MarkChanged); - states = states.MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address); - states = states.MarkBalanceChanged(context, GoldCurrencyMock, context.Signer); - return states; - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RedeemCode2.cs b/Lib9c/Action/RedeemCode2.cs index 8342167040..35a64cabe0 100644 --- a/Lib9c/Action/RedeemCode2.cs +++ b/Lib9c/Action/RedeemCode2.cs @@ -44,18 +44,6 @@ public override IAccount Execute(IActionContext context) var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var worldInformationAddress = AvatarAddress.Derive(LegacyWorldInformationKey); var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); - if (context.Rehearsal) - { - return states - .SetState(RedeemCodeState.Address, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(context.Signer, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, GoldCurrencyState.Address) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer); - } CheckObsolete(ActionObsoleteConfig.V100080ObsoleteIndex, context); diff --git a/Lib9c/Action/RenewAdminState.cs b/Lib9c/Action/RenewAdminState.cs index 47bb6c69fc..fdc0833b54 100644 --- a/Lib9c/Action/RenewAdminState.cs +++ b/Lib9c/Action/RenewAdminState.cs @@ -36,11 +36,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states - .SetState(Addresses.Admin, MarkChanged); - } if (TryGetAdminState(context, out AdminState adminState)) { diff --git a/Lib9c/Action/RuneEnhancement.cs b/Lib9c/Action/RuneEnhancement.cs index 232eaba627..966ff2c803 100644 --- a/Lib9c/Action/RuneEnhancement.cs +++ b/Lib9c/Action/RuneEnhancement.cs @@ -47,10 +47,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } if (!states.TryGetAvatarStateV2(context.Signer, AvatarAddress, out _, out _)) { diff --git a/Lib9c/Action/RuneEnhancement0.cs b/Lib9c/Action/RuneEnhancement0.cs index b6ffcf007a..d0bddcbb9a 100644 --- a/Lib9c/Action/RuneEnhancement0.cs +++ b/Lib9c/Action/RuneEnhancement0.cs @@ -48,10 +48,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } CheckObsolete(ActionObsoleteConfig.V100360ObsoleteIndex, context); diff --git a/Lib9c/Action/SecureMiningReward.cs b/Lib9c/Action/SecureMiningReward.cs index 7d6ffd8463..8ad9a82bcc 100644 --- a/Lib9c/Action/SecureMiningReward.cs +++ b/Lib9c/Action/SecureMiningReward.cs @@ -59,14 +59,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); IAccount state = context.PreviousState; - if (context.Rehearsal) - { - return state.MarkBalanceChanged( - context, - NCG, - AuthorizedMiners.Add(Recipient).Add(Treasury).ToArray() - ); - } CheckPermission(context); diff --git a/Lib9c/Action/UnlockEquipmentRecipe.cs b/Lib9c/Action/UnlockEquipmentRecipe.cs index 6035f025e0..cc7fab4ddb 100644 --- a/Lib9c/Action/UnlockEquipmentRecipe.cs +++ b/Lib9c/Action/UnlockEquipmentRecipe.cs @@ -36,17 +36,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var unlockedRecipeIdsAddress = AvatarAddress.Derive("recipe_ids"); - if (context.Rehearsal) - { - return states - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(unlockedRecipeIdsAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, Addresses.UnlockEquipmentRecipe); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}UnlockEquipmentRecipe exec started", addressesHex); diff --git a/Lib9c/Action/UnlockEquipmentRecipe1.cs b/Lib9c/Action/UnlockEquipmentRecipe1.cs index 95ff4993a7..140822a7f6 100644 --- a/Lib9c/Action/UnlockEquipmentRecipe1.cs +++ b/Lib9c/Action/UnlockEquipmentRecipe1.cs @@ -37,16 +37,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var unlockedRecipeIdsAddress = AvatarAddress.Derive("recipe_ids"); - if (context.Rehearsal) - { - return states - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .SetState(unlockedRecipeIdsAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, Addresses.UnlockEquipmentRecipe); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); diff --git a/Lib9c/Action/UnlockRuneSlot.cs b/Lib9c/Action/UnlockRuneSlot.cs index 679503b3c3..1350193de3 100644 --- a/Lib9c/Action/UnlockRuneSlot.cs +++ b/Lib9c/Action/UnlockRuneSlot.cs @@ -44,11 +44,6 @@ public override IAccount Execute(IActionContext context) { context.UseGas(1); var states = context.PreviousState; - if (context.Rehearsal) - { - return states; - } - var sheets = states.GetSheets( sheetTypes: new[] { diff --git a/Lib9c/Action/UnlockWorld.cs b/Lib9c/Action/UnlockWorld.cs index f99b815c30..050c4db174 100644 --- a/Lib9c/Action/UnlockWorld.cs +++ b/Lib9c/Action/UnlockWorld.cs @@ -37,16 +37,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var unlockedWorldIdsAddress = AvatarAddress.Derive("world_ids"); - if (context.Rehearsal) - { - return states - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, Addresses.UnlockWorld); - } - var addressesHex = GetSignerAndOtherAddressesHex(context, AvatarAddress); var started = DateTimeOffset.UtcNow; Log.Debug("{AddressesHex}UnlockWorld exec started", addressesHex); diff --git a/Lib9c/Action/UnlockWorld1.cs b/Lib9c/Action/UnlockWorld1.cs index f53f2a1233..0aa816c5a3 100644 --- a/Lib9c/Action/UnlockWorld1.cs +++ b/Lib9c/Action/UnlockWorld1.cs @@ -33,15 +33,6 @@ public override IAccount Execute(IActionContext context) var questListAddress = AvatarAddress.Derive(LegacyQuestListKey); var inventoryAddress = AvatarAddress.Derive(LegacyInventoryKey); var unlockedWorldIdsAddress = AvatarAddress.Derive("world_ids"); - if (context.Rehearsal) - { - return states - .SetState(worldInformationAddress, MarkChanged) - .SetState(questListAddress, MarkChanged) - .SetState(inventoryAddress, MarkChanged) - .SetState(AvatarAddress, MarkChanged) - .MarkBalanceChanged(context, GoldCurrencyMock, context.Signer, Addresses.UnlockWorld); - } CheckObsolete(ActionObsoleteConfig.V200030ObsoleteIndex, context); if (!WorldIds.Any() || WorldIds.Any(i => i < 2 || i == GameConfig.MimisbrunnrWorldId)) From f0b95164a84f121ce5e0a8a765a6cc77d3fedb62 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Mon, 13 Nov 2023 13:57:26 +0900 Subject: [PATCH 12/19] Remove unnecessary method; fix test --- .../Action/AccountStateDeltaExtensionsTest.cs | 9 +---- .../Action/Coupons/RedeemCouponTest.cs | 4 +++ .../Action/Coupons/TransferCouponsTest.cs | 14 ++++++++ Lib9c/Action/AccountStateDeltaExtensions.cs | 33 +------------------ Lib9c/Action/ActionBase.cs | 2 -- Lib9c/Action/Coupons/TransferCoupons.cs | 4 +-- 6 files changed, 22 insertions(+), 44 deletions(-) diff --git a/.Lib9c.Tests/Action/AccountStateDeltaExtensionsTest.cs b/.Lib9c.Tests/Action/AccountStateDeltaExtensionsTest.cs index f8fcc75dfa..83fb2917c1 100644 --- a/.Lib9c.Tests/Action/AccountStateDeltaExtensionsTest.cs +++ b/.Lib9c.Tests/Action/AccountStateDeltaExtensionsTest.cs @@ -115,18 +115,11 @@ public void SetCouponWallet() var agentAddress1 = new Address("0000000000000000000000000000000000000000"); var agentAddress2 = new Address("0000000000000000000000000000000000000001"); - states = states.SetCouponWallet( - agentAddress1, - ImmutableDictionary.Empty - .Add(guid1, coupon1) - .Add(guid2, coupon2), true); - states = states.SetCouponWallet( agentAddress2, ImmutableDictionary.Empty); - Assert.Equal( - ActionBase.MarkChanged, + Assert.Null( states.GetState(agentAddress1.Derive(SerializeKeys.CouponWalletKey))); Assert.Equal( Bencodex.Types.List.Empty, diff --git a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs index 1c1d0d6336..812a174853 100644 --- a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs +++ b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs @@ -137,6 +137,10 @@ public void Execute() CouponsFixture.Guid3, new Coupon(CouponsFixture.Guid3, CouponsFixture.RewardSet3)); + state = state + .SetCouponWallet(CouponsFixture.AgentAddress1, agent1CouponWallet) + .SetCouponWallet(CouponsFixture.AgentAddress2, agent2CouponWallet); + // can't redeem other person's coupon var expected = state.GetAvatarStateV2(agent1Avatar0Address); state = new RedeemCoupon(CouponsFixture.Guid3, agent1Avatar0Address) diff --git a/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs b/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs index c97dbe6b6b..741ce778aa 100644 --- a/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs +++ b/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs @@ -136,6 +136,20 @@ public void Execute() })); // multiple transfer + state = state + .SetCouponWallet( + CouponsFixture.AgentAddress1, + ImmutableDictionary.Empty + .Add(CouponsFixture.Guid1, coupon1) + .Add(CouponsFixture.Guid2, coupon2) + .Add(CouponsFixture.Guid3, coupon3)) + .SetCouponWallet( + CouponsFixture.AgentAddress2, + ImmutableDictionary.Empty) + .SetCouponWallet( + CouponsFixture.AgentAddress3, + ImmutableDictionary.Empty); + state = new TransferCoupons( ImmutableDictionary>.Empty .Add(CouponsFixture.AgentAddress2, ImmutableHashSet.Empty diff --git a/Lib9c/Action/AccountStateDeltaExtensions.cs b/Lib9c/Action/AccountStateDeltaExtensions.cs index 3d1b9c7be7..a60aff3966 100644 --- a/Lib9c/Action/AccountStateDeltaExtensions.cs +++ b/Lib9c/Action/AccountStateDeltaExtensions.cs @@ -19,31 +19,6 @@ namespace Nekoyume.Action { public static class AccountStateDeltaExtensions { - public static IAccount MarkBalanceChanged( - this IAccount states, - IActionContext context, - Currency currency, - params Address[] accounts - ) - { - if (accounts.Length == 1) - { - return states.MintAsset(context, accounts[0], currency * 1); - } - else if (accounts.Length < 1) - { - return states; - } - - for (int i = 1; i < accounts.Length; i++) - { - states = states.TransferAsset(context, accounts[i - 1], accounts[i], currency * 1, true); - } - - return states; - } - - public static IAccount SetWorldBossKillReward( this IAccount states, IActionContext context, @@ -99,15 +74,9 @@ public static IAccount SetWorldBossKillReward( public static IAccount SetCouponWallet( this IAccount states, Address agentAddress, - IImmutableDictionary couponWallet, - bool rehearsal = false) + IImmutableDictionary couponWallet) { Address walletAddress = agentAddress.Derive(CouponWalletKey); - if (rehearsal) - { - return states.SetState(walletAddress, ActionBase.MarkChanged); - } - IValue serializedWallet = new Bencodex.Types.List( couponWallet.Values.OrderBy(c => c.Id).Select(v => v.Serialize()) ); diff --git a/Lib9c/Action/ActionBase.cs b/Lib9c/Action/ActionBase.cs index 2c7a6206e3..abb671d5ae 100644 --- a/Lib9c/Action/ActionBase.cs +++ b/Lib9c/Action/ActionBase.cs @@ -22,8 +22,6 @@ namespace Nekoyume.Action [Serializable] public abstract class ActionBase : IAction { - public static readonly IValue MarkChanged = Null.Value; - // FIXME GoldCurrencyState 에 정의된 것과 다른데 괜찮을지 점검해봐야 합니다. protected static readonly Currency GoldCurrencyMock = new Currency(); diff --git a/Lib9c/Action/Coupons/TransferCoupons.cs b/Lib9c/Action/Coupons/TransferCoupons.cs index d51f35f328..9771f666ef 100644 --- a/Lib9c/Action/Coupons/TransferCoupons.cs +++ b/Lib9c/Action/Coupons/TransferCoupons.cs @@ -55,10 +55,10 @@ public override IAccount Execute(IActionContext context) recipientWallet = recipientWallet.Add(id, coupon); } - states = states.SetCouponWallet(recipient, recipientWallet, context.Rehearsal); + states = states.SetCouponWallet(recipient, recipientWallet); } - states = states.SetCouponWallet(context.Signer, signerWallet, context.Rehearsal); + states = states.SetCouponWallet(context.Signer, signerWallet); return states; } From f7da4019066d9ea6b0f7e47c7042b5f1cfec9684 Mon Sep 17 00:00:00 2001 From: Syu Date: Tue, 14 Nov 2023 18:15:04 +0900 Subject: [PATCH 13/19] Update Costume Item Add --- Lib9c/TableCSV/Item/CostumeItemSheet.csv | 23 +++++++- Lib9c/TableCSV/Item/CostumeStatSheet.csv | 73 ++++++++++++------------ 2 files changed, 59 insertions(+), 37 deletions(-) diff --git a/Lib9c/TableCSV/Item/CostumeItemSheet.csv b/Lib9c/TableCSV/Item/CostumeItemSheet.csv index c37c84bbf2..ce4d97d8fa 100644 --- a/Lib9c/TableCSV/Item/CostumeItemSheet.csv +++ b/Lib9c/TableCSV/Item/CostumeItemSheet.csv @@ -40,6 +40,16 @@ _spine_resource_path,`Title`: ``,,,, 40300008,흰털 파란색 귀,EarCostume,1,Normal, 40300009,흰털 회색 귀,EarCostume,1,Normal, 40300010,흰털 파란 유령 귀,EarCostume,1,Normal, +40300011,사바나 무늬 귀,EarCostume,1,Normal, +40300012,얼룩 무늬 귀,EarCostume,1,Normal, +40300013,야광 분홍 귀,EarCostume,1,Normal, +40300014,야광 청색 귀,EarCostume,1,Normal, +40300015,야광 노랑 귀,EarCostume,1,Normal, +40300016,야광 흰색 귀,EarCostume,1,Normal, +40300017,야광 녹색 귀,EarCostume,1,Normal, +40300018,야광 보라 귀,EarCostume,1,Normal, +40300019,검은 털 귀,EarCostume,1,Normal, +40300020,어두운 보라색 귀,EarCostume,1,Normal, 40400001,빨간색 눈,EyeCostume,1,Normal, 40400002,파란색 눈,EyeCostume,1,Normal, 40400003,초록색 눈,EyeCostume,1,Normal, @@ -56,6 +66,16 @@ _spine_resource_path,`Title`: ``,,,, 40500008,파란색 꼬리,TailCostume,1,Normal, 40500009,회색 꼬리,TailCostume,1,Normal, 40500010,파란 유령 꼬리,TailCostume,1,Normal, +40500011,사바나 무늬 꼬리,TailCostume,1,Normal, +40500012,얼룩 무늬 꼬리,TailCostume,1,Normal, +40500013,야광 분홍 꼬리,TailCostume,1,Normal, +40500014,야광 청색 꼬리,TailCostume,1,Normal, +40500015,야광 노랑 꼬리,TailCostume,1,Normal, +40500016,야광 흰색 꼬리,TailCostume,1,Normal, +40500017,야광 녹색 꼬리,TailCostume,1,Normal, +40500018,야광 보라 꼬리,TailCostume,1,Normal, +40500019,검은 털 꼬리,TailCostume,1,Normal, +40500020,어두운 보라색 꼬리,TailCostume,1,Normal, 49900001,전설의 모험가,Title,4,Normal, 49900002,최초의 전사,Title,5,Normal, 49900003,Yggdrasil Champion,Title,5,Normal, @@ -66,4 +86,5 @@ _spine_resource_path,`Title`: ``,,,, 49900008,Championship 2 Ranker,Title,5,Normal, 49900009,2022 Grand Finale,Title,3,Normal, 49900010,Championship 4 Ranker,Title,5,Normal, -49900011,Great Adventurer 1,Title,5,Normal, \ No newline at end of file +49900011,Great Adventurer 1,Title,5,Normal, +49900012,Championship 6 Ranker,Title,5,Normal, \ No newline at end of file diff --git a/Lib9c/TableCSV/Item/CostumeStatSheet.csv b/Lib9c/TableCSV/Item/CostumeStatSheet.csv index 51973ce915..8cec7718b2 100644 --- a/Lib9c/TableCSV/Item/CostumeStatSheet.csv +++ b/Lib9c/TableCSV/Item/CostumeStatSheet.csv @@ -1,40 +1,41 @@ id,costume_id,stat_type,stat -1,40100000,ATK,30 -2,40100001,DEF,15 -3,40100002,HIT,135 -4,40100003,ATK,60 -5,40100003,HIT,135 -6,40100005,ATK,35 -7,40100006,ATK,55 -8,40100006,SPD,100 -9,49900001,HP,300 -10,49900002,HP,450 -11,49900003,HP,450 -12,49900003,DEF,20 -13,49900004,ATK,40 -14,49900005,ATK,80 -15,49900005,HIT,150 -16,49900006,HIT,120 -17,40100007,DEF,10 -18,40100007,HIT,150 -19,40100009,SPD,80 -20,40100009,ATK,65 -21,40100008,ATK,35 -22,49900007,HP,5000 -23,49900008,DEF,320 -24,40100010,ATK,530 -25,49900009,HIT,1210 -26,40100011,HP,8550 -27,49900010,ATK,500 -28,40100013,ATK,150 -29,40100013,HIT,490 -30,40100014,ATK,150 -31,40100014,SPD,465 -32,40100015,SPD,400 -33,40100015,ATK,105 -34,40100016,HIT,730 -35,40100017,DEF,300 -36,40100017,ATK,105 +1,40100000,ATK,1829 +2,40100001,DEF,1205 +3,40100002,HIT,3009 +4,40100003,ATK,1019 +5,40100003,HIT,1504 +6,40100005,ATK,1829 +7,40100006,ATK,1121 +8,40100006,SPD,1399 +9,49900001,HP,26990 +10,49900002,HP,31041 +11,49900003,HP,15520 +12,49900003,DEF,596 +13,49900004,ATK,1394 +14,49900005,ATK,802 +15,49900005,HIT,1183 +16,49900006,HIT,874 +17,40100007,DEF,910 +18,40100007,HIT,1203 +19,40100009,SPD,1223 +20,40100009,ATK,1244 +21,40100008,ATK,1829 +22,49900007,HP,31041 +23,49900008,DEF,1193 +24,40100010,ATK,2039 +25,49900009,HIT,1749 +26,40100011,HP,39456 +27,49900010,ATK,2367 +28,40100013,ATK,972 +29,40100013,HIT,956 +30,40100014,ATK,972 +31,40100014,SPD,988 +32,40100015,SPD,1482 +33,40100015,ATK,648 +34,40100016,HIT,2391 +35,40100017,DEF,680 +36,40100017,ATK,914 37,40100019,HP,26040 38,40100019,SPD,1368 39,49900011,DEF,1908 +40,49900012,HP,34145 \ No newline at end of file From 76c742452a5926dcd18df7ffc790422685e41985 Mon Sep 17 00:00:00 2001 From: Yang Chun Ung Date: Tue, 14 Nov 2023 19:35:27 +0900 Subject: [PATCH 14/19] Fix test --- .Lib9c.Tests/Model/PlayerTest.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.Lib9c.Tests/Model/PlayerTest.cs b/.Lib9c.Tests/Model/PlayerTest.cs index ed7ad2c100..efc7e0a631 100644 --- a/.Lib9c.Tests/Model/PlayerTest.cs +++ b/.Lib9c.Tests/Model/PlayerTest.cs @@ -303,23 +303,24 @@ public void GetExp() _tableSheets.CharacterLevelSheet, _tableSheets.EquipmentItemSetEffectSheet ); + var baseHp = player.HP; player.SetCostumeStat(_tableSheets.CostumeStatSheet); - - Assert.Equal(600, player.HP); - Assert.Equal(600, player.CurrentHP); + var expectedHp = baseHp + row.Stat; + Assert.Equal(expectedHp, player.HP); + Assert.Equal(expectedHp, player.CurrentHP); Assert.Equal(1, player.Level); player.CurrentHP -= 10; - - Assert.Equal(590, player.CurrentHP); + var expectedCurrentHp = expectedHp - 10; + Assert.Equal(expectedCurrentHp, player.CurrentHP); var requiredExp = _tableSheets.CharacterLevelSheet[1].ExpNeed; player.GetExp2(requiredExp); - + var characterRow = _tableSheets.CharacterSheet[player.CharacterId]; Assert.Equal(2, player.Level); - Assert.Equal(612, player.HP); - Assert.Equal(590, player.CurrentHP); + Assert.Equal(expectedHp + characterRow.LvHP, player.HP); + Assert.Equal(expectedCurrentHp, player.CurrentHP); } [Theory] From 7da5241f0a1f7d22d3e841af9e1d8f14675eabd7 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 15 Nov 2023 17:27:35 +0900 Subject: [PATCH 15/19] Bump libplanet to 3.7.0 --- .Libplanet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Libplanet b/.Libplanet index b13ef31553..630d3e5a28 160000 --- a/.Libplanet +++ b/.Libplanet @@ -1 +1 @@ -Subproject commit b13ef3155389100c218a045fbdc3051e23e3c669 +Subproject commit 630d3e5a289c2ac575750f4fd85df62a6da710f1 From cf3132d3eed709194d81e303639a760f04c1f795 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 15 Nov 2023 17:56:44 +0900 Subject: [PATCH 16/19] Accommodate API changes --- .../TransactionMarshaller.cs | 2 +- Lib9c.MessagePack/AccountStateDelta.cs | 2 +- Lib9c/Action/ActivateAccount.cs | 2 +- Lib9c/Action/ActivateAccount0.cs | 2 +- Lib9c/Action/Coupons/RedeemCoupon.cs | 2 +- Lib9c/Action/Coupons/TransferCoupons.cs | 2 +- Lib9c/Action/CreatePendingActivations.cs | 5 ++--- Lib9c/Model/Coupons/Coupon.cs | 2 +- Lib9c/Model/State/PendingActivationState.cs | 2 +- Lib9c/Model/State/RedeemCodeState.cs | 16 ++++++++-------- Lib9c/TableData/RedeemCodeListSheet.cs | 2 +- 11 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/TransactionMarshaller.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/TransactionMarshaller.cs index a203f523d8..06dfbcb5e9 100644 --- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/TransactionMarshaller.cs +++ b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/TransactionMarshaller.cs @@ -9,7 +9,7 @@ public static class TransactionMarshaller private static readonly Codec Codec = new Codec(); // Copied from Libplanet/Tx/TxMarshaler.cs - private static readonly Binary SignatureKey = new byte[] { 0x53 }; // 'S' + private static readonly Binary SignatureKey = new Binary(new byte[] { 0x53 }); // 'S' public static Dictionary Marshal(this ITransaction transaction) { diff --git a/Lib9c.MessagePack/AccountStateDelta.cs b/Lib9c.MessagePack/AccountStateDelta.cs index ff556a3f95..14bb3cda23 100644 --- a/Lib9c.MessagePack/AccountStateDelta.cs +++ b/Lib9c.MessagePack/AccountStateDelta.cs @@ -45,7 +45,7 @@ public AccountStateDelta(Dictionary states, List balances, Dictionary totalSuppl record => (new Address(record["address"]), new Currency((Dictionary)record["currency"])), record => (BigInteger)(Integer)record["amount"]), totalSupplies.ToImmutableDictionary( - kv => new Currency(new Codec().Decode((Binary)kv.Key)), + kv => new Currency(new Codec().Decode(((Binary)kv.Key).ToByteArray())), kv => (BigInteger)(Integer)kv.Value)) { } diff --git a/Lib9c/Action/ActivateAccount.cs b/Lib9c/Action/ActivateAccount.cs index 9e916e403e..c92c5ce4db 100644 --- a/Lib9c/Action/ActivateAccount.cs +++ b/Lib9c/Action/ActivateAccount.cs @@ -81,7 +81,7 @@ public override void LoadPlainValue(IValue plainValue) { var asDict = (Dictionary)((Dictionary)plainValue)["values"]; PendingAddress = asDict["pa"].ToAddress(); - Signature = (Binary) asDict["s"]; + Signature = ((Binary)asDict["s"]).ToByteArray(); } public Address GetPendingAddress() => PendingAddress; diff --git a/Lib9c/Action/ActivateAccount0.cs b/Lib9c/Action/ActivateAccount0.cs index 9f2640a22d..287a8479de 100644 --- a/Lib9c/Action/ActivateAccount0.cs +++ b/Lib9c/Action/ActivateAccount0.cs @@ -84,7 +84,7 @@ public override void LoadPlainValue(IValue plainValue) { var asDict = (Dictionary)((Dictionary)plainValue)["values"]; PendingAddress = asDict["pending_address"].ToAddress(); - Signature = (Binary) asDict["signature"]; + Signature = ((Binary)asDict["signature"]).ToByteArray(); } public Address GetPendingAddress() => PendingAddress; diff --git a/Lib9c/Action/Coupons/RedeemCoupon.cs b/Lib9c/Action/Coupons/RedeemCoupon.cs index 9e10145015..99423b8595 100644 --- a/Lib9c/Action/Coupons/RedeemCoupon.cs +++ b/Lib9c/Action/Coupons/RedeemCoupon.cs @@ -81,7 +81,7 @@ public override IAccount Execute(IActionContext context) protected override void LoadPlainValueInternal(IImmutableDictionary plainValue) { - CouponId = new Guid((Binary)plainValue["coupon_id"]); + CouponId = new Guid(((Binary)plainValue["coupon_id"]).ToByteArray()); AvatarAddress = new Address(plainValue["avatar_address"]); } } diff --git a/Lib9c/Action/Coupons/TransferCoupons.cs b/Lib9c/Action/Coupons/TransferCoupons.cs index 9771f666ef..5771137396 100644 --- a/Lib9c/Action/Coupons/TransferCoupons.cs +++ b/Lib9c/Action/Coupons/TransferCoupons.cs @@ -77,7 +77,7 @@ protected override void LoadPlainValueInternal(IImmutableDictionary new Address(pair.Key), pair => (IImmutableSet)((Bencodex.Types.List)pair.Value).Select( - value => new Guid((Binary)value) + value => new Guid(((Binary)value).ToByteArray()) ).ToImmutableHashSet() ); } diff --git a/Lib9c/Action/CreatePendingActivations.cs b/Lib9c/Action/CreatePendingActivations.cs index 988a274124..c83358b22b 100644 --- a/Lib9c/Action/CreatePendingActivations.cs +++ b/Lib9c/Action/CreatePendingActivations.cs @@ -24,13 +24,12 @@ public class CreatePendingActivations : ActionBase, ICreatePendingActivationsV1 public IList<(byte[] Address, byte[] Nonce, byte[] PublicKey)> PendingActivations { get; internal set; } IEnumerable ICreatePendingActivationsV1.PendingActivations => - PendingActivations.Select(t => - new List(new Binary[] { t.Address, t.Nonce, t.PublicKey }.Cast())); + PendingActivations.Select(t => new List(new[] { t.Address, t.Nonce, t.PublicKey })); public override IValue PlainValue => Dictionary.Empty .Add("type_id", "create_pending_activations") .Add("values", PendingActivations - .Select(t => new List(new Binary[] { t.Address, t.Nonce, t.PublicKey }.Cast())) + .Select(t => new List(new[] { t.Address, t.Nonce, t.PublicKey })) .Serialize()); public CreatePendingActivations() diff --git a/Lib9c/Model/Coupons/Coupon.cs b/Lib9c/Model/Coupons/Coupon.cs index 24e6178579..be985599f7 100644 --- a/Lib9c/Model/Coupons/Coupon.cs +++ b/Lib9c/Model/Coupons/Coupon.cs @@ -40,7 +40,7 @@ public Coupon(IValue serialized) ); } - Id = new Guid((Binary)dict["id"]); + Id = new Guid(((Binary)dict["id"]).ToByteArray()); Rewards = new RewardSet((Bencodex.Types.Dictionary)dict["rewards"]); } diff --git a/Lib9c/Model/State/PendingActivationState.cs b/Lib9c/Model/State/PendingActivationState.cs index f10ced760d..ce1e601284 100644 --- a/Lib9c/Model/State/PendingActivationState.cs +++ b/Lib9c/Model/State/PendingActivationState.cs @@ -33,7 +33,7 @@ internal static Address DeriveAddress(byte[] nonce, PublicKey publicKey) public PendingActivationState(Dictionary serialized) : base(serialized) { - Nonce = (Binary)serialized["nonce"]; + Nonce = ((Binary)serialized["nonce"]).ToByteArray(); PublicKey = serialized["public_key"].ToPublicKey(); } diff --git a/Lib9c/Model/State/RedeemCodeState.cs b/Lib9c/Model/State/RedeemCodeState.cs index ca62beb5b8..758c3213f2 100644 --- a/Lib9c/Model/State/RedeemCodeState.cs +++ b/Lib9c/Model/State/RedeemCodeState.cs @@ -104,7 +104,7 @@ public int Redeem(string code, Address userAddress) } result.UserAddress = userAddress; - _map[publicKey.Format(true)] = result; + _map[new Binary(publicKey.Format(true))] = result; return result.RewardId; } @@ -114,7 +114,7 @@ public void Update(RedeemCodeListSheet sheet) { if (!Map.ContainsKey(row.PublicKey)) { - _map[row.PublicKey.Format(true)] = new Reward(row.RewardId); + _map[new Binary(row.PublicKey.Format(true))] = new Reward(row.RewardId); } else { @@ -175,12 +175,12 @@ public RedeemCodeMap(IReadOnlyDictionary map) => public int Count => _map.Count; public bool ContainsKey(PublicKey key) => - _map.ContainsKey(key.Format(true)) || - _map.ContainsKey(key.Format(false)); + _map.ContainsKey(new Binary(key.Format(true))) || + _map.ContainsKey(new Binary(key.Format(false))); public bool TryGetValue(PublicKey key, out RedeemCodeState.Reward value) => - _map.TryGetValue(key.Format(true), out value) || - _map.TryGetValue(key.Format(false), out value); + _map.TryGetValue(new Binary(key.Format(true)), out value) || + _map.TryGetValue(new Binary(key.Format(false)), out value); public RedeemCodeState.Reward this[PublicKey key] { @@ -188,11 +188,11 @@ public RedeemCodeState.Reward this[PublicKey key] { try { - return _map[key.Format(true)]; + return _map[new Binary(key.Format(true))]; } catch (KeyNotFoundException) { - return _map[key.Format(false)]; + return _map[new Binary(key.Format(false))]; } } } diff --git a/Lib9c/TableData/RedeemCodeListSheet.cs b/Lib9c/TableData/RedeemCodeListSheet.cs index b7f95fd124..e09143418c 100644 --- a/Lib9c/TableData/RedeemCodeListSheet.cs +++ b/Lib9c/TableData/RedeemCodeListSheet.cs @@ -24,7 +24,7 @@ public override void Set(IReadOnlyList fields) { Id = ParseInt(fields[0]); RewardId = ParseInt(fields[1]); - PublicKeyBinary = ByteUtil.ParseHex(fields[2]); + PublicKeyBinary = new Binary(ByteUtil.ParseHex(fields[2])); } } From 6a92c74bb1bb2fc7ea67382a0962500e17014a8d Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Wed, 15 Nov 2023 18:50:21 +0900 Subject: [PATCH 17/19] Cleanup --- .../transfer_asset.PlainValue.verified.txt | 42 +------------------ .../ActionContextMarshaller.cs | 2 +- .../ActionEvaluationMarshaller.cs | 2 +- Lib9c/Model/State/StateExtensions.cs | 2 +- 4 files changed, 4 insertions(+), 44 deletions(-) diff --git a/.Lib9c.Tests/Action/Snapshot/transfer_asset.PlainValue.verified.txt b/.Lib9c.Tests/Action/Snapshot/transfer_asset.PlainValue.verified.txt index 3694f6213a..9aee256842 100644 --- a/.Lib9c.Tests/Action/Snapshot/transfer_asset.PlainValue.verified.txt +++ b/.Lib9c.Tests/Action/Snapshot/transfer_asset.PlainValue.verified.txt @@ -1,26 +1,6 @@ { Bencodex.Types.Text "type_id": { EncodingLength: 18, - Fingerprint: { - Digest: [ - 116, - 114, - 97, - 110, - 115, - 102, - 101, - 114, - 95, - 97, - 115, - 115, - 101, - 116 - ], - EncodingLength: 18, - Kind: Text - }, Kind: Text, Value: transfer_asset }, @@ -31,36 +11,16 @@ 2 ], Bencodex.Types.Text "minters": { - EncodingLength: 1, - Fingerprint: { - EncodingLength: 1 - } + EncodingLength: 1 }, Bencodex.Types.Text "ticker": { EncodingLength: 6, - Fingerprint: { - Digest: [ - 78, - 78, - 78 - ], - EncodingLength: 6, - Kind: Text - }, Kind: Text, Value: NNN } }, { EncodingLength: 7, - Fingerprint: { - Digest: [ - 16, - 39 - ], - EncodingLength: 7, - Kind: Integer - }, Kind: Integer, Value: 10000 } diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs index d9cf9b6ea3..a75201cbb7 100644 --- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs +++ b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionContextMarshaller.cs @@ -51,7 +51,7 @@ txIdValue is Binary txIdBinaryValue blockIndex: (Integer)dictionary["block_index"], blockProtocolVersion: (Integer)dictionary["block_protocol_version"], rehearsal: (Boolean)dictionary["rehearsal"], - previousState: new HashDigest(((Binary)dictionary["previous_states"]).ByteArray), + previousState: new HashDigest(dictionary["previous_states"]), randomSeed: (Integer)dictionary["random_seed"], blockAction: (Boolean)dictionary["block_action"] ); diff --git a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs index 79be7c239a..408843b61e 100644 --- a/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs +++ b/.Libplanet.Extensions.ActionEvaluatorCommonComponents/ActionEvaluationMarshaller.cs @@ -32,7 +32,7 @@ public static ICommittedActionEvaluation Unmarshal(IValue value) return new CommittedActionEvaluation( dictionary["action"], ActionContextMarshaller.Unmarshal((Dictionary)dictionary["input_context"]), - new HashDigest((Binary)dictionary["output_states"]), + new HashDigest(dictionary["output_states"]), dictionary["exception"] is Text typeName ? new Exception(typeName) : null ); } diff --git a/Lib9c/Model/State/StateExtensions.cs b/Lib9c/Model/State/StateExtensions.cs index bfd5697c14..01d159f792 100644 --- a/Lib9c/Model/State/StateExtensions.cs +++ b/Lib9c/Model/State/StateExtensions.cs @@ -421,7 +421,7 @@ public static IValue Serialize(this HashDigest hashDigest) => public static HashDigest ToItemId(this IValue serialized) { - return new HashDigest(((Binary)serialized).ByteArray); + return new HashDigest(serialized); } #endregion From 62ac4227b80806b31b0caa0ea506a69b42e14373 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 21 Nov 2023 13:09:56 +0900 Subject: [PATCH 18/19] Bump libplanet to 3.7.1 --- .Libplanet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Libplanet b/.Libplanet index 630d3e5a28..24331ea2f3 160000 --- a/.Libplanet +++ b/.Libplanet @@ -1 +1 @@ -Subproject commit 630d3e5a289c2ac575750f4fd85df62a6da710f1 +Subproject commit 24331ea2f37f2d3f6d7352f8dc0f7ddf93fabb5d From b4555f15510a1d8126ce50ef00dde055d40a73d7 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 21 Nov 2023 16:48:12 +0900 Subject: [PATCH 19/19] Completely remove rehearsal --- .../Action/CreateOrReplaceAvatarTest.cs | 1 - .Lib9c.Tests/Action/ActionContext.cs | 2 +- .Lib9c.Tests/Action/BattleArena10Test.cs | 3 --- .Lib9c.Tests/Action/BattleArena11Test.cs | 3 --- .Lib9c.Tests/Action/BattleArena12Test.cs | 3 --- .Lib9c.Tests/Action/BattleArena13Test.cs | 3 --- .Lib9c.Tests/Action/BattleArena1Test.cs | 2 -- .Lib9c.Tests/Action/BattleArena2Test.cs | 2 -- .Lib9c.Tests/Action/BattleArena3Test.cs | 2 -- .Lib9c.Tests/Action/BattleArena4Test.cs | 3 --- .Lib9c.Tests/Action/BattleArena5Test.cs | 2 -- .Lib9c.Tests/Action/BattleArena6Test.cs | 2 -- .Lib9c.Tests/Action/BattleArena7Test.cs | 2 -- .Lib9c.Tests/Action/BattleArena8Test.cs | 3 --- .Lib9c.Tests/Action/BattleArena9Test.cs | 3 --- .Lib9c.Tests/Action/Buy10Test.cs | 3 --- .Lib9c.Tests/Action/Buy11Test.cs | 4 ---- .Lib9c.Tests/Action/Buy2Test.cs | 1 - .Lib9c.Tests/Action/Buy3Test.cs | 1 - .Lib9c.Tests/Action/Buy4Test.cs | 1 - .Lib9c.Tests/Action/Buy5Test.cs | 1 - .Lib9c.Tests/Action/Buy6Test.cs | 1 - .Lib9c.Tests/Action/Buy7Test.cs | 1 - .Lib9c.Tests/Action/Buy8Test.cs | 1 - .Lib9c.Tests/Action/Buy9Test.cs | 1 - .Lib9c.Tests/Action/BuyMultipleTest.cs | 1 - .Lib9c.Tests/Action/BuyTest.cs | 4 ---- .Lib9c.Tests/Action/ChargeActionPoint0Test.cs | 1 - .Lib9c.Tests/Action/ChargeActionPoint2Test.cs | 2 -- .Lib9c.Tests/Action/ChargeActionPointTest.cs | 2 -- .Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs | 5 ----- .Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs | 10 ---------- .Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs | 8 -------- .Lib9c.Tests/Action/DailyReward0Test.cs | 1 - .Lib9c.Tests/Action/DailyReward2Test.cs | 1 - .Lib9c.Tests/Action/DailyReward3Test.cs | 1 - .Lib9c.Tests/Action/DailyReward4Test.cs | 1 - .Lib9c.Tests/Action/DailyReward5Test.cs | 1 - .Lib9c.Tests/Action/DailyReward6Test.cs | 1 - .Lib9c.Tests/Action/DailyRewardTest.cs | 1 - .Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs | 1 - .Lib9c.Tests/Action/EventDungeonBattleV1Test.cs | 1 - .Lib9c.Tests/Action/EventDungeonBattleV2Test.cs | 1 - .Lib9c.Tests/Action/EventDungeonBattleV3Test.cs | 1 - .Lib9c.Tests/Action/EventDungeonBattleV4Test.cs | 1 - .Lib9c.Tests/Action/EventDungeonBattleV5Test.cs | 1 - .Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs | 1 - .../Action/Garages/DeliverToOthersGaragesTest.cs | 1 - .Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs | 1 - .../Action/Garages/UnloadFromMyGaragesTest.cs | 1 - .Lib9c.Tests/Action/HackAndSlash0Test.cs | 3 --- .Lib9c.Tests/Action/HackAndSlash10Test.cs | 6 ------ .Lib9c.Tests/Action/HackAndSlash11Test.cs | 5 ----- .Lib9c.Tests/Action/HackAndSlash12Test.cs | 5 ----- .Lib9c.Tests/Action/HackAndSlash13Test.cs | 5 ----- .Lib9c.Tests/Action/HackAndSlash15Test.cs | 6 ------ .Lib9c.Tests/Action/HackAndSlash16Test.cs | 6 ------ .Lib9c.Tests/Action/HackAndSlash17Test.cs | 6 ------ .Lib9c.Tests/Action/HackAndSlash18Test.cs | 8 -------- .Lib9c.Tests/Action/HackAndSlash19Test.cs | 7 ------- .Lib9c.Tests/Action/HackAndSlash20Test.cs | 10 ---------- .Lib9c.Tests/Action/HackAndSlash21Test.cs | 10 ---------- .Lib9c.Tests/Action/HackAndSlash2Test.cs | 3 --- .Lib9c.Tests/Action/HackAndSlash3Test.cs | 1 - .Lib9c.Tests/Action/HackAndSlash4Test.cs | 4 ---- .Lib9c.Tests/Action/HackAndSlash5Test.cs | 4 ---- .Lib9c.Tests/Action/HackAndSlash6Test.cs | 4 ---- .Lib9c.Tests/Action/HackAndSlash7Test.cs | 4 ---- .Lib9c.Tests/Action/HackAndSlash8Test.cs | 4 ---- .Lib9c.Tests/Action/HackAndSlash9Test.cs | 6 ------ .Lib9c.Tests/Action/HackAndSlashTest14.cs | 6 ------ .Lib9c.Tests/Action/JoinArena1Test.cs | 2 -- .Lib9c.Tests/Action/JoinArena2Test.cs | 2 -- .Lib9c.Tests/Action/JoinArena3Test.cs | 2 -- .Lib9c.Tests/Action/MimisbrunnrBattle0Test.cs | 5 +---- .Lib9c.Tests/Action/MimisbrunnrBattle10Test.cs | 7 +------ .Lib9c.Tests/Action/MimisbrunnrBattle11Test.cs | 6 +----- .Lib9c.Tests/Action/MimisbrunnrBattle12Test.cs | 7 +------ .Lib9c.Tests/Action/MimisbrunnrBattle13Test.cs | 7 +------ .Lib9c.Tests/Action/MimisbrunnrBattle2Test.cs | 5 +---- .Lib9c.Tests/Action/MimisbrunnrBattle3Test.cs | 5 +---- .Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs | 5 +---- .Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs | 5 +---- .Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs | 6 +----- .Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs | 6 +----- .Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs | 6 +----- .Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs | 6 +----- .Lib9c.Tests/Action/PatchTableSheetTest.cs | 2 -- .Lib9c.Tests/Action/PetEnhancement0Test.cs | 1 - .Lib9c.Tests/Action/Raid1Test.cs | 4 ---- .Lib9c.Tests/Action/Raid2Test.cs | 3 --- .Lib9c.Tests/Action/Raid3Test.cs | 3 --- .Lib9c.Tests/Action/Raid4Test.cs | 4 ---- .Lib9c.Tests/Action/Raid5Test.cs | 4 ---- .Lib9c.Tests/Action/Raid6Test.cs | 4 ---- .Lib9c.Tests/Action/RankingBattle0Test.cs | 8 -------- .Lib9c.Tests/Action/RankingBattle10Test.cs | 8 -------- .Lib9c.Tests/Action/RankingBattle11Test.cs | 10 ---------- .Lib9c.Tests/Action/RankingBattle2Test.cs | 8 -------- .Lib9c.Tests/Action/RankingBattle3Test.cs | 9 --------- .Lib9c.Tests/Action/RankingBattle4Test.cs | 9 --------- .Lib9c.Tests/Action/RankingBattle5Test.cs | 9 --------- .Lib9c.Tests/Action/RankingBattle6Test.cs | 9 --------- .Lib9c.Tests/Action/RankingBattle7Test.cs | 9 --------- .Lib9c.Tests/Action/RankingBattle8Test.cs | 8 -------- .Lib9c.Tests/Action/RankingBattle9Test.cs | 8 -------- .Lib9c.Tests/Action/RankingBattleTest.cs | 1 - .Lib9c.Tests/Action/ReRegisterProduct0Test.cs | 2 -- .Lib9c.Tests/Action/ReRegisterProductTest.cs | 2 -- .Lib9c.Tests/Action/RedeemCode0Test.cs | 1 - .Lib9c.Tests/Action/RedeemCodeTest.cs | 1 - .Lib9c.Tests/Action/RuneEnhancement0Test.cs | 2 -- .Lib9c.Tests/Action/RuneEnhancementTest.cs | 2 -- .Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs | 2 -- .../Action/Scenario/SellAndCancellationAndSellTest.cs | 3 --- .../Action/Scenario/StakeAndClaimScenarioTest.cs | 4 ---- .../Action/Scenario/WorldUnlockScenarioTest.cs | 6 ------ .Lib9c.Tests/Action/SecureMiningRewardTest.cs | 2 -- .Lib9c.Tests/Action/Sell0Test.cs | 1 - .Lib9c.Tests/Action/Sell10Test.cs | 1 - .Lib9c.Tests/Action/Sell11Test.cs | 1 - .Lib9c.Tests/Action/Sell2Test.cs | 1 - .Lib9c.Tests/Action/Sell3Test.cs | 1 - .Lib9c.Tests/Action/Sell4Test.cs | 1 - .Lib9c.Tests/Action/Sell5Test.cs | 1 - .Lib9c.Tests/Action/Sell6Test.cs | 2 -- .Lib9c.Tests/Action/Sell7Test.cs | 1 - .Lib9c.Tests/Action/Sell8Test.cs | 1 - .Lib9c.Tests/Action/Sell9Test.cs | 1 - .Lib9c.Tests/Action/SellCancellation0Test.cs | 1 - .Lib9c.Tests/Action/SellCancellation2Test.cs | 1 - .Lib9c.Tests/Action/SellCancellation3Test.cs | 2 -- .Lib9c.Tests/Action/SellCancellation4Test.cs | 2 -- .Lib9c.Tests/Action/SellCancellation5Test.cs | 1 - .Lib9c.Tests/Action/SellCancellation6Test.cs | 1 - .Lib9c.Tests/Action/SellCancellation7Test.cs | 1 - .Lib9c.Tests/Action/SellCancellation8Test.cs | 2 -- .Lib9c.Tests/Action/SellCancellationTest.cs | 3 --- .Lib9c.Tests/Action/SellTest.cs | 1 - .Lib9c.Tests/Action/StakeTest.cs | 1 - .Lib9c.Tests/Action/TransferAsset2Test.cs | 9 --------- .Lib9c.Tests/Action/TransferAsset3Test.cs | 8 -------- .Lib9c.Tests/Action/TransferAsset4Test.cs | 6 ------ .Lib9c.Tests/Action/TransferAssetTest.cs | 10 ---------- .Lib9c.Tests/Action/TransferAssetTest0.cs | 7 ------- .Lib9c.Tests/Action/TransferAssets0Test.cs | 9 --------- .Lib9c.Tests/Action/TransferAssets2Test.cs | 7 ------- .Lib9c.Tests/Action/TransferAssetsTest.cs | 11 ----------- .Lib9c.Tests/Action/UnlockRuneSlotTest.cs | 5 ----- .Lib9c.Tests/Action/UpdateSell0Test.cs | 1 - .Lib9c.Tests/Action/UpdateSell2Test.cs | 1 - .Lib9c.Tests/Action/UpdateSell3Test.cs | 1 - .Lib9c.Tests/Action/UpdateSell4Test.cs | 1 - .Lib9c.Tests/Action/UpdateSellTest.cs | 1 - .Lib9c.Tests/TestHelper/BlockChainHelper.cs | 1 - 155 files changed, 14 insertions(+), 536 deletions(-) diff --git a/.Lib9c.DevExtensions.Tests/Action/CreateOrReplaceAvatarTest.cs b/.Lib9c.DevExtensions.Tests/Action/CreateOrReplaceAvatarTest.cs index 0ab36e8230..75a07d981e 100644 --- a/.Lib9c.DevExtensions.Tests/Action/CreateOrReplaceAvatarTest.cs +++ b/.Lib9c.DevExtensions.Tests/Action/CreateOrReplaceAvatarTest.cs @@ -460,7 +460,6 @@ private static void Execute( PreviousState = previousStates, Signer = agentAddr, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); var agent = new AgentState((Dictionary)nextStates.GetState(agentAddr)!); diff --git a/.Lib9c.Tests/Action/ActionContext.cs b/.Lib9c.Tests/Action/ActionContext.cs index 62ba8ded68..a4e6e1610d 100644 --- a/.Lib9c.Tests/Action/ActionContext.cs +++ b/.Lib9c.Tests/Action/ActionContext.cs @@ -27,7 +27,7 @@ public class ActionContext : IActionContext public int BlockProtocolVersion { get; set; } - public bool Rehearsal { get; set; } + public bool Rehearsal => false; public IAccount PreviousState { get; set; } diff --git a/.Lib9c.Tests/Action/BattleArena10Test.cs b/.Lib9c.Tests/Action/BattleArena10Test.cs index 734030b98a..9bbf5ca6f7 100644 --- a/.Lib9c.Tests/Action/BattleArena10Test.cs +++ b/.Lib9c.Tests/Action/BattleArena10Test.cs @@ -973,7 +973,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = previousStates, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, })); } @@ -1205,7 +1204,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1310,7 +1308,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena11Test.cs b/.Lib9c.Tests/Action/BattleArena11Test.cs index ef11262ce3..76a7849e59 100644 --- a/.Lib9c.Tests/Action/BattleArena11Test.cs +++ b/.Lib9c.Tests/Action/BattleArena11Test.cs @@ -973,7 +973,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = previousStates, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, })); } @@ -1205,7 +1204,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1310,7 +1308,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena12Test.cs b/.Lib9c.Tests/Action/BattleArena12Test.cs index e478c53e27..151753f012 100644 --- a/.Lib9c.Tests/Action/BattleArena12Test.cs +++ b/.Lib9c.Tests/Action/BattleArena12Test.cs @@ -973,7 +973,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = previousStates, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, })); } @@ -1244,7 +1243,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1349,7 +1347,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena13Test.cs b/.Lib9c.Tests/Action/BattleArena13Test.cs index a74780bb27..9c98b560a7 100644 --- a/.Lib9c.Tests/Action/BattleArena13Test.cs +++ b/.Lib9c.Tests/Action/BattleArena13Test.cs @@ -973,7 +973,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = previousStates, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, })); } @@ -1205,7 +1204,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1310,7 +1308,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena1Test.cs b/.Lib9c.Tests/Action/BattleArena1Test.cs index f7065a2d85..c1f9bc277c 100644 --- a/.Lib9c.Tests/Action/BattleArena1Test.cs +++ b/.Lib9c.Tests/Action/BattleArena1Test.cs @@ -209,7 +209,6 @@ public IAccount JoinArena(IActionContext context, Address signer, Address avatar PreviousState = _state, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return _state; @@ -293,7 +292,6 @@ public void Execute(long nextBlockIndex, int championshipId, int round, int tick PreviousState = _state, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/BattleArena2Test.cs b/.Lib9c.Tests/Action/BattleArena2Test.cs index 93a9ea9293..a9c5a9fe96 100644 --- a/.Lib9c.Tests/Action/BattleArena2Test.cs +++ b/.Lib9c.Tests/Action/BattleArena2Test.cs @@ -213,7 +213,6 @@ public IAccount JoinArena(IActionContext context, Address signer, Address avatar PreviousState = _state, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return _state; @@ -308,7 +307,6 @@ public void Execute( PreviousState = _state, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/BattleArena3Test.cs b/.Lib9c.Tests/Action/BattleArena3Test.cs index 18dd8ef071..8b17bc5fa5 100644 --- a/.Lib9c.Tests/Action/BattleArena3Test.cs +++ b/.Lib9c.Tests/Action/BattleArena3Test.cs @@ -213,7 +213,6 @@ public IAccount JoinArena(IActionContext context, Address signer, Address avatar PreviousState = _state, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return _state; @@ -308,7 +307,6 @@ public void Execute( PreviousState = _state, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/BattleArena4Test.cs b/.Lib9c.Tests/Action/BattleArena4Test.cs index b78894e10d..c49f29830b 100644 --- a/.Lib9c.Tests/Action/BattleArena4Test.cs +++ b/.Lib9c.Tests/Action/BattleArena4Test.cs @@ -213,7 +213,6 @@ public IAccount JoinArena(IActionContext context, Address signer, Address avatar PreviousState = _state, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return _state; @@ -308,7 +307,6 @@ public void Execute( PreviousState = _state, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -927,7 +925,6 @@ public void Execute_v100291() PreviousState = _state, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/BattleArena5Test.cs b/.Lib9c.Tests/Action/BattleArena5Test.cs index 8b2f9aab84..f30765fae8 100644 --- a/.Lib9c.Tests/Action/BattleArena5Test.cs +++ b/.Lib9c.Tests/Action/BattleArena5Test.cs @@ -896,7 +896,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1001,7 +1000,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena6Test.cs b/.Lib9c.Tests/Action/BattleArena6Test.cs index 7067a0b31f..59ccc0d8ae 100644 --- a/.Lib9c.Tests/Action/BattleArena6Test.cs +++ b/.Lib9c.Tests/Action/BattleArena6Test.cs @@ -982,7 +982,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1087,7 +1086,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena7Test.cs b/.Lib9c.Tests/Action/BattleArena7Test.cs index 523a5626f7..2847662dcd 100644 --- a/.Lib9c.Tests/Action/BattleArena7Test.cs +++ b/.Lib9c.Tests/Action/BattleArena7Test.cs @@ -995,7 +995,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1100,7 +1099,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena8Test.cs b/.Lib9c.Tests/Action/BattleArena8Test.cs index 41779f3cf7..3814ffddcb 100644 --- a/.Lib9c.Tests/Action/BattleArena8Test.cs +++ b/.Lib9c.Tests/Action/BattleArena8Test.cs @@ -973,7 +973,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = previousStates, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, })); } @@ -1205,7 +1204,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1310,7 +1308,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/BattleArena9Test.cs b/.Lib9c.Tests/Action/BattleArena9Test.cs index e79f7a291e..ab3554db6c 100644 --- a/.Lib9c.Tests/Action/BattleArena9Test.cs +++ b/.Lib9c.Tests/Action/BattleArena9Test.cs @@ -973,7 +973,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = previousStates, Signer = _agent1Address, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, })); } @@ -1205,7 +1204,6 @@ private void Execute( PreviousState = previousStates, Signer = myAgentAddress, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -1310,7 +1308,6 @@ private IAccount JoinArena( PreviousState = states, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return states; diff --git a/.Lib9c.Tests/Action/Buy10Test.cs b/.Lib9c.Tests/Action/Buy10Test.cs index 3a3f550419..bddb360d9d 100644 --- a/.Lib9c.Tests/Action/Buy10Test.cs +++ b/.Lib9c.Tests/Action/Buy10Test.cs @@ -332,7 +332,6 @@ public void Execute(params OrderData[] orderDataList) BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); @@ -701,7 +700,6 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList) BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); @@ -809,7 +807,6 @@ public void Execute_With_Testbed() BlockIndex = 100, PreviousState = nextState, RandomSeed = 0, - Rehearsal = false, Signer = result.GetAgentState().address, }); diff --git a/.Lib9c.Tests/Action/Buy11Test.cs b/.Lib9c.Tests/Action/Buy11Test.cs index 6a68862fb3..30e0275d23 100644 --- a/.Lib9c.Tests/Action/Buy11Test.cs +++ b/.Lib9c.Tests/Action/Buy11Test.cs @@ -338,7 +338,6 @@ public void Execute(params OrderData[] orderDataList) BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); @@ -707,7 +706,6 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList) BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); @@ -818,7 +816,6 @@ public void Execute_With_Testbed() BlockIndex = 100, PreviousState = nextState, RandomSeed = 0, - Rehearsal = false, Signer = result.GetAgentState().address, }); @@ -937,7 +934,6 @@ public void Execute_ActionObsoletedException() BlockIndex = 100, PreviousState = nextState, RandomSeed = 0, - Rehearsal = false, Signer = result.GetAgentState().address, }); }); diff --git a/.Lib9c.Tests/Action/Buy2Test.cs b/.Lib9c.Tests/Action/Buy2Test.cs index 4efc953256..da5b9ea375 100644 --- a/.Lib9c.Tests/Action/Buy2Test.cs +++ b/.Lib9c.Tests/Action/Buy2Test.cs @@ -151,7 +151,6 @@ public void Execute() BlockIndex = 0, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/Buy3Test.cs b/.Lib9c.Tests/Action/Buy3Test.cs index 499bb94572..d6b72c532b 100644 --- a/.Lib9c.Tests/Action/Buy3Test.cs +++ b/.Lib9c.Tests/Action/Buy3Test.cs @@ -165,7 +165,6 @@ public void Execute() BlockIndex = 0, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/Buy4Test.cs b/.Lib9c.Tests/Action/Buy4Test.cs index 6ad35d7fb6..072ece0228 100644 --- a/.Lib9c.Tests/Action/Buy4Test.cs +++ b/.Lib9c.Tests/Action/Buy4Test.cs @@ -184,7 +184,6 @@ public void Execute() BlockIndex = 0, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/Buy5Test.cs b/.Lib9c.Tests/Action/Buy5Test.cs index 18e7413aa4..f17caa6b54 100644 --- a/.Lib9c.Tests/Action/Buy5Test.cs +++ b/.Lib9c.Tests/Action/Buy5Test.cs @@ -260,7 +260,6 @@ public void Execute(params ShopItemData[] shopItemMembers) BlockIndex = 1, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/Buy6Test.cs b/.Lib9c.Tests/Action/Buy6Test.cs index 6d61fa7104..79507ddd07 100644 --- a/.Lib9c.Tests/Action/Buy6Test.cs +++ b/.Lib9c.Tests/Action/Buy6Test.cs @@ -320,7 +320,6 @@ out _ BlockIndex = 1, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/Buy7Test.cs b/.Lib9c.Tests/Action/Buy7Test.cs index 7f77c8a1de..dc5468be03 100644 --- a/.Lib9c.Tests/Action/Buy7Test.cs +++ b/.Lib9c.Tests/Action/Buy7Test.cs @@ -321,7 +321,6 @@ out _ BlockIndex = 1, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/Buy8Test.cs b/.Lib9c.Tests/Action/Buy8Test.cs index f968b3815b..f5f899e048 100644 --- a/.Lib9c.Tests/Action/Buy8Test.cs +++ b/.Lib9c.Tests/Action/Buy8Test.cs @@ -306,7 +306,6 @@ out _ BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/Buy9Test.cs b/.Lib9c.Tests/Action/Buy9Test.cs index b0da320384..5f8b67d0aa 100644 --- a/.Lib9c.Tests/Action/Buy9Test.cs +++ b/.Lib9c.Tests/Action/Buy9Test.cs @@ -404,7 +404,6 @@ out _ BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/BuyMultipleTest.cs b/.Lib9c.Tests/Action/BuyMultipleTest.cs index 50a56ce6d3..83f9da09f9 100644 --- a/.Lib9c.Tests/Action/BuyMultipleTest.cs +++ b/.Lib9c.Tests/Action/BuyMultipleTest.cs @@ -335,7 +335,6 @@ public void Execute(params ShopItemData[] productDatas) BlockIndex = 1, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); diff --git a/.Lib9c.Tests/Action/BuyTest.cs b/.Lib9c.Tests/Action/BuyTest.cs index dd26c09de8..fb6b6a14e6 100644 --- a/.Lib9c.Tests/Action/BuyTest.cs +++ b/.Lib9c.Tests/Action/BuyTest.cs @@ -347,7 +347,6 @@ public void Execute(params OrderData[] orderDataList) BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); @@ -361,7 +360,6 @@ public void Execute(params OrderData[] orderDataList) BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); @@ -776,7 +774,6 @@ public void Execute_ReconfigureFungibleItem(params OrderData[] orderDataList) BlockIndex = 100, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _buyerAgentAddress, }); @@ -884,7 +881,6 @@ public void Execute_With_Testbed() BlockIndex = 100, PreviousState = nextState, RandomSeed = 0, - Rehearsal = false, Signer = result.GetAgentState().address, }); diff --git a/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs b/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs index 48cd7890fc..7d95a4c606 100644 --- a/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs +++ b/.Lib9c.Tests/Action/ChargeActionPoint0Test.cs @@ -73,7 +73,6 @@ public void Execute() PreviousState = state, Signer = agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(avatarAddress); diff --git a/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs b/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs index 2b38a15601..f15b2ab401 100644 --- a/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs +++ b/.Lib9c.Tests/Action/ChargeActionPoint2Test.cs @@ -91,7 +91,6 @@ public void Execute(bool useTradable) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -146,7 +145,6 @@ public void Execute_Throw_NotEnoughMaterialException(bool useTradable) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); } diff --git a/.Lib9c.Tests/Action/ChargeActionPointTest.cs b/.Lib9c.Tests/Action/ChargeActionPointTest.cs index c02d549f7f..7a78f06e33 100644 --- a/.Lib9c.Tests/Action/ChargeActionPointTest.cs +++ b/.Lib9c.Tests/Action/ChargeActionPointTest.cs @@ -108,7 +108,6 @@ public void Execute(bool useTradable, bool backward) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -164,7 +163,6 @@ public void Execute_Throw_Exception(bool useAvatarAddress, bool useTradable, boo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); } diff --git a/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs b/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs index 4a2f2a5060..712254c8fd 100644 --- a/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs +++ b/.Lib9c.Tests/Action/Coupons/IssueCouponsTest.cs @@ -33,7 +33,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, RandomSeed = random.Seed, BlockIndex = long.MaxValue, Signer = CouponsFixture.AgentAddress1, @@ -47,7 +46,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, RandomSeed = random.Seed, BlockIndex = 0, Signer = CouponsFixture.AgentAddress2, @@ -62,7 +60,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, RandomSeed = random.Seed, BlockIndex = 0, Signer = CouponsFixture.AgentAddress1, @@ -78,7 +75,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, RandomSeed = random.Seed, BlockIndex = 0, Signer = CouponsFixture.AgentAddress1, @@ -92,7 +88,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, RandomSeed = random.Seed, BlockIndex = 0, Signer = CouponsFixture.AgentAddress1, diff --git a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs index 812a174853..dc7d2bd104 100644 --- a/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs +++ b/.Lib9c.Tests/Action/Coupons/RedeemCouponTest.cs @@ -117,7 +117,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, })); @@ -148,7 +147,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); @@ -164,7 +162,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); @@ -183,7 +180,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); @@ -203,7 +199,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); @@ -221,7 +216,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); @@ -243,7 +237,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); @@ -260,7 +253,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); @@ -280,7 +272,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress2, RandomSeed = random.Seed, }); @@ -302,7 +293,6 @@ public void Execute() new ActionContext { PreviousState = state, - Rehearsal = false, Signer = CouponsFixture.AgentAddress1, RandomSeed = random.Seed, }); diff --git a/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs b/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs index 741ce778aa..19671779c3 100644 --- a/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs +++ b/.Lib9c.Tests/Action/Coupons/TransferCouponsTest.cs @@ -42,7 +42,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress1, - Rehearsal = false, })); // can't transfer coupon that's not mine @@ -55,7 +54,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress2, - Rehearsal = false, })); // can't transfer a coupon to two different people @@ -70,7 +68,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress1, - Rehearsal = false, })); // transfer to self @@ -84,7 +81,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress1, - Rehearsal = false, }); Assert.Equal(expected, state.GetCouponWallet(CouponsFixture.AgentAddress1)); @@ -97,7 +93,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress1, - Rehearsal = false, }); Assert.Equal(expected, state.GetCouponWallet(CouponsFixture.AgentAddress1)); @@ -112,7 +107,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress1, - Rehearsal = false, }); Assert.Equal( expected.Remove(CouponsFixture.Guid1), @@ -132,7 +126,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress1, - Rehearsal = false, })); // multiple transfer @@ -162,7 +155,6 @@ public void Execute() { PreviousState = state, Signer = CouponsFixture.AgentAddress1, - Rehearsal = false, }); Assert.Equal( ImmutableDictionary.Empty, diff --git a/.Lib9c.Tests/Action/DailyReward0Test.cs b/.Lib9c.Tests/Action/DailyReward0Test.cs index 8ee7adf08b..28b3fac50b 100644 --- a/.Lib9c.Tests/Action/DailyReward0Test.cs +++ b/.Lib9c.Tests/Action/DailyReward0Test.cs @@ -65,7 +65,6 @@ public void Execute() { BlockIndex = 0, PreviousState = _initialState, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/DailyReward2Test.cs b/.Lib9c.Tests/Action/DailyReward2Test.cs index aae8b3ccaa..d9fa11a272 100644 --- a/.Lib9c.Tests/Action/DailyReward2Test.cs +++ b/.Lib9c.Tests/Action/DailyReward2Test.cs @@ -68,7 +68,6 @@ public void Execute() BlockIndex = 0, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/DailyReward3Test.cs b/.Lib9c.Tests/Action/DailyReward3Test.cs index 0a299a2594..f107300ff8 100644 --- a/.Lib9c.Tests/Action/DailyReward3Test.cs +++ b/.Lib9c.Tests/Action/DailyReward3Test.cs @@ -68,7 +68,6 @@ public void Execute() BlockIndex = 0, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/DailyReward4Test.cs b/.Lib9c.Tests/Action/DailyReward4Test.cs index 4fa13eb6e7..1ea3a98d08 100644 --- a/.Lib9c.Tests/Action/DailyReward4Test.cs +++ b/.Lib9c.Tests/Action/DailyReward4Test.cs @@ -83,7 +83,6 @@ public void Execute(bool backward) BlockIndex = 0, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/DailyReward5Test.cs b/.Lib9c.Tests/Action/DailyReward5Test.cs index 0fdd70f9ea..0bfc80f725 100644 --- a/.Lib9c.Tests/Action/DailyReward5Test.cs +++ b/.Lib9c.Tests/Action/DailyReward5Test.cs @@ -139,7 +139,6 @@ private IAccount ExecuteInternal(IAccount previousStates, long blockIndex = 0) BlockIndex = blockIndex, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); } diff --git a/.Lib9c.Tests/Action/DailyReward6Test.cs b/.Lib9c.Tests/Action/DailyReward6Test.cs index 1b344d4d82..6835f4054e 100644 --- a/.Lib9c.Tests/Action/DailyReward6Test.cs +++ b/.Lib9c.Tests/Action/DailyReward6Test.cs @@ -164,7 +164,6 @@ private IAccount ExecuteInternal(IAccount previousStates, long blockIndex = 0) BlockIndex = blockIndex, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); } diff --git a/.Lib9c.Tests/Action/DailyRewardTest.cs b/.Lib9c.Tests/Action/DailyRewardTest.cs index d07eac4d56..bbcc161752 100644 --- a/.Lib9c.Tests/Action/DailyRewardTest.cs +++ b/.Lib9c.Tests/Action/DailyRewardTest.cs @@ -163,7 +163,6 @@ private IAccount ExecuteInternal(IAccount previousStates, long blockIndex = 0) BlockIndex = blockIndex, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); } diff --git a/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs b/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs index f3dfd1c6a7..8c9e06f59a 100644 --- a/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs +++ b/.Lib9c.Tests/Action/EventConsumableItemCrafts0Test.cs @@ -156,7 +156,6 @@ private void Execute( PreviousState = previousStates, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/EventDungeonBattleV1Test.cs b/.Lib9c.Tests/Action/EventDungeonBattleV1Test.cs index 4c1204ece2..6ae643a3c0 100644 --- a/.Lib9c.Tests/Action/EventDungeonBattleV1Test.cs +++ b/.Lib9c.Tests/Action/EventDungeonBattleV1Test.cs @@ -418,7 +418,6 @@ private IAccount Execute( PreviousState = previousStates, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/EventDungeonBattleV2Test.cs b/.Lib9c.Tests/Action/EventDungeonBattleV2Test.cs index 685463ec8d..1ce14efbb4 100644 --- a/.Lib9c.Tests/Action/EventDungeonBattleV2Test.cs +++ b/.Lib9c.Tests/Action/EventDungeonBattleV2Test.cs @@ -432,7 +432,6 @@ private IAccount Execute( PreviousState = previousStates, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/EventDungeonBattleV3Test.cs b/.Lib9c.Tests/Action/EventDungeonBattleV3Test.cs index 80969c7e0b..c60a9b1bb0 100644 --- a/.Lib9c.Tests/Action/EventDungeonBattleV3Test.cs +++ b/.Lib9c.Tests/Action/EventDungeonBattleV3Test.cs @@ -431,7 +431,6 @@ private IAccount Execute( PreviousState = previousStates, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/EventDungeonBattleV4Test.cs b/.Lib9c.Tests/Action/EventDungeonBattleV4Test.cs index d19a701981..dcc3ffa847 100644 --- a/.Lib9c.Tests/Action/EventDungeonBattleV4Test.cs +++ b/.Lib9c.Tests/Action/EventDungeonBattleV4Test.cs @@ -479,7 +479,6 @@ private IAccount Execute( PreviousState = previousStates, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/EventDungeonBattleV5Test.cs b/.Lib9c.Tests/Action/EventDungeonBattleV5Test.cs index 9db984f2c1..cfb0c9bd6c 100644 --- a/.Lib9c.Tests/Action/EventDungeonBattleV5Test.cs +++ b/.Lib9c.Tests/Action/EventDungeonBattleV5Test.cs @@ -480,7 +480,6 @@ private IAccount Execute( PreviousState = previousStates, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs b/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs index 3dbd1a3c75..73b093e7ec 100644 --- a/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs +++ b/.Lib9c.Tests/Action/EventMaterialItemCrafts0Test.cs @@ -250,7 +250,6 @@ private void Execute( PreviousState = previousStates, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = blockIndex, }); diff --git a/.Lib9c.Tests/Action/Garages/DeliverToOthersGaragesTest.cs b/.Lib9c.Tests/Action/Garages/DeliverToOthersGaragesTest.cs index fcc560bd4c..f302680934 100644 --- a/.Lib9c.Tests/Action/Garages/DeliverToOthersGaragesTest.cs +++ b/.Lib9c.Tests/Action/Garages/DeliverToOthersGaragesTest.cs @@ -336,7 +336,6 @@ private static (DeliverToOthersGarages action, IAccount nextStates) Execute( { Signer = signer, BlockIndex = blockIndex, - Rehearsal = false, PreviousState = previousState, RandomSeed = random.Seed, })); diff --git a/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs b/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs index 244a09035a..afa3f56fd6 100644 --- a/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs +++ b/.Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs @@ -415,7 +415,6 @@ private static (LoadIntoMyGarages action, IAccount nextStates) Execute( { Signer = signer, BlockIndex = blockIndex, - Rehearsal = false, PreviousState = previousState, RandomSeed = random.Seed, }; diff --git a/.Lib9c.Tests/Action/Garages/UnloadFromMyGaragesTest.cs b/.Lib9c.Tests/Action/Garages/UnloadFromMyGaragesTest.cs index 13625c7a9f..f6db803197 100644 --- a/.Lib9c.Tests/Action/Garages/UnloadFromMyGaragesTest.cs +++ b/.Lib9c.Tests/Action/Garages/UnloadFromMyGaragesTest.cs @@ -344,7 +344,6 @@ private static (UnloadFromMyGarages action, IAccount nextStates) Execute( { Signer = signer, BlockIndex = blockIndex, - Rehearsal = false, PreviousState = previousState, RandomSeed = random.Seed, })); diff --git a/.Lib9c.Tests/Action/HackAndSlash0Test.cs b/.Lib9c.Tests/Action/HackAndSlash0Test.cs index 6c64e632a4..4f5099e874 100644 --- a/.Lib9c.Tests/Action/HackAndSlash0Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash0Test.cs @@ -118,7 +118,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool contains) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -163,7 +162,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); @@ -587,7 +585,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); diff --git a/.Lib9c.Tests/Action/HackAndSlash10Test.cs b/.Lib9c.Tests/Action/HackAndSlash10Test.cs index a05f433b14..cc3cfa3a3b 100644 --- a/.Lib9c.Tests/Action/HackAndSlash10Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash10Test.cs @@ -232,7 +232,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -373,7 +372,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -436,7 +434,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -463,7 +460,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); @@ -892,7 +888,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1056,7 +1051,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId, int playCo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/HackAndSlash11Test.cs b/.Lib9c.Tests/Action/HackAndSlash11Test.cs index 136de735b0..e4ee28fcb7 100644 --- a/.Lib9c.Tests/Action/HackAndSlash11Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash11Test.cs @@ -230,7 +230,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -360,7 +359,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -422,7 +420,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -839,7 +836,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1002,7 +998,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId, int playCo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/HackAndSlash12Test.cs b/.Lib9c.Tests/Action/HackAndSlash12Test.cs index 95c9fe5f39..9c892f5e8e 100644 --- a/.Lib9c.Tests/Action/HackAndSlash12Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash12Test.cs @@ -204,7 +204,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -344,7 +343,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -406,7 +404,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -823,7 +820,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -998,7 +994,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId, int playCo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/HackAndSlash13Test.cs b/.Lib9c.Tests/Action/HackAndSlash13Test.cs index 1194844368..63f71388f0 100644 --- a/.Lib9c.Tests/Action/HackAndSlash13Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash13Test.cs @@ -210,7 +210,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -352,7 +351,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -413,7 +411,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -832,7 +829,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1039,7 +1035,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/HackAndSlash15Test.cs b/.Lib9c.Tests/Action/HackAndSlash15Test.cs index 83f66fe53f..444e561047 100644 --- a/.Lib9c.Tests/Action/HackAndSlash15Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash15Test.cs @@ -206,7 +206,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -348,7 +347,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -409,7 +407,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -804,7 +801,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -980,7 +976,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1130,7 +1125,6 @@ public void CheckCrystalRandomSkillState(bool forceClear, bool skillStateExist, PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); diff --git a/.Lib9c.Tests/Action/HackAndSlash16Test.cs b/.Lib9c.Tests/Action/HackAndSlash16Test.cs index ed94d53d1a..fbcf6f1092 100644 --- a/.Lib9c.Tests/Action/HackAndSlash16Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash16Test.cs @@ -207,7 +207,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -349,7 +348,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -410,7 +408,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -815,7 +812,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1025,7 +1021,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1175,7 +1170,6 @@ public void CheckCrystalRandomSkillState(bool forceClear, bool skillStateExist, PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); diff --git a/.Lib9c.Tests/Action/HackAndSlash17Test.cs b/.Lib9c.Tests/Action/HackAndSlash17Test.cs index 5098b6b8ca..5edba40101 100644 --- a/.Lib9c.Tests/Action/HackAndSlash17Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash17Test.cs @@ -207,7 +207,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -349,7 +348,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -410,7 +408,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -815,7 +812,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1025,7 +1021,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1175,7 +1170,6 @@ public void CheckCrystalRandomSkillState(bool forceClear, bool skillStateExist, PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); diff --git a/.Lib9c.Tests/Action/HackAndSlash18Test.cs b/.Lib9c.Tests/Action/HackAndSlash18Test.cs index 2c7913f005..a21d3551c0 100644 --- a/.Lib9c.Tests/Action/HackAndSlash18Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash18Test.cs @@ -205,7 +205,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -347,7 +346,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -408,7 +406,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -813,7 +810,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1010,7 +1006,6 @@ public void Execute_V100291() PreviousState = initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1119,7 +1114,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1289,7 +1283,6 @@ public void CheckCrystalRandomSkillState( PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1409,7 +1402,6 @@ public void CheckUsedApByStaking(int level, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); diff --git a/.Lib9c.Tests/Action/HackAndSlash19Test.cs b/.Lib9c.Tests/Action/HackAndSlash19Test.cs index b55ba76a8f..7cbcf25b2a 100644 --- a/.Lib9c.Tests/Action/HackAndSlash19Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash19Test.cs @@ -205,7 +205,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -349,7 +348,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -411,7 +409,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -827,7 +824,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1040,7 +1036,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1211,7 +1206,6 @@ public void CheckCrystalRandomSkillState( PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1333,7 +1327,6 @@ public void CheckUsedApByStaking(int level, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); diff --git a/.Lib9c.Tests/Action/HackAndSlash20Test.cs b/.Lib9c.Tests/Action/HackAndSlash20Test.cs index e2d29ceadd..154f5d533a 100644 --- a/.Lib9c.Tests/Action/HackAndSlash20Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash20Test.cs @@ -206,7 +206,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -350,7 +349,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -412,7 +410,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -828,7 +825,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1130,7 +1126,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1301,7 +1296,6 @@ public void CheckCrystalRandomSkillState( PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1423,7 +1417,6 @@ public void CheckUsedApByStaking(int level, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1503,7 +1496,6 @@ public void CheckUsingApStoneWithStaking(int level, int apStoneCount, int totalR PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1650,7 +1642,6 @@ public void ExecuteTwoRepetitions() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -1674,7 +1665,6 @@ public void ExecuteTwoRepetitions() PreviousState = nextState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); } diff --git a/.Lib9c.Tests/Action/HackAndSlash21Test.cs b/.Lib9c.Tests/Action/HackAndSlash21Test.cs index a742a65683..15db05f4fc 100644 --- a/.Lib9c.Tests/Action/HackAndSlash21Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash21Test.cs @@ -207,7 +207,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -351,7 +350,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -413,7 +411,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -829,7 +826,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1131,7 +1127,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1302,7 +1297,6 @@ public void CheckCrystalRandomSkillState( PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1424,7 +1418,6 @@ public void CheckUsedApByStaking(int level, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1504,7 +1497,6 @@ public void CheckUsingApStoneWithStaking(int level, int apStoneCount, int totalR PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); @@ -1651,7 +1643,6 @@ public void ExecuteTwoRepetitions() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -1675,7 +1666,6 @@ public void ExecuteTwoRepetitions() PreviousState = nextState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); } diff --git a/.Lib9c.Tests/Action/HackAndSlash2Test.cs b/.Lib9c.Tests/Action/HackAndSlash2Test.cs index cc18f27730..8852574dd7 100644 --- a/.Lib9c.Tests/Action/HackAndSlash2Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash2Test.cs @@ -120,7 +120,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool contains) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -172,7 +171,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); @@ -596,7 +594,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); diff --git a/.Lib9c.Tests/Action/HackAndSlash3Test.cs b/.Lib9c.Tests/Action/HackAndSlash3Test.cs index a9087c4b87..5803ddeb06 100644 --- a/.Lib9c.Tests/Action/HackAndSlash3Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash3Test.cs @@ -134,7 +134,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool contains) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); diff --git a/.Lib9c.Tests/Action/HackAndSlash4Test.cs b/.Lib9c.Tests/Action/HackAndSlash4Test.cs index b38c565904..d2e5150168 100644 --- a/.Lib9c.Tests/Action/HackAndSlash4Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash4Test.cs @@ -182,7 +182,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool contains) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -261,7 +260,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -324,7 +322,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -353,7 +350,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); diff --git a/.Lib9c.Tests/Action/HackAndSlash5Test.cs b/.Lib9c.Tests/Action/HackAndSlash5Test.cs index c17382bf6b..928e98228d 100644 --- a/.Lib9c.Tests/Action/HackAndSlash5Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash5Test.cs @@ -182,7 +182,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool contains) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -262,7 +261,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -325,7 +323,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -354,7 +351,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); diff --git a/.Lib9c.Tests/Action/HackAndSlash6Test.cs b/.Lib9c.Tests/Action/HackAndSlash6Test.cs index b104abcfd7..f25c495e63 100644 --- a/.Lib9c.Tests/Action/HackAndSlash6Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash6Test.cs @@ -198,7 +198,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool contains, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -278,7 +277,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -341,7 +339,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -370,7 +367,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); diff --git a/.Lib9c.Tests/Action/HackAndSlash7Test.cs b/.Lib9c.Tests/Action/HackAndSlash7Test.cs index 0250496732..ff19531cd7 100644 --- a/.Lib9c.Tests/Action/HackAndSlash7Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash7Test.cs @@ -224,7 +224,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool contains, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -383,7 +382,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -446,7 +444,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -473,7 +470,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); diff --git a/.Lib9c.Tests/Action/HackAndSlash8Test.cs b/.Lib9c.Tests/Action/HackAndSlash8Test.cs index 034c6e71db..c5720fd0d8 100644 --- a/.Lib9c.Tests/Action/HackAndSlash8Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash8Test.cs @@ -230,7 +230,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -379,7 +378,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -441,7 +439,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -467,7 +464,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); diff --git a/.Lib9c.Tests/Action/HackAndSlash9Test.cs b/.Lib9c.Tests/Action/HackAndSlash9Test.cs index 18ba2738db..eddd1289dc 100644 --- a/.Lib9c.Tests/Action/HackAndSlash9Test.cs +++ b/.Lib9c.Tests/Action/HackAndSlash9Test.cs @@ -232,7 +232,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -396,7 +395,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -459,7 +457,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -486,7 +483,6 @@ public void ExecuteThrowInvalidRankingMapAddress() PreviousState = _initialState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }) ); @@ -915,7 +911,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1079,7 +1074,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId, int playCo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/HackAndSlashTest14.cs b/.Lib9c.Tests/Action/HackAndSlashTest14.cs index af79f5af6b..81af3850c0 100644 --- a/.Lib9c.Tests/Action/HackAndSlashTest14.cs +++ b/.Lib9c.Tests/Action/HackAndSlashTest14.cs @@ -197,7 +197,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, bool backward, bo PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -339,7 +338,6 @@ public void MaxLevelTest() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarStateV2(_avatarAddress); @@ -400,7 +398,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, })); SerializeException(exec); @@ -795,7 +792,6 @@ public void ExecuteWithoutPlayCount() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -971,7 +967,6 @@ public void CheckRewardItems(bool backward, int worldId, int stageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -1121,7 +1116,6 @@ public void CheckCrystalRandomSkillState(bool forceClear, bool skillStateExist, PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }; var nextState = action.Execute(ctx); diff --git a/.Lib9c.Tests/Action/JoinArena1Test.cs b/.Lib9c.Tests/Action/JoinArena1Test.cs index f197955dd5..a721dca2ce 100644 --- a/.Lib9c.Tests/Action/JoinArena1Test.cs +++ b/.Lib9c.Tests/Action/JoinArena1Test.cs @@ -221,7 +221,6 @@ public void Execute(long blockIndex, int championshipId, int round, string balan PreviousState = state, Signer = _signer, RandomSeed = _random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -403,7 +402,6 @@ public void Execute_ArenaScoreAlreadyContainsException() PreviousState = state, Signer = _signer, RandomSeed = _random.Seed, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/JoinArena2Test.cs b/.Lib9c.Tests/Action/JoinArena2Test.cs index 8d622408ac..6be17483a0 100644 --- a/.Lib9c.Tests/Action/JoinArena2Test.cs +++ b/.Lib9c.Tests/Action/JoinArena2Test.cs @@ -222,7 +222,6 @@ public void Execute(long blockIndex, int championshipId, int round, string balan PreviousState = state, Signer = _signer, RandomSeed = _random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -409,7 +408,6 @@ public void Execute_ArenaScoreAlreadyContainsException() PreviousState = state, Signer = _signer, RandomSeed = _random.Seed, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/JoinArena3Test.cs b/.Lib9c.Tests/Action/JoinArena3Test.cs index b0b21fde97..1785f2d33d 100644 --- a/.Lib9c.Tests/Action/JoinArena3Test.cs +++ b/.Lib9c.Tests/Action/JoinArena3Test.cs @@ -225,7 +225,6 @@ public void Execute(long blockIndex, int championshipId, int round, string balan PreviousState = state, Signer = _signer, RandomSeed = _random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); @@ -412,7 +411,6 @@ public void Execute_ArenaScoreAlreadyContainsException() PreviousState = state, Signer = _signer, RandomSeed = _random.Seed, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle0Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle0Test.cs index dfd998d6be..79bb52f22c 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle0Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle0Test.cs @@ -169,7 +169,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int clearStageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -259,7 +258,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -494,7 +492,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -584,7 +582,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle10Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle10Test.cs index f4f5c22988..5259f6eaf1 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle10Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle10Test.cs @@ -159,7 +159,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -233,7 +232,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -429,7 +427,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -512,7 +510,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -711,7 +708,6 @@ public void Execute_v100291() PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -821,7 +817,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle11Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle11Test.cs index 82b62d5d05..f826103bd5 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle11Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle11Test.cs @@ -158,7 +158,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -233,7 +232,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -434,7 +432,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -519,7 +517,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -717,7 +714,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle12Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle12Test.cs index 55c0a813d6..e5e9e5d7e0 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle12Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle12Test.cs @@ -165,7 +165,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -240,7 +239,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -441,7 +439,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -526,7 +524,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -724,7 +721,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -854,7 +850,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, })); } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle13Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle13Test.cs index 100cc6a8dd..f0bb910580 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle13Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle13Test.cs @@ -166,7 +166,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, }); @@ -241,7 +240,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -442,7 +440,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -527,7 +525,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -725,7 +722,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -855,7 +851,6 @@ public void ExecuteDuplicatedException(int slotIndex, int runeId, int slotIndex2 PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = ActionObsoleteConfig.V100301ExecutedBlockIndex, })); } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle2Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle2Test.cs index 38cafdaf2d..7445e75fd2 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle2Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle2Test.cs @@ -169,7 +169,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int clearStageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); var nextAvatarState = nextState.GetAvatarState(_avatarAddress); @@ -259,7 +258,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -494,7 +492,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -584,7 +582,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle3Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle3Test.cs index b136b3f99b..ea89b64de1 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle3Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle3Test.cs @@ -169,7 +169,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int clearStageId) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -260,7 +259,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -495,7 +493,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -585,7 +583,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs index 16dbecae07..9a25271149 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle4Test.cs @@ -182,7 +182,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int clearStageId, PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -269,7 +268,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -495,7 +493,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -581,7 +579,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs index 1e0dbf0ad9..3f17b2f013 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle5Test.cs @@ -177,7 +177,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int clearStageId, PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -262,7 +261,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -482,7 +480,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -566,7 +564,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs index 0a07bcdcb9..dd10fb4a00 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle6Test.cs @@ -187,7 +187,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -273,7 +272,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -499,7 +497,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -584,7 +582,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -706,7 +703,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs index 1eae59601a..a0c3eff931 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle7Test.cs @@ -187,7 +187,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -273,7 +272,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -499,7 +497,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -584,7 +582,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -706,7 +703,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs index 5f1a32d5d4..570019c5d1 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle8Test.cs @@ -182,7 +182,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -257,7 +256,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -453,7 +451,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext() { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -536,7 +534,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -657,7 +654,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs b/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs index 519be580bf..75ec852eaf 100644 --- a/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs +++ b/.Lib9c.Tests/Action/MimisbrunnrBattle9Test.cs @@ -158,7 +158,6 @@ public void Execute(int avatarLevel, int worldId, int stageId, int playCount, in PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); @@ -232,7 +231,6 @@ public void ExecuteThrowInvalidStageException() PreviousState = previousState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -428,7 +426,7 @@ public void ExecuteThrowInvalidWorld(int avatarLevel, int worldId, int stageId, { action.Execute(new ActionContext { - PreviousState = state, Signer = _agentAddress, RandomSeed = 0, Rehearsal = false, + PreviousState = state, Signer = _agentAddress, RandomSeed = 0, }); }); } @@ -511,7 +509,6 @@ public void ExecuteEquippableItemValidation() { PreviousState = nextState, Signer = _agentAddress, - Rehearsal = false, RandomSeed = 0, }); } @@ -707,7 +704,6 @@ public void CheckRewardItems(bool backward, int stageIndex, int playCount) PreviousState = state, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, BlockIndex = 1, }); diff --git a/.Lib9c.Tests/Action/PatchTableSheetTest.cs b/.Lib9c.Tests/Action/PatchTableSheetTest.cs index 4da2f7e2b5..e202d047d8 100644 --- a/.Lib9c.Tests/Action/PatchTableSheetTest.cs +++ b/.Lib9c.Tests/Action/PatchTableSheetTest.cs @@ -54,7 +54,6 @@ public void Execute() { BlockIndex = 0, PreviousState = _initialState, - Rehearsal = false, }); var nextWorldSheetCsv = nextState.GetSheetCsv(); @@ -73,7 +72,6 @@ public void Execute() { BlockIndex = 0, PreviousState = _initialState, - Rehearsal = false, }); nextWorldSheet = nextState.GetSheet(); diff --git a/.Lib9c.Tests/Action/PetEnhancement0Test.cs b/.Lib9c.Tests/Action/PetEnhancement0Test.cs index ad523b8783..02cdca6cfa 100644 --- a/.Lib9c.Tests/Action/PetEnhancement0Test.cs +++ b/.Lib9c.Tests/Action/PetEnhancement0Test.cs @@ -379,7 +379,6 @@ private static IAccount Execute( BlockIndex = blockIndex, PreviousState = prevStates, RandomSeed = 0, - Rehearsal = false, Signer = agentAddr, }); var nextNcgBal = nextStates.GetBalance(agentAddr, ncgCurrency); diff --git a/.Lib9c.Tests/Action/Raid1Test.cs b/.Lib9c.Tests/Action/Raid1Test.cs index ed7e5c58bb..f59273bdec 100644 --- a/.Lib9c.Tests/Action/Raid1Test.cs +++ b/.Lib9c.Tests/Action/Raid1Test.cs @@ -213,7 +213,6 @@ long executeOffset BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; @@ -350,7 +349,6 @@ Dictionary rewardMap BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, })); } @@ -463,7 +461,6 @@ Dictionary rewardMap BlockIndex = worldBossRow.StartedBlockIndex + Raid4.RequiredInterval, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }); @@ -561,7 +558,6 @@ public void Execute_Throw_ActionObsoletedException() BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, })); } diff --git a/.Lib9c.Tests/Action/Raid2Test.cs b/.Lib9c.Tests/Action/Raid2Test.cs index 87bc1af9a8..d3fc73659d 100644 --- a/.Lib9c.Tests/Action/Raid2Test.cs +++ b/.Lib9c.Tests/Action/Raid2Test.cs @@ -225,7 +225,6 @@ bool raiderListExist BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; @@ -368,7 +367,6 @@ Dictionary rewardMap BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, })); } @@ -482,7 +480,6 @@ Dictionary rewardMap BlockIndex = worldBossRow.StartedBlockIndex + Raid4.RequiredInterval, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/Raid3Test.cs b/.Lib9c.Tests/Action/Raid3Test.cs index d136b07503..8dab740d7e 100644 --- a/.Lib9c.Tests/Action/Raid3Test.cs +++ b/.Lib9c.Tests/Action/Raid3Test.cs @@ -226,7 +226,6 @@ bool raiderListExist BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; @@ -369,7 +368,6 @@ Dictionary rewardMap BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, })); } @@ -484,7 +482,6 @@ Dictionary rewardMap BlockIndex = worldBossRow.StartedBlockIndex + Raid4.RequiredInterval, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/Raid4Test.cs b/.Lib9c.Tests/Action/Raid4Test.cs index ff3c6d6ec6..919fbecd72 100644 --- a/.Lib9c.Tests/Action/Raid4Test.cs +++ b/.Lib9c.Tests/Action/Raid4Test.cs @@ -247,7 +247,6 @@ int runeId2 BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; @@ -410,7 +409,6 @@ Dictionary rewardMap BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, })); } @@ -525,7 +523,6 @@ Dictionary rewardMap BlockIndex = worldBossRow.StartedBlockIndex + Raid4.RequiredInterval, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }); @@ -626,7 +623,6 @@ public void Execute_With_Free_Crystal_Fee() BlockIndex = blockIndex, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; diff --git a/.Lib9c.Tests/Action/Raid5Test.cs b/.Lib9c.Tests/Action/Raid5Test.cs index 9edb82739d..21fdc1fb65 100644 --- a/.Lib9c.Tests/Action/Raid5Test.cs +++ b/.Lib9c.Tests/Action/Raid5Test.cs @@ -247,7 +247,6 @@ int runeId2 BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; @@ -410,7 +409,6 @@ Dictionary rewardMap BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, })); } @@ -527,7 +525,6 @@ Dictionary rewardMap BlockIndex = worldBossRow.StartedBlockIndex + gameConfigState.WorldBossRequiredInterval, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }); @@ -628,7 +625,6 @@ public void Execute_With_Free_Crystal_Fee() BlockIndex = blockIndex, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; diff --git a/.Lib9c.Tests/Action/Raid6Test.cs b/.Lib9c.Tests/Action/Raid6Test.cs index 50c1cba896..9752e2d93e 100644 --- a/.Lib9c.Tests/Action/Raid6Test.cs +++ b/.Lib9c.Tests/Action/Raid6Test.cs @@ -247,7 +247,6 @@ int runeId2 BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; @@ -410,7 +409,6 @@ Dictionary rewardMap BlockIndex = blockIndex + executeOffset, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, })); } @@ -527,7 +525,6 @@ Dictionary rewardMap BlockIndex = worldBossRow.StartedBlockIndex + gameConfigState.WorldBossRequiredInterval, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }); @@ -628,7 +625,6 @@ public void Execute_With_Free_Crystal_Fee() BlockIndex = blockIndex, PreviousState = state, RandomSeed = randomSeed, - Rehearsal = false, Signer = _agentAddress, }; diff --git a/.Lib9c.Tests/Action/RankingBattle0Test.cs b/.Lib9c.Tests/Action/RankingBattle0Test.cs index 553780f326..55f862cb46 100644 --- a/.Lib9c.Tests/Action/RankingBattle0Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle0Test.cs @@ -135,7 +135,6 @@ public void Execute() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarState(_avatar1Address); @@ -169,7 +168,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -214,7 +212,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -249,7 +246,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -281,7 +277,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -327,7 +322,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException( PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -368,7 +362,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -419,7 +412,6 @@ public void ExecuteThrowNotEnoughFungibleAssetValueException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } diff --git a/.Lib9c.Tests/Action/RankingBattle10Test.cs b/.Lib9c.Tests/Action/RankingBattle10Test.cs index e142848af9..119863a3c9 100644 --- a/.Lib9c.Tests/Action/RankingBattle10Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle10Test.cs @@ -215,7 +215,6 @@ public void Execute(bool isNew, bool avatarBackward, bool enemyBackward) PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarStateV2(_avatar1Address); @@ -269,7 +268,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -313,7 +311,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -347,7 +344,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -378,7 +374,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -411,7 +406,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -451,7 +445,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -506,7 +499,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattle11Test.cs b/.Lib9c.Tests/Action/RankingBattle11Test.cs index 112d594f6f..d7697f8676 100644 --- a/.Lib9c.Tests/Action/RankingBattle11Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle11Test.cs @@ -198,7 +198,6 @@ public void Execute() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, BlockIndex = RankingBattle11.UpdateTargetBlockIndex, }); @@ -340,7 +339,6 @@ public void Execute_Backward_Compatible(bool isNew, bool avatarBackward, bool en PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, BlockIndex = RankingBattle11.UpdateTargetBlockIndex - 1, }); @@ -395,7 +393,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -439,7 +436,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -473,7 +469,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -504,7 +499,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -537,7 +531,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -577,7 +570,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -708,7 +700,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } @@ -744,7 +735,6 @@ public void Execute_ActionObsoletedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } diff --git a/.Lib9c.Tests/Action/RankingBattle2Test.cs b/.Lib9c.Tests/Action/RankingBattle2Test.cs index 72e673c4db..9ce0b1ee24 100644 --- a/.Lib9c.Tests/Action/RankingBattle2Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle2Test.cs @@ -128,7 +128,6 @@ public void Execute() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarState(_avatar1Address); @@ -162,7 +161,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -207,7 +205,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -242,7 +239,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -274,7 +270,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -320,7 +315,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException( PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -361,7 +355,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -383,7 +376,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); diff --git a/.Lib9c.Tests/Action/RankingBattle3Test.cs b/.Lib9c.Tests/Action/RankingBattle3Test.cs index c408f0ba18..22a1762d14 100644 --- a/.Lib9c.Tests/Action/RankingBattle3Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle3Test.cs @@ -128,7 +128,6 @@ public void Execute() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarState(_avatar1Address); @@ -162,7 +161,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -207,7 +205,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -242,7 +239,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -274,7 +270,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -320,7 +315,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException( PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -361,7 +355,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -383,7 +376,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); @@ -448,7 +440,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattle4Test.cs b/.Lib9c.Tests/Action/RankingBattle4Test.cs index 3a1946b652..0dc6e03d9e 100644 --- a/.Lib9c.Tests/Action/RankingBattle4Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle4Test.cs @@ -165,7 +165,6 @@ public void Execute(bool isNew) PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarState(_avatar1Address); @@ -198,7 +197,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -243,7 +241,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -278,7 +275,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -310,7 +306,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -344,7 +339,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -385,7 +379,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -407,7 +400,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); @@ -472,7 +464,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattle5Test.cs b/.Lib9c.Tests/Action/RankingBattle5Test.cs index 31eb8a4b63..dd5c069bfd 100644 --- a/.Lib9c.Tests/Action/RankingBattle5Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle5Test.cs @@ -195,7 +195,6 @@ public void Execute(bool isNew, bool avatarBackward, bool enemyBackward) PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarStateV2(_avatar1Address); @@ -228,7 +227,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -273,7 +271,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -308,7 +305,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -340,7 +336,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -374,7 +369,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -415,7 +409,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -437,7 +430,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); @@ -502,7 +494,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattle6Test.cs b/.Lib9c.Tests/Action/RankingBattle6Test.cs index 870870629d..201e7d5817 100644 --- a/.Lib9c.Tests/Action/RankingBattle6Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle6Test.cs @@ -195,7 +195,6 @@ public void Execute(bool isNew, bool avatarBackward, bool enemyBackward) PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarStateV2(_avatar1Address); @@ -228,7 +227,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -273,7 +271,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -308,7 +305,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -340,7 +336,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -374,7 +369,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -415,7 +409,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -437,7 +430,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); @@ -502,7 +494,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattle7Test.cs b/.Lib9c.Tests/Action/RankingBattle7Test.cs index 6a28b39206..c546d71d8b 100644 --- a/.Lib9c.Tests/Action/RankingBattle7Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle7Test.cs @@ -195,7 +195,6 @@ public void Execute(bool isNew, bool avatarBackward, bool enemyBackward) PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarStateV2(_avatar1Address); @@ -228,7 +227,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -273,7 +271,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -308,7 +305,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -340,7 +336,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -374,7 +369,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -415,7 +409,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -437,7 +430,6 @@ public void SerializeWithDotnetAPI() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var formatter = new BinaryFormatter(); @@ -502,7 +494,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattle8Test.cs b/.Lib9c.Tests/Action/RankingBattle8Test.cs index f8c710ad08..bd13678a09 100644 --- a/.Lib9c.Tests/Action/RankingBattle8Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle8Test.cs @@ -210,7 +210,6 @@ public void Execute(bool isNew, bool avatarBackward, bool enemyBackward) PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarStateV2(_avatar1Address); @@ -265,7 +264,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -310,7 +308,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -345,7 +342,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -377,7 +373,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -411,7 +406,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -452,7 +446,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -510,7 +503,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattle9Test.cs b/.Lib9c.Tests/Action/RankingBattle9Test.cs index 181bf157ce..93a53b6678 100644 --- a/.Lib9c.Tests/Action/RankingBattle9Test.cs +++ b/.Lib9c.Tests/Action/RankingBattle9Test.cs @@ -210,7 +210,6 @@ public void Execute(bool isNew, bool avatarBackward, bool enemyBackward) PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); var nextAvatar1State = nextState.GetAvatarStateV2(_avatar1Address); @@ -265,7 +264,6 @@ public void ExecuteThrowInvalidAddressException() PreviousState = _initialState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -310,7 +308,6 @@ public void ExecuteThrowFailedLoadStateException(int caseIndex) PreviousState = _initialState, Signer = signer, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -345,7 +342,6 @@ public void ExecuteThrowNotEnoughClearedStageLevelException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -377,7 +373,6 @@ public void ExecuteThrowWeeklyArenaStateAlreadyEndedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -411,7 +406,6 @@ public void ExecuteThrowWeeklyArenaStateNotContainsAvatarAddressException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -452,7 +446,6 @@ public void ExecuteThrowNotEnoughWeeklyArenaChallengeCountException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } @@ -510,7 +503,6 @@ public void MultipleEquipmentTest(ItemSubType type, int maxCount) PreviousState = state, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, })); } } diff --git a/.Lib9c.Tests/Action/RankingBattleTest.cs b/.Lib9c.Tests/Action/RankingBattleTest.cs index 9ad2abc37a..febeefe51f 100644 --- a/.Lib9c.Tests/Action/RankingBattleTest.cs +++ b/.Lib9c.Tests/Action/RankingBattleTest.cs @@ -170,7 +170,6 @@ public void ExecuteActionObsoletedException() PreviousState = previousState, Signer = _agent1Address, RandomSeed = 0, - Rehearsal = false, }); }); } diff --git a/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs b/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs index 65d5c1566d..6b47b8b1c0 100644 --- a/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs +++ b/.Lib9c.Tests/Action/ReRegisterProduct0Test.cs @@ -236,7 +236,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); @@ -283,7 +282,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/ReRegisterProductTest.cs b/.Lib9c.Tests/Action/ReRegisterProductTest.cs index f240de2b79..b6c24e1f35 100644 --- a/.Lib9c.Tests/Action/ReRegisterProductTest.cs +++ b/.Lib9c.Tests/Action/ReRegisterProductTest.cs @@ -236,7 +236,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); @@ -283,7 +282,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/RedeemCode0Test.cs b/.Lib9c.Tests/Action/RedeemCode0Test.cs index 1e3cb7bb37..55bc786645 100644 --- a/.Lib9c.Tests/Action/RedeemCode0Test.cs +++ b/.Lib9c.Tests/Action/RedeemCode0Test.cs @@ -93,7 +93,6 @@ public void Execute() BlockIndex = 1, Miner = default, PreviousState = initialState, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/RedeemCodeTest.cs b/.Lib9c.Tests/Action/RedeemCodeTest.cs index 63a732fa1e..d84c25057f 100644 --- a/.Lib9c.Tests/Action/RedeemCodeTest.cs +++ b/.Lib9c.Tests/Action/RedeemCodeTest.cs @@ -108,7 +108,6 @@ public void Execute(bool backward) BlockIndex = 1, Miner = default, PreviousState = initialState, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/RuneEnhancement0Test.cs b/.Lib9c.Tests/Action/RuneEnhancement0Test.cs index 70db188fcc..47055e7b09 100644 --- a/.Lib9c.Tests/Action/RuneEnhancement0Test.cs +++ b/.Lib9c.Tests/Action/RuneEnhancement0Test.cs @@ -120,7 +120,6 @@ public void Execute(int seed) BlockIndex = blockIndex, PreviousState = state, RandomSeed = rand.Seed, - Rehearsal = false, Signer = agentAddress, }; @@ -384,7 +383,6 @@ public void Execute_NotEnoughFungibleAssetValueException(bool ncg, bool crystal, BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = agentAddress, }; diff --git a/.Lib9c.Tests/Action/RuneEnhancementTest.cs b/.Lib9c.Tests/Action/RuneEnhancementTest.cs index 48bdd085f4..5da3892af3 100644 --- a/.Lib9c.Tests/Action/RuneEnhancementTest.cs +++ b/.Lib9c.Tests/Action/RuneEnhancementTest.cs @@ -130,7 +130,6 @@ public void Execute(int seed) BlockIndex = blockIndex, PreviousState = state, RandomSeed = rand.Seed, - Rehearsal = false, Signer = agentAddress, }; @@ -421,7 +420,6 @@ public void Execute_NotEnoughFungibleAssetValueException(bool ncg, bool crystal, BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = agentAddress, }; diff --git a/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs index 4ba7592809..3124435899 100644 --- a/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs @@ -116,7 +116,6 @@ public IAccount JoinArena( PreviousState = _state, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = roundData.StartBlockIndex, }); return _state; @@ -147,7 +146,6 @@ public IAccount BattleArena( PreviousState = _state, Signer = signer, RandomSeed = random.Seed, - Rehearsal = false, BlockIndex = blockIndex, }); return _state; diff --git a/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs b/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs index 55dfd1d9cd..bd451a4d3a 100644 --- a/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs +++ b/.Lib9c.Tests/Action/Scenario/SellAndCancellationAndSellTest.cs @@ -114,7 +114,6 @@ public void Execute_With_TradableMaterial() PreviousState = nextStates, BlockIndex = sellBlockIndex, RandomSeed = random.Seed, - Rehearsal = false, }); // TODO: Check state.. inventory, orders.. } @@ -142,7 +141,6 @@ public void Execute_With_TradableMaterial() PreviousState = nextStates, BlockIndex = sellBlockIndex + 1L, RandomSeed = random.Seed, - Rehearsal = false, }); // TODO: Check state.. inventory, orders.. } @@ -163,7 +161,6 @@ public void Execute_With_TradableMaterial() PreviousState = nextStates, BlockIndex = sellBlockIndex + 2L, RandomSeed = random.Seed, - Rehearsal = false, }); // Check inventory does not have ap stones. diff --git a/.Lib9c.Tests/Action/Scenario/StakeAndClaimScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/StakeAndClaimScenarioTest.cs index 593b1eb321..58e7d5d213 100644 --- a/.Lib9c.Tests/Action/Scenario/StakeAndClaimScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/StakeAndClaimScenarioTest.cs @@ -165,7 +165,6 @@ private static IAccount MintAsset( PreviousState = state, Signer = Addresses.Admin, BlockIndex = blockIndex, - Rehearsal = false, }, recipient, amount); @@ -183,7 +182,6 @@ private static IAccount Stake2( PreviousState = state, Signer = agentAddr, BlockIndex = blockIndex, - Rehearsal = false, }); } @@ -199,7 +197,6 @@ private static IAccount Stake3( PreviousState = state, Signer = agentAddr, BlockIndex = blockIndex, - Rehearsal = false, }); } @@ -215,7 +212,6 @@ private static IAccount ClaimStakeReward9( PreviousState = state, Signer = agentAddr, BlockIndex = blockIndex, - Rehearsal = false, }); } diff --git a/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs b/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs index 2b6d632135..e6b09e6584 100644 --- a/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs +++ b/.Lib9c.Tests/Action/Scenario/WorldUnlockScenarioTest.cs @@ -106,7 +106,6 @@ public void UnlockWorldByHackAndSlashAfterPatchTableWithAddRow( PreviousState = nextState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); Assert.True(hackAndSlash.Result.IsClear); @@ -138,7 +137,6 @@ public void UnlockWorldByHackAndSlashAfterPatchTableWithAddRow( PreviousState = nextState, Signer = AdminState.Address, RandomSeed = 0, - Rehearsal = false, }); var nextTableCsv = nextState.GetSheetCsv(); @@ -149,7 +147,6 @@ public void UnlockWorldByHackAndSlashAfterPatchTableWithAddRow( PreviousState = nextState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); Assert.True(hackAndSlash.Result.IsClear); @@ -228,7 +225,6 @@ public void UnlockWorldByMimisbrunnrBattleAfterPatchTableWithChangeRow( PreviousState = nextState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); }); @@ -248,7 +244,6 @@ public void UnlockWorldByMimisbrunnrBattleAfterPatchTableWithChangeRow( PreviousState = nextState, Signer = AdminState.Address, RandomSeed = 0, - Rehearsal = false, }); var nextTableCsv = nextState.GetSheetCsv(); @@ -259,7 +254,6 @@ public void UnlockWorldByMimisbrunnrBattleAfterPatchTableWithChangeRow( PreviousState = nextState, Signer = _agentAddress, RandomSeed = 0, - Rehearsal = false, }); avatarState = nextState.GetAvatarState(_avatarAddress); diff --git a/.Lib9c.Tests/Action/SecureMiningRewardTest.cs b/.Lib9c.Tests/Action/SecureMiningRewardTest.cs index 7e4c49c1da..7b62d3eb87 100644 --- a/.Lib9c.Tests/Action/SecureMiningRewardTest.cs +++ b/.Lib9c.Tests/Action/SecureMiningRewardTest.cs @@ -51,7 +51,6 @@ public void Execute() { PreviousState = _previousState, Signer = _admin, - Rehearsal = false, BlockIndex = 1, } ); @@ -81,7 +80,6 @@ public void Execute_InvalidSigner() { PreviousState = _previousState, Signer = invalidSigner, - Rehearsal = false, BlockIndex = 1, } )); diff --git a/.Lib9c.Tests/Action/Sell0Test.cs b/.Lib9c.Tests/Action/Sell0Test.cs index 50dff16b74..b7f0d18c84 100644 --- a/.Lib9c.Tests/Action/Sell0Test.cs +++ b/.Lib9c.Tests/Action/Sell0Test.cs @@ -104,7 +104,6 @@ public void Execute() { BlockIndex = 0, PreviousState = _initialState, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell10Test.cs b/.Lib9c.Tests/Action/Sell10Test.cs index 16819ff046..5def9fb2da 100644 --- a/.Lib9c.Tests/Action/Sell10Test.cs +++ b/.Lib9c.Tests/Action/Sell10Test.cs @@ -164,7 +164,6 @@ bool backward { BlockIndex = blockIndex, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell11Test.cs b/.Lib9c.Tests/Action/Sell11Test.cs index 3fa8503515..d1d21d35b3 100644 --- a/.Lib9c.Tests/Action/Sell11Test.cs +++ b/.Lib9c.Tests/Action/Sell11Test.cs @@ -164,7 +164,6 @@ bool backward { BlockIndex = blockIndex, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell2Test.cs b/.Lib9c.Tests/Action/Sell2Test.cs index b79719436b..7bc01797c6 100644 --- a/.Lib9c.Tests/Action/Sell2Test.cs +++ b/.Lib9c.Tests/Action/Sell2Test.cs @@ -121,7 +121,6 @@ public void Execute() { BlockIndex = 0, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, }; ctx.SetRandom(random); diff --git a/.Lib9c.Tests/Action/Sell3Test.cs b/.Lib9c.Tests/Action/Sell3Test.cs index eef9d02c12..f0fbadbf8c 100644 --- a/.Lib9c.Tests/Action/Sell3Test.cs +++ b/.Lib9c.Tests/Action/Sell3Test.cs @@ -132,7 +132,6 @@ public void Execute() { BlockIndex = 0, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, }; ctx.SetRandom(random); diff --git a/.Lib9c.Tests/Action/Sell4Test.cs b/.Lib9c.Tests/Action/Sell4Test.cs index 1ca54164df..5ce3774e5d 100644 --- a/.Lib9c.Tests/Action/Sell4Test.cs +++ b/.Lib9c.Tests/Action/Sell4Test.cs @@ -159,7 +159,6 @@ public void Execute(ItemType itemType, bool shopItemExist, int blockIndex) { BlockIndex = 1, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell5Test.cs b/.Lib9c.Tests/Action/Sell5Test.cs index b574dd77e9..233c895b5a 100644 --- a/.Lib9c.Tests/Action/Sell5Test.cs +++ b/.Lib9c.Tests/Action/Sell5Test.cs @@ -179,7 +179,6 @@ int expectedProductsCount { BlockIndex = 1, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell6Test.cs b/.Lib9c.Tests/Action/Sell6Test.cs index d251e64b7b..6d44b68007 100644 --- a/.Lib9c.Tests/Action/Sell6Test.cs +++ b/.Lib9c.Tests/Action/Sell6Test.cs @@ -180,7 +180,6 @@ int expectedProductsCount { BlockIndex = 1, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); @@ -511,7 +510,6 @@ public void Execute_20210604( { BlockIndex = blockIndex, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell7Test.cs b/.Lib9c.Tests/Action/Sell7Test.cs index 8db0beadec..ec0116f05b 100644 --- a/.Lib9c.Tests/Action/Sell7Test.cs +++ b/.Lib9c.Tests/Action/Sell7Test.cs @@ -194,7 +194,6 @@ bool backward { BlockIndex = blockIndex, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell8Test.cs b/.Lib9c.Tests/Action/Sell8Test.cs index 04299495e2..729daedac7 100644 --- a/.Lib9c.Tests/Action/Sell8Test.cs +++ b/.Lib9c.Tests/Action/Sell8Test.cs @@ -194,7 +194,6 @@ bool backward { BlockIndex = blockIndex, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/Sell9Test.cs b/.Lib9c.Tests/Action/Sell9Test.cs index 295387c8d3..5114be1926 100644 --- a/.Lib9c.Tests/Action/Sell9Test.cs +++ b/.Lib9c.Tests/Action/Sell9Test.cs @@ -164,7 +164,6 @@ bool backward { BlockIndex = blockIndex, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/SellCancellation0Test.cs b/.Lib9c.Tests/Action/SellCancellation0Test.cs index 0671a7cbfc..84043434ba 100644 --- a/.Lib9c.Tests/Action/SellCancellation0Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation0Test.cs @@ -105,7 +105,6 @@ public void Execute() BlockIndex = 0, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/SellCancellation2Test.cs b/.Lib9c.Tests/Action/SellCancellation2Test.cs index ceeb631054..f1fdad4622 100644 --- a/.Lib9c.Tests/Action/SellCancellation2Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation2Test.cs @@ -122,7 +122,6 @@ public void Execute() BlockIndex = 0, PreviousState = _initialState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/SellCancellation3Test.cs b/.Lib9c.Tests/Action/SellCancellation3Test.cs index 1a22e15913..973836b275 100644 --- a/.Lib9c.Tests/Action/SellCancellation3Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation3Test.cs @@ -132,7 +132,6 @@ public void Execute() BlockIndex = 0, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); productsCount--; @@ -162,7 +161,6 @@ public void Execute() BlockIndex = 0, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); productsCount--; diff --git a/.Lib9c.Tests/Action/SellCancellation4Test.cs b/.Lib9c.Tests/Action/SellCancellation4Test.cs index ed27848efa..15c09841de 100644 --- a/.Lib9c.Tests/Action/SellCancellation4Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation4Test.cs @@ -132,7 +132,6 @@ public void Execute() BlockIndex = 0, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); productsCount--; @@ -162,7 +161,6 @@ public void Execute() BlockIndex = 0, PreviousState = previousStates, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); productsCount--; diff --git a/.Lib9c.Tests/Action/SellCancellation5Test.cs b/.Lib9c.Tests/Action/SellCancellation5Test.cs index 9630218640..ba3ba8a171 100644 --- a/.Lib9c.Tests/Action/SellCancellation5Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation5Test.cs @@ -159,7 +159,6 @@ public void Execute(ItemType itemType, string guid, bool contain) BlockIndex = 1, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/SellCancellation6Test.cs b/.Lib9c.Tests/Action/SellCancellation6Test.cs index d92b37378f..7b7a35511e 100644 --- a/.Lib9c.Tests/Action/SellCancellation6Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation6Test.cs @@ -194,7 +194,6 @@ public void Execute(ItemType itemType, string guid, bool contain, int itemCount, BlockIndex = 1, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/SellCancellation7Test.cs b/.Lib9c.Tests/Action/SellCancellation7Test.cs index e7ff546836..625c885a7b 100644 --- a/.Lib9c.Tests/Action/SellCancellation7Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation7Test.cs @@ -228,7 +228,6 @@ bool backward BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/SellCancellation8Test.cs b/.Lib9c.Tests/Action/SellCancellation8Test.cs index f44991a04d..560e578e96 100644 --- a/.Lib9c.Tests/Action/SellCancellation8Test.cs +++ b/.Lib9c.Tests/Action/SellCancellation8Test.cs @@ -230,7 +230,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); @@ -640,7 +639,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/SellCancellationTest.cs b/.Lib9c.Tests/Action/SellCancellationTest.cs index 97c76c6170..dd76f90c64 100644 --- a/.Lib9c.Tests/Action/SellCancellationTest.cs +++ b/.Lib9c.Tests/Action/SellCancellationTest.cs @@ -234,7 +234,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); @@ -262,7 +261,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); @@ -675,7 +673,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/SellTest.cs b/.Lib9c.Tests/Action/SellTest.cs index 22255b68fd..f4cadd30de 100644 --- a/.Lib9c.Tests/Action/SellTest.cs +++ b/.Lib9c.Tests/Action/SellTest.cs @@ -163,7 +163,6 @@ bool backward { BlockIndex = blockIndex, PreviousState = previousStates, - Rehearsal = false, Signer = _agentAddress, RandomSeed = 0, }); diff --git a/.Lib9c.Tests/Action/StakeTest.cs b/.Lib9c.Tests/Action/StakeTest.cs index 61652ce59a..7306545b93 100644 --- a/.Lib9c.Tests/Action/StakeTest.cs +++ b/.Lib9c.Tests/Action/StakeTest.cs @@ -491,7 +491,6 @@ private IAccount Execute( BlockIndex = blockIndex, PreviousState = previousState, RandomSeed = random.Seed, - Rehearsal = false, Signer = signer, }); diff --git a/.Lib9c.Tests/Action/TransferAsset2Test.cs b/.Lib9c.Tests/Action/TransferAsset2Test.cs index e3257f6ce7..e0c1318ed8 100644 --- a/.Lib9c.Tests/Action/TransferAsset2Test.cs +++ b/.Lib9c.Tests/Action/TransferAsset2Test.cs @@ -61,7 +61,6 @@ public void Execute() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -89,7 +88,6 @@ public void ExecuteWithInvalidSigner() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -117,7 +115,6 @@ public void ExecuteWithInvalidRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -127,7 +124,6 @@ public void ExecuteWithInvalidRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 380001, }); }); @@ -155,7 +151,6 @@ public void ExecuteWithInsufficientBalance() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -183,7 +178,6 @@ public void ExecuteWithMinterAsSender() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -215,7 +209,6 @@ public void ExecuteWithMinterAsRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -246,7 +239,6 @@ public void ExecuteWithUnactivatedRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -348,7 +340,6 @@ public void CheckObsolete() { PreviousState = new Account(MockState.Empty), Signer = _sender, - Rehearsal = false, BlockIndex = TransferAsset3.CrystalTransferringRestrictionStartIndex, }); }); diff --git a/.Lib9c.Tests/Action/TransferAsset3Test.cs b/.Lib9c.Tests/Action/TransferAsset3Test.cs index 00e49e17d9..94e43475cb 100644 --- a/.Lib9c.Tests/Action/TransferAsset3Test.cs +++ b/.Lib9c.Tests/Action/TransferAsset3Test.cs @@ -87,7 +87,6 @@ public void Execute(bool activate, bool legacyActivate, bool stateExist) { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -115,7 +114,6 @@ public void ExecuteWithInvalidSigner() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -147,7 +145,6 @@ public void ExecuteWithInvalidRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -176,7 +173,6 @@ public void ExecuteWithInsufficientBalance() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -205,7 +201,6 @@ public void ExecuteWithMinterAsSender() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -238,7 +233,6 @@ public void ExecuteWithMinterAsRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -269,7 +263,6 @@ public void ExecuteWithUnactivatedRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -341,7 +334,6 @@ public void Execute_Throw_InvalidTransferCurrencyException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = TransferAsset3.CrystalTransferringRestrictionStartIndex, })); } diff --git a/.Lib9c.Tests/Action/TransferAsset4Test.cs b/.Lib9c.Tests/Action/TransferAsset4Test.cs index 089638deef..608685e4d1 100644 --- a/.Lib9c.Tests/Action/TransferAsset4Test.cs +++ b/.Lib9c.Tests/Action/TransferAsset4Test.cs @@ -63,7 +63,6 @@ public void Execute() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -92,7 +91,6 @@ public void Execute_Throw_InvalidTransferSignerException() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -122,7 +120,6 @@ public void Execute_Throw_InvalidTransferRecipientException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -151,7 +148,6 @@ public void Execute_Throw_InsufficientBalanceException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -187,7 +183,6 @@ public void Execute_Throw_InvalidTransferMinterException(bool minterAsSender) { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -262,7 +257,6 @@ public void Execute_Throw_InvalidTransferCurrencyException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = TransferAsset3.CrystalTransferringRestrictionStartIndex, })); } diff --git a/.Lib9c.Tests/Action/TransferAssetTest.cs b/.Lib9c.Tests/Action/TransferAssetTest.cs index 9b8ed9a1f1..84b5f6548e 100644 --- a/.Lib9c.Tests/Action/TransferAssetTest.cs +++ b/.Lib9c.Tests/Action/TransferAssetTest.cs @@ -66,7 +66,6 @@ public void Execute() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -95,7 +94,6 @@ public void Execute_Throw_InvalidTransferSignerException() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -125,7 +123,6 @@ public void Execute_Throw_InvalidTransferRecipientException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -154,7 +151,6 @@ public void Execute_Throw_InsufficientBalanceException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -190,7 +186,6 @@ public void Execute_Throw_InvalidTransferMinterException(bool minterAsSender) { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -265,7 +260,6 @@ public void Execute_Throw_InvalidTransferCurrencyException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = TransferAsset3.CrystalTransferringRestrictionStartIndex, })); } @@ -306,7 +300,6 @@ public void Execute_Throw_ArgumentException() StakeState.DeriveAddress(_recipient), new StakeState(StakeState.DeriveAddress(_recipient), 0).SerializeV2()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); Assert.Throws("recipient", () => action.Execute(new ActionContext() @@ -322,7 +315,6 @@ public void Execute_Throw_ArgumentException() 201600), 0).Serialize()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); Assert.Throws("recipient", () => action.Execute(new ActionContext() @@ -336,7 +328,6 @@ public void Execute_Throw_ArgumentException() 0) .Serialize()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); var monsterCollectionRewardSheet = new MonsterCollectionRewardSheet(); @@ -354,7 +345,6 @@ public void Execute_Throw_ArgumentException() monsterCollectionRewardSheet) .Serialize()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); } diff --git a/.Lib9c.Tests/Action/TransferAssetTest0.cs b/.Lib9c.Tests/Action/TransferAssetTest0.cs index 791fd24ff2..46cfb33ed6 100644 --- a/.Lib9c.Tests/Action/TransferAssetTest0.cs +++ b/.Lib9c.Tests/Action/TransferAssetTest0.cs @@ -59,7 +59,6 @@ public void Execute() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -87,7 +86,6 @@ public void ExecuteWithInvalidSigner() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -115,7 +113,6 @@ public void ExecuteWithInvalidRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -125,7 +122,6 @@ public void ExecuteWithInvalidRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 380001, }); }); @@ -153,7 +149,6 @@ public void ExecuteWithInsufficientBalance() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -181,7 +176,6 @@ public void ExecuteWithMinterAsSender() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -213,7 +207,6 @@ public void ExecuteWithMinterAsRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); diff --git a/.Lib9c.Tests/Action/TransferAssets0Test.cs b/.Lib9c.Tests/Action/TransferAssets0Test.cs index 66d9189372..674d5402f9 100644 --- a/.Lib9c.Tests/Action/TransferAssets0Test.cs +++ b/.Lib9c.Tests/Action/TransferAssets0Test.cs @@ -111,7 +111,6 @@ public void Execute(bool activate, bool legacyActivate, bool stateExist) { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -142,7 +141,6 @@ public void ExecuteWithInvalidSigner() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -173,7 +171,6 @@ public void ExecuteWithInvalidRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -204,7 +201,6 @@ public void ExecuteWithInsufficientBalance() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -235,7 +231,6 @@ public void ExecuteWithMinterAsSender() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -270,7 +265,6 @@ public void ExecuteWithMinterAsRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -303,7 +297,6 @@ public void ExecuteWithUnactivatedRecipient() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -427,7 +420,6 @@ public void Execute_Throw_ArgumentOutOfRangeException() { PreviousState = new Account(MockState.Empty), Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -453,7 +445,6 @@ public void Execute_Throw_InvalidTransferCurrencyException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = TransferAsset3.CrystalTransferringRestrictionStartIndex, })); } diff --git a/.Lib9c.Tests/Action/TransferAssets2Test.cs b/.Lib9c.Tests/Action/TransferAssets2Test.cs index 0573f40501..68d41a8760 100644 --- a/.Lib9c.Tests/Action/TransferAssets2Test.cs +++ b/.Lib9c.Tests/Action/TransferAssets2Test.cs @@ -82,7 +82,6 @@ public void Execute() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -115,7 +114,6 @@ public void Execute_Throw_InvalidTransferSignerException() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -146,7 +144,6 @@ public void Execute_Throw_InvalidTransferRecipientException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -177,7 +174,6 @@ public void Execute_Throw_InsufficientBalanceException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -211,7 +207,6 @@ public void Execute_Throw_InvalidTransferMinterException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -337,7 +332,6 @@ public void Execute_Throw_ArgumentOutOfRangeException() { PreviousState = new Account(MockState.Empty), Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -363,7 +357,6 @@ public void Execute_Throw_InvalidTransferCurrencyException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = TransferAsset3.CrystalTransferringRestrictionStartIndex, })); } diff --git a/.Lib9c.Tests/Action/TransferAssetsTest.cs b/.Lib9c.Tests/Action/TransferAssetsTest.cs index 89757df3de..6cc584fb57 100644 --- a/.Lib9c.Tests/Action/TransferAssetsTest.cs +++ b/.Lib9c.Tests/Action/TransferAssetsTest.cs @@ -84,7 +84,6 @@ public void Execute() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); @@ -117,7 +116,6 @@ public void Execute_Throw_InvalidTransferSignerException() PreviousState = prevState, // 송금자가 직접 사인하지 않으면 실패해야 합니다. Signer = _recipient, - Rehearsal = false, BlockIndex = 1, }); }); @@ -148,7 +146,6 @@ public void Execute_Throw_InvalidTransferRecipientException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -179,7 +176,6 @@ public void Execute_Throw_InsufficientBalanceException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -213,7 +209,6 @@ public void Execute_Throw_InvalidTransferMinterException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -339,7 +334,6 @@ public void Execute_Throw_ArgumentOutOfRangeException() { PreviousState = new Account(MockState.Empty), Signer = _sender, - Rehearsal = false, BlockIndex = 1, }); }); @@ -365,7 +359,6 @@ public void Execute_Throw_InvalidTransferCurrencyException() { PreviousState = prevState, Signer = _sender, - Rehearsal = false, BlockIndex = TransferAsset3.CrystalTransferringRestrictionStartIndex, })); } @@ -392,7 +385,6 @@ public void Execute_Throw_ArgumentException() StakeState.DeriveAddress(_recipient), new StakeState(StakeState.DeriveAddress(_recipient), 0).SerializeV2()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); Assert.Throws("recipient", () => action.Execute(new ActionContext() @@ -408,7 +400,6 @@ public void Execute_Throw_ArgumentException() 201600), 0).Serialize()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); Assert.Throws("recipient", () => action.Execute(new ActionContext() @@ -422,7 +413,6 @@ public void Execute_Throw_ArgumentException() 0) .Serialize()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); var monsterCollectionRewardSheet = new MonsterCollectionRewardSheet(); @@ -440,7 +430,6 @@ public void Execute_Throw_ArgumentException() monsterCollectionRewardSheet) .Serialize()), Signer = _sender, - Rehearsal = false, BlockIndex = 1, })); } diff --git a/.Lib9c.Tests/Action/UnlockRuneSlotTest.cs b/.Lib9c.Tests/Action/UnlockRuneSlotTest.cs index 75a7067495..2a0b436548 100644 --- a/.Lib9c.Tests/Action/UnlockRuneSlotTest.cs +++ b/.Lib9c.Tests/Action/UnlockRuneSlotTest.cs @@ -79,7 +79,6 @@ public void Execute(int slotIndex) BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = agentAddress, }; @@ -130,7 +129,6 @@ public void Execute_InsufficientBalanceException() BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = agentAddress, }; @@ -159,7 +157,6 @@ public void Execute_SlotNotFoundException() BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = agentAddress, }; @@ -188,7 +185,6 @@ public void Execute_MismatchRuneSlotTypeException() BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = agentAddress, }; @@ -221,7 +217,6 @@ public void Execute_SlotIsAlreadyUnlockedException() BlockIndex = blockIndex, PreviousState = state, RandomSeed = 0, - Rehearsal = false, Signer = agentAddress, }; diff --git a/.Lib9c.Tests/Action/UpdateSell0Test.cs b/.Lib9c.Tests/Action/UpdateSell0Test.cs index e3f2e64780..318f2e60b3 100644 --- a/.Lib9c.Tests/Action/UpdateSell0Test.cs +++ b/.Lib9c.Tests/Action/UpdateSell0Test.cs @@ -245,7 +245,6 @@ bool legacy BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/UpdateSell2Test.cs b/.Lib9c.Tests/Action/UpdateSell2Test.cs index d6161ae5e9..8fba2d6733 100644 --- a/.Lib9c.Tests/Action/UpdateSell2Test.cs +++ b/.Lib9c.Tests/Action/UpdateSell2Test.cs @@ -226,7 +226,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/UpdateSell3Test.cs b/.Lib9c.Tests/Action/UpdateSell3Test.cs index 0777a5f5e9..dfe27a77c9 100644 --- a/.Lib9c.Tests/Action/UpdateSell3Test.cs +++ b/.Lib9c.Tests/Action/UpdateSell3Test.cs @@ -232,7 +232,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/UpdateSell4Test.cs b/.Lib9c.Tests/Action/UpdateSell4Test.cs index 592c900be5..af62a0356a 100644 --- a/.Lib9c.Tests/Action/UpdateSell4Test.cs +++ b/.Lib9c.Tests/Action/UpdateSell4Test.cs @@ -232,7 +232,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/Action/UpdateSellTest.cs b/.Lib9c.Tests/Action/UpdateSellTest.cs index 7ba922a1c3..d93344e537 100644 --- a/.Lib9c.Tests/Action/UpdateSellTest.cs +++ b/.Lib9c.Tests/Action/UpdateSellTest.cs @@ -232,7 +232,6 @@ bool fromPreviousAction BlockIndex = 101, PreviousState = prevState, RandomSeed = 0, - Rehearsal = false, Signer = _agentAddress, }); diff --git a/.Lib9c.Tests/TestHelper/BlockChainHelper.cs b/.Lib9c.Tests/TestHelper/BlockChainHelper.cs index eddde7d10d..2eb854727b 100644 --- a/.Lib9c.Tests/TestHelper/BlockChainHelper.cs +++ b/.Lib9c.Tests/TestHelper/BlockChainHelper.cs @@ -158,7 +158,6 @@ public static MakeInitialStateResult MakeInitialState() BlockIndex = 0, PreviousState = initialState, RandomSeed = 0, - Rehearsal = false, }); return new MakeInitialStateResult(