From cd56487a1f1abcfdc54c39ad1eb1ddd748bafab5 Mon Sep 17 00:00:00 2001 From: Suho Lee Date: Tue, 17 Oct 2023 14:04:41 +0900 Subject: [PATCH 1/2] bump: lib9c --- MarketService/Models/ItemProductModel.cs | 2 +- lib9c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MarketService/Models/ItemProductModel.cs b/MarketService/Models/ItemProductModel.cs index 8401587..3286d80 100644 --- a/MarketService/Models/ItemProductModel.cs +++ b/MarketService/Models/ItemProductModel.cs @@ -70,7 +70,7 @@ public void Update(ITradableItem tradableItem, FungibleAssetValue price, Costume { var stats = new List(); #pragma warning disable CS0618 - CombatPoint = CPHelper.GetCP(tradableItem, costumeStatSheet); + CombatPoint = CPHelper.GetCP((INonFungibleItem)tradableItem, costumeStatSheet); #pragma warning restore CS0618 UnitPrice = Price / Quantity; switch (tradableItem) diff --git a/lib9c b/lib9c index 6284e93..aa95dcf 160000 --- a/lib9c +++ b/lib9c @@ -1 +1 @@ -Subproject commit 6284e93a8e3a7fefba2af5d35f9d1b24abc1e750 +Subproject commit aa95dcffd5f6dac64da413aa1b67bbf6a61b0be9 From 225637cd624fff9cbcaf51307e78028a6c80908b Mon Sep 17 00:00:00 2001 From: Suho Lee Date: Tue, 17 Oct 2023 14:04:49 +0900 Subject: [PATCH 2/2] bump: NineChronicles.RPC.Shared --- MarketService.Tests/RpcClientTest.cs | 23 +++++++++++++++++++---- NineChronicles.RPC.Shared | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/MarketService.Tests/RpcClientTest.cs b/MarketService.Tests/RpcClientTest.cs index 5cbcceb..bbfddf8 100644 --- a/MarketService.Tests/RpcClientTest.cs +++ b/MarketService.Tests/RpcClientTest.cs @@ -352,7 +352,7 @@ public async Task SyncOrder_Cancel(ItemSubType itemSubType) ItemBase item = null!; if (itemSubType == ItemSubType.Armor) { - tradableItem = ItemFactory.CreateItemUsable(_row, order.TradableId, 0L); + tradableItem = (ITradableItem)ItemFactory.CreateItemUsable(_row, order.TradableId, 0L); } if (itemSubType == ItemSubType.FullCostume) @@ -441,7 +441,7 @@ public async Task SyncOrder_ReRegister(ItemSubType itemSubType) 1 ); SetShopStates(itemSubType, orderDigest); - _testService.SetState(Addresses.GetItemAddress(item.TradableId), item.Serialize()); + _testService.SetState(Addresses.GetItemAddress(item.NonFungibleId), item.Serialize()); var agentState = new AgentState(agentAddress); agentState.avatarAddresses.Add(0, avatarAddress); @@ -524,7 +524,7 @@ public async Task SyncProduct() Type = ProductType.NonFungible, SellerAgentAddress = agentAddress, SellerAvatarAddress = avatarAddress, - TradableItem = item + TradableItem = (ITradableItem)item }; productState.ProductIds.Add(productId); _testService.SetState(Product.DeriveAddress(productId), itemProduct.Serialize()); @@ -675,7 +675,7 @@ public TestClient(IOptions options, ILogger logger, private class TestService : ServiceBase, IBlockChainService { - private IAccountStateDelta _states; + private IAccount _states; public TestService() { @@ -727,16 +727,25 @@ public UnaryResult GetState(byte[] addressBytes, byte[] blockHashBytes) return new UnaryResult(new Codec().Encode(value)); } + public UnaryResult GetStateBySrh(byte[] addressBytes, byte[] stateRootHashBytes) => + GetState(addressBytes, stateRootHashBytes); + public UnaryResult GetBalance(byte[] addressBytes, byte[] currencyBytes, byte[] blockHashBytes) { throw new NotImplementedException(); } + public UnaryResult GetBalanceBySrh(byte[] addressBytes, byte[] currencyBytes, byte[] stateRootHashBytes) => + throw new NotImplementedException(); + public UnaryResult GetTip() { throw new NotImplementedException(); } + public UnaryResult GetBlockHash(long blockIndex) => + throw new NotImplementedException(); + public UnaryResult SetAddressesToSubscribe(byte[] toByteArray, IEnumerable addressesBytes) { throw new NotImplementedException(); @@ -768,6 +777,9 @@ public UnaryResult> GetAvatarStates(IEnumerable> GetAvatarStatesBySrh(IEnumerable addressBytesList, byte[] stateRootHashBytes) => + throw new NotImplementedException(); + public UnaryResult> GetStateBulk(IEnumerable addressBytesList, byte[] blockHashBytes) { @@ -784,6 +796,9 @@ public UnaryResult> GetStateBulk(IEnumerable return new UnaryResult>(result); } + public UnaryResult> GetStateBulkBySrh(IEnumerable addressBytesList, byte[] stateRootHashBytes) => + GetStateBulk(addressBytesList, stateRootHashBytes); + public void SetOrder(Order order) { SetState(Order.DeriveAddress(order.OrderId), order.Serialize()); diff --git a/NineChronicles.RPC.Shared b/NineChronicles.RPC.Shared index 5e02fdf..cff6842 160000 --- a/NineChronicles.RPC.Shared +++ b/NineChronicles.RPC.Shared @@ -1 +1 @@ -Subproject commit 5e02fdfea99cb91602f43288330c10ca8e916e3e +Subproject commit cff68421fabb098f3d0bfd20fdef55755db309e4