Skip to content

Commit

Permalink
Merge branch 'main' into release/220
Browse files Browse the repository at this point in the history
  • Loading branch information
U-lis committed Nov 27, 2024
2 parents 7f74b05 + 7d0e233 commit 2cac22a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
23 changes: 23 additions & 0 deletions NineChronicles.Headless/GraphTypes/ActionQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,29 @@ public ActionQuery(StandaloneContext standaloneContext)
context,
new MigratePlanetariumGuild()));

Field<ByteStringType>(
name: "fixToRefundFromNonValidator",
arguments: new QueryArguments(
new QueryArgument<NonNullGraphType<ListGraphType<NonNullGraphType<AddressType>>>>
{
Description = "List of addresses to refund",
Name = "addresses",
},
new QueryArgument<NonNullGraphType<ListGraphType<NonNullGraphType<IntGraphType>>>>
{
Description = "List of amounts to refund",
Name = "amounts",
}),
resolve: context =>
{
var addresses = context.GetArgument<List<Address>>("addresses");
var amounts = context.GetArgument<List<int>>("amounts");
var targets = addresses.Zip(amounts, (address, amount) => (address, amount));
return Encode(
context,
new FixToRefundFromNonValidator(targets));
});

RegisterHackAndSlash();
RegisterHackAndSlashSweep();
RegisterDailyReward();
Expand Down
5 changes: 0 additions & 5 deletions NineChronicles.Headless/GraphTypes/StateQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,6 @@ public StateQuery()
{
var agentAddress = new AgentAddress(context.GetArgument<Address>("agentAddress"));
var validatorAddress = context.GetArgument<Address>("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;
Expand Down

0 comments on commit 2cac22a

Please sign in to comment.