diff --git a/NineChronicles.Headless/GraphTypes/ActionQuery.cs b/NineChronicles.Headless/GraphTypes/ActionQuery.cs index f220ea3fa..9e2803422 100644 --- a/NineChronicles.Headless/GraphTypes/ActionQuery.cs +++ b/NineChronicles.Headless/GraphTypes/ActionQuery.cs @@ -574,6 +574,29 @@ public ActionQuery(StandaloneContext standaloneContext) context, new MigratePlanetariumGuild())); + Field( + name: "fixToRefundFromNonValidator", + arguments: new QueryArguments( + new QueryArgument>>> + { + Description = "List of addresses to refund", + Name = "addresses", + }, + new QueryArgument>>> + { + Description = "List of amounts to refund", + Name = "amounts", + }), + resolve: context => + { + var addresses = context.GetArgument>("addresses"); + var amounts = context.GetArgument>("amounts"); + var targets = addresses.Zip(amounts, (address, amount) => (address, amount)); + return Encode( + context, + new FixToRefundFromNonValidator(targets)); + }); + RegisterHackAndSlash(); RegisterHackAndSlashSweep(); RegisterDailyReward(); diff --git a/NineChronicles.Headless/GraphTypes/StateQuery.cs b/NineChronicles.Headless/GraphTypes/StateQuery.cs index e35cf04dd..7f07af304 100644 --- a/NineChronicles.Headless/GraphTypes/StateQuery.cs +++ b/NineChronicles.Headless/GraphTypes/StateQuery.cs @@ -765,11 +765,6 @@ public StateQuery() { var agentAddress = new AgentAddress(context.GetArgument
("agentAddress")); var validatorAddress = context.GetArgument
("validatorAddress"); - if (!(context.Source.WorldState.GetAgentState(agentAddress) is { } agentState)) - { - return null; - } - var repository = new ValidatorRepository(new World(context.Source.WorldState), new HallowActionContext { }); var delegatee = repository.GetValidatorDelegatee(validatorAddress); var share = repository.GetBond(delegatee, agentAddress).Share;