From 4967efc0ab4bc48f93548c3a7d1783876a7e383c Mon Sep 17 00:00:00 2001 From: ilgyu Date: Tue, 4 Feb 2025 17:51:14 +0900 Subject: [PATCH 1/2] bump: Lib9c 1.22.1 --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index e3de78396..00383b211 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit e3de78396f7d091fe39a2f1c3128ed9dd89567e0 +Subproject commit 00383b2110231a3bbe8292d2c8606f34eaec1383 From 67f0cc8b947473f40a9b4aa335da53de78e1618b Mon Sep 17 00:00:00 2001 From: ilgyu Date: Tue, 4 Feb 2025 18:01:59 +0900 Subject: [PATCH 2/2] chore: Add action query for MigrateStakeAndJoinGuild --- .../GraphTypes/ActionQueryTest.cs | 17 +++++++++++++++++ .../GraphTypes/ActionQuery.cs | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/NineChronicles.Headless.Tests/GraphTypes/ActionQueryTest.cs b/NineChronicles.Headless.Tests/GraphTypes/ActionQueryTest.cs index 3a95ee5f9..276212939 100644 --- a/NineChronicles.Headless.Tests/GraphTypes/ActionQueryTest.cs +++ b/NineChronicles.Headless.Tests/GraphTypes/ActionQueryTest.cs @@ -18,6 +18,7 @@ using Nekoyume; using Nekoyume.Action; using Nekoyume.Action.Garages; +using Nekoyume.Action.Guild.Migration; using Nekoyume.Helper; using Nekoyume.Model; using Nekoyume.Model.EnumType; @@ -1584,5 +1585,21 @@ public async Task IssueToken(bool favExist, bool itemExist) } } } + + [Fact] + public async Task MigrateStakeAndJoinGuild() + { + var targetAddress = new PrivateKey().Address; + var query = $"{{migrateStakeAndJoinGuild(targetAddress: \"{targetAddress}\")}}"; + var queryResult = await ExecuteQueryAsync(query, standaloneContext: _standaloneContext); + Assert.Null(queryResult.Errors); + + var data = (Dictionary)((ExecutionNode)queryResult.Data!).ToValue()!; + var plainValue = _codec.Decode(ByteUtil.ParseHex((string)data["migrateStakeAndJoinGuild"])); + Assert.IsType(plainValue); + var polymorphicAction = DeserializeNCAction(plainValue); + var action = Assert.IsType(polymorphicAction); + Assert.Equal(targetAddress, action.Target); + } } } diff --git a/NineChronicles.Headless/GraphTypes/ActionQuery.cs b/NineChronicles.Headless/GraphTypes/ActionQuery.cs index 1f85784bf..7a727984e 100644 --- a/NineChronicles.Headless/GraphTypes/ActionQuery.cs +++ b/NineChronicles.Headless/GraphTypes/ActionQuery.cs @@ -713,6 +713,21 @@ public ActionQuery(StandaloneContext standaloneContext) name: "claimUnbonded", resolve: context => Encode(context, new ClaimUnbonded())); + Field( + name: "migrateStakeAndJoinGuild", + arguments: new QueryArguments( + new QueryArgument> + { + Name = "targetAddress", + Description = "The agent address to migrate." + }), + resolve: context => + { + var targetAddress = context.GetArgument
("targetAddress"); + var agentAddress = new AgentAddress(targetAddress); + return Encode(context, new MigrateStakeAndJoinGuild(agentAddress)); + }); + RegisterHackAndSlash(); RegisterHackAndSlashSweep(); RegisterDailyReward();