Skip to content

Commit

Permalink
feat: Add action mutation for migration planetarium validator
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Nov 26, 2024
1 parent 0b51fde commit 8b1db36
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions NineChronicles.Headless/GraphTypes/ActionMutation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,34 @@ public ActionMutation(NineChroniclesNodeService service)
}
}
);
Field<NonNullGraphType<TxIdType>>("migratePlanetariumValidator",
description: "Migration Planetarium Validator",
resolve: context =>
{
try
{
BlockChain? blockChain = service.BlockChain;
if (blockChain is null)
{
throw new InvalidOperationException($"{nameof(blockChain)} is null.");
}

var actions = new[] { new MigratePlanetariumValidator() };
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

0 comments on commit 8b1db36

Please sign in to comment.