Skip to content

Commit

Permalink
fix: Fix build errors caused by bumping lib9c
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Jan 2, 2025
1 parent 5aa8eac commit 764e854
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 59 deletions.
28 changes: 0 additions & 28 deletions NineChronicles.Headless/GraphTypes/ActionMutation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -701,34 +701,6 @@ public ActionMutation(NineChroniclesNodeService service)
}
}
);
Field<NonNullGraphType<TxIdType>>("migratePlanetariumGuild",
description: "Migrate Planetarium Guild",
resolve: context =>
{
try
{
BlockChain? blockChain = service.BlockChain;
if (blockChain is null)
{
throw new InvalidOperationException($"{nameof(blockChain)} is null.");
}

var actions = new[] { new MigratePlanetariumGuild() };
Transaction tx = blockChain.MakeTransaction(
service.MinerPrivateKey,
actions,
Currencies.Mead * 1,
1L);
return tx.Id;
}
catch (Exception e)
{
var msg = $"Unexpected exception occurred during {typeof(ActionMutation)}: {e}";
context.Errors.Add(new ExecutionError(msg, e));
throw;
}
}
);
Field<NonNullGraphType<TxIdType>>("unjailValidator",
description: "Unjail validator",
resolve: context =>
Expand Down
29 changes: 0 additions & 29 deletions NineChronicles.Headless/GraphTypes/ActionQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -570,35 +570,6 @@ public ActionQuery(StandaloneContext standaloneContext)
context,
new MigrateDelegationHeight(context.GetArgument<long>("amount"))));

Field<ByteStringType>(
name: "migratePlanetariumGuild",
resolve: context => Encode(
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));
});

Field<ByteStringType>(
name: "makeGuild",
resolve: context => Encode(context, new MakeGuild()));
Expand Down
4 changes: 2 additions & 2 deletions NineChronicles.Headless/GraphTypes/StateQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ public StateQuery()
var agentAddress = new AgentAddress(context.GetArgument<Address>("agentAddress"));
var validatorAddress = context.GetArgument<Address>("validatorAddress");
var repository = new ValidatorRepository(new World(context.Source.WorldState), new HallowActionContext { });
var delegatee = repository.GetValidatorDelegatee(validatorAddress);
var delegatee = repository.GetDelegatee(validatorAddress);
var share = repository.GetBond(delegatee, agentAddress).Share;

return share.ToString();
Expand All @@ -791,7 +791,7 @@ public StateQuery()
{
var validatorAddress = context.GetArgument<Address>("validatorAddress");
var repository = new ValidatorRepository(new World(context.Source.WorldState), new HallowActionContext { });
var delegatee = repository.GetValidatorDelegatee(validatorAddress);
var delegatee = repository.GetDelegatee(validatorAddress);
return ValidatorType.FromDelegatee(delegatee);
}
);
Expand Down

0 comments on commit 764e854

Please sign in to comment.