From 38c962f012776155cb02392c198fe59c3fcea039 Mon Sep 17 00:00:00 2001 From: ilgyu Date: Tue, 2 Jul 2024 18:50:57 +0900 Subject: [PATCH 1/2] bump: Lib9c --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index f5f370fc5..6e1fcdf48 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit f5f370fc58a8ae9dfef63b1515c96ccffec3ae59 +Subproject commit 6e1fcdf488f7bcd11a8b84dd60e60208eafb5348 From 10a8124af7bd72b58d871246601ae881e896c057 Mon Sep 17 00:00:00 2001 From: ilgyu Date: Tue, 2 Jul 2024 18:51:26 +0900 Subject: [PATCH 2/2] test: Fix StageTransaction test --- .../GraphTypes/StandaloneMutationTest.cs | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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); }