Skip to content

Commit

Permalink
Remove unnecessary test
Browse files Browse the repository at this point in the history
  • Loading branch information
greymistcube committed Dec 20, 2023
1 parent 1949f2d commit f2b347d
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions Libplanet.Tests/Action/ActionEvaluatorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,68 +1146,6 @@ public void EvaluateThrowingInsufficientBalanceForGasFee()
evaluations.Single().Exception?.InnerException?.GetType());
}

[Fact]
public void EvaluateMinusGasFee()
{
var privateKey = new PrivateKey();
var address = privateKey.Address;
Currency foo = Currency.Uncapped(
"FOO",
18,
null
);

var freeGasAction = new UseGasAction()
{
GasUsage = 0,
Memo = "FREE",
MintValue = FungibleAssetValue.FromRawValue(foo, 10),
Receiver = address,
};

var payGasAction = new UseGasAction()
{
GasUsage = 1,
Memo = "CHARGE",
};

var store = new MemoryStore();
var stateStore = new TrieStateStore(new MemoryKeyValueStore());
var chain = TestUtils.MakeBlockChain<UseGasAction>(
policy: new BlockPolicy(),
actions: new[]
{
freeGasAction,
},
store: store,
stateStore: stateStore);
var tx = Transaction.Create(
nonce: 0,
privateKey: privateKey,
genesisHash: chain.Genesis.Hash,
maxGasPrice: FungibleAssetValue.FromRawValue(foo, -10),
gasLimit: 5,
actions: new[]
{
payGasAction,
}.ToPlainValues());

chain.StageTransaction(tx);
var miner = new PrivateKey();
Block block = chain.ProposeBlock(miner);

var evaluations = chain.ActionEvaluator.Evaluate(
block, chain.Store.GetStateRootHash(block.PreviousHash));

Assert.False(evaluations[0].InputContext.BlockAction);
Assert.Single(evaluations);
Assert.NotNull(evaluations.Single().Exception);
Assert.NotNull(evaluations.Single().Exception?.InnerException);
Assert.Equal(
typeof(ArgumentOutOfRangeException),
evaluations.Single().Exception?.InnerException?.GetType());
}

[Fact]
public void GenerateRandomSeed()
{
Expand Down

0 comments on commit f2b347d

Please sign in to comment.