diff --git a/Lib9c b/Lib9c index f5f370fc5..6e1fcdf48 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit f5f370fc58a8ae9dfef63b1515c96ccffec3ae59 +Subproject commit 6e1fcdf488f7bcd11a8b84dd60e60208eafb5348 diff --git a/NineChronicles.Headless.Tests/GraphTypes/StandaloneMutationTest.cs b/NineChronicles.Headless.Tests/GraphTypes/StandaloneMutationTest.cs index 1cd0808af..556a0deaa 100644 --- a/NineChronicles.Headless.Tests/GraphTypes/StandaloneMutationTest.cs +++ b/NineChronicles.Headless.Tests/GraphTypes/StandaloneMutationTest.cs @@ -903,14 +903,31 @@ public async Task StageTransaction() StandaloneContextFx.BlockChain = service.Swarm?.BlockChain; var pk = new PrivateKey(); - ActionBase action = new ApprovePledge + ActionBase patronPrepareAction = new PrepareRewardAssets { - PatronAddress = new PrivateKey().Address + RewardPoolAddress = MeadConfig.PatronAddress, + Assets = new List + { + 1 * Currencies.Mead, + }, }; - var tx = Transaction.Create(0, pk, BlockChain.Genesis.Hash, new[] { action.PlainValue }); + var tx = Transaction.Create(0, pk, BlockChain.Genesis.Hash, new[] { patronPrepareAction.PlainValue }); var payload = ByteUtil.Hex(tx.Serialize()); var stageTxMutation = $"mutation {{ stageTransaction(payload: \"{payload}\") }}"; var stageTxResult = await ExecuteQueryAsync(stageTxMutation); + Assert.Null(stageTxResult.Errors); + + var block = service.BlockChain.ProposeBlock(ProposerPrivateKey, null); + service.BlockChain.Append(block, GenerateBlockCommit(1, block.Hash, new List() { ProposerPrivateKey })); + + ActionBase action = new ApprovePledge + { + PatronAddress = new PrivateKey().Address + }; + tx = Transaction.Create(0, pk, BlockChain.Genesis.Hash, new[] { action.PlainValue }); + payload = ByteUtil.Hex(tx.Serialize()); + stageTxMutation = $"mutation {{ stageTransaction(payload: \"{payload}\") }}"; + stageTxResult = await ExecuteQueryAsync(stageTxMutation); var error = Assert.Single(stageTxResult.Errors!); Assert.Contains("gas", error.Message); }