Skip to content

Commit

Permalink
Merge pull request #78 from planetarium/bump/libplanet-3.6.0
Browse files Browse the repository at this point in the history
bump: libplanet 3.6.0
  • Loading branch information
riemannulus authored Oct 17, 2023
2 parents 68e6bc8 + 225637c commit c2febce
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
23 changes: 19 additions & 4 deletions MarketService.Tests/RpcClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -675,7 +675,7 @@ public TestClient(IOptions<RpcConfigOptions> options, ILogger<RpcClient> logger,

private class TestService : ServiceBase<IBlockChainService>, IBlockChainService
{
private IAccountStateDelta _states;
private IAccount _states;

public TestService()
{
Expand Down Expand Up @@ -727,16 +727,25 @@ public UnaryResult<byte[]> GetState(byte[] addressBytes, byte[] blockHashBytes)
return new UnaryResult<byte[]>(new Codec().Encode(value));
}

public UnaryResult<byte[]> GetStateBySrh(byte[] addressBytes, byte[] stateRootHashBytes) =>
GetState(addressBytes, stateRootHashBytes);

public UnaryResult<byte[]> GetBalance(byte[] addressBytes, byte[] currencyBytes, byte[] blockHashBytes)
{
throw new NotImplementedException();
}

public UnaryResult<byte[]> GetBalanceBySrh(byte[] addressBytes, byte[] currencyBytes, byte[] stateRootHashBytes) =>
throw new NotImplementedException();

public UnaryResult<byte[]> GetTip()
{
throw new NotImplementedException();
}

public UnaryResult<byte[]> GetBlockHash(long blockIndex) =>
throw new NotImplementedException();

public UnaryResult<bool> SetAddressesToSubscribe(byte[] toByteArray, IEnumerable<byte[]> addressesBytes)
{
throw new NotImplementedException();
Expand Down Expand Up @@ -768,6 +777,9 @@ public UnaryResult<Dictionary<byte[], byte[]>> GetAvatarStates(IEnumerable<byte[
throw new NotImplementedException();
}

public UnaryResult<Dictionary<byte[], byte[]>> GetAvatarStatesBySrh(IEnumerable<byte[]> addressBytesList, byte[] stateRootHashBytes) =>
throw new NotImplementedException();

public UnaryResult<Dictionary<byte[], byte[]>> GetStateBulk(IEnumerable<byte[]> addressBytesList,
byte[] blockHashBytes)
{
Expand All @@ -784,6 +796,9 @@ public UnaryResult<Dictionary<byte[], byte[]>> GetStateBulk(IEnumerable<byte[]>
return new UnaryResult<Dictionary<byte[], byte[]>>(result);
}

public UnaryResult<Dictionary<byte[], byte[]>> GetStateBulkBySrh(IEnumerable<byte[]> addressBytesList, byte[] stateRootHashBytes) =>
GetStateBulk(addressBytesList, stateRootHashBytes);

public void SetOrder(Order order)
{
SetState(Order.DeriveAddress(order.OrderId), order.Serialize());
Expand Down
2 changes: 1 addition & 1 deletion MarketService/Models/ItemProductModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void Update(ITradableItem tradableItem, FungibleAssetValue price, Costume
{
var stats = new List<StatModel>();
#pragma warning disable CS0618
CombatPoint = CPHelper.GetCP(tradableItem, costumeStatSheet);
CombatPoint = CPHelper.GetCP((INonFungibleItem)tradableItem, costumeStatSheet);
#pragma warning restore CS0618
UnitPrice = Price / Quantity;
switch (tradableItem)
Expand Down
2 changes: 1 addition & 1 deletion NineChronicles.RPC.Shared
2 changes: 1 addition & 1 deletion lib9c
Submodule lib9c updated 720 files

0 comments on commit c2febce

Please sign in to comment.