Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Lib9c #2495

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions NineChronicles.Headless.Tests/GraphTypes/StandaloneMutationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -903,14 +903,31 @@ public async Task StageTransaction()
StandaloneContextFx.BlockChain = service.Swarm?.BlockChain;

var pk = new PrivateKey();
ActionBase action = new ApprovePledge
ActionBase patronPrepareAction = new PrepareRewardAssets
{
PatronAddress = new PrivateKey().Address
RewardPoolAddress = MeadConfig.PatronAddress,
Assets = new List<FungibleAssetValue>
{
1 * Currencies.Mead,
},
};
var tx = Transaction.Create(0, pk, BlockChain.Genesis.Hash, new[] { action.PlainValue });
var tx = Transaction.Create(0, pk, BlockChain.Genesis.Hash, new[] { patronPrepareAction.PlainValue });
var payload = ByteUtil.Hex(tx.Serialize());
var stageTxMutation = $"mutation {{ stageTransaction(payload: \"{payload}\") }}";
var stageTxResult = await ExecuteQueryAsync(stageTxMutation);
Assert.Null(stageTxResult.Errors);

var block = service.BlockChain.ProposeBlock(ProposerPrivateKey, null);
service.BlockChain.Append(block, GenerateBlockCommit(1, block.Hash, new List<PrivateKey>() { ProposerPrivateKey }));

ActionBase action = new ApprovePledge
{
PatronAddress = new PrivateKey().Address
};
tx = Transaction.Create(0, pk, BlockChain.Genesis.Hash, new[] { action.PlainValue });
payload = ByteUtil.Hex(tx.Serialize());
stageTxMutation = $"mutation {{ stageTransaction(payload: \"{payload}\") }}";
stageTxResult = await ExecuteQueryAsync(stageTxMutation);
var error = Assert.Single(stageTxResult.Errors!);
Assert.Contains("gas", error.Message);
}
Expand Down