Skip to content

Commit

Permalink
Fix broken garage test
Browse files Browse the repository at this point in the history
  • Loading branch information
ipdae committed Oct 27, 2023
1 parent 753b437 commit 6d6ff04
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .Lib9c.Tests/Action/Garages/LoadIntoMyGaragesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ public void Execute_Throws_InvalidActionFieldException()
public void Execute_Throws_Exception()
{
// Balance does not enough to pay cost.
var balance = _previousStates.GetBalance(AgentAddr, Currencies.Garage);
var previousStatesWithNotEnoughCost = _previousStates.BurnAsset(
new ActionContext { Signer = AgentAddr },
AgentAddr,
new FungibleAssetValue(Currencies.Garage, 1, 0));
balance);
Assert.Throws<InsufficientBalanceException>(() => Execute(
AgentAddr,
0,
Expand Down Expand Up @@ -435,13 +436,15 @@ private static (Address balanceAddr, FungibleAssetValue value)[]
fav.Sign > 0)
.Select(fav =>
{
// CRYSTAL's minorUnit is not actually used in network, avoid cost calculate exception in test.
var value = 1 * fav.Currency;
if (Currencies.IsRuneTicker(fav.Currency.Ticker) ||
Currencies.IsSoulstoneTicker(fav.Currency.Ticker))
{
return (avatarAddr, fav);
return (avatarAddr, value);
}

return (agentAddr, fav);
return (agentAddr, value);
})
.ToArray();
}
Expand Down

0 comments on commit 6d6ff04

Please sign in to comment.