private (AEDPoSContractImplContainer.AEDPoSContractImplStub, BytesValue) ProperContractStub(MinerInRound minerInRound) { var pubkey = ByteArrayHelper.HexStringToByteArray(minerInRound.Pubkey); var keyPair = SampleECKeyPairs.KeyPairs.First(p => p.PublicKey.BytesEqual(pubkey)); _testDataProvider.SetKeyPair(keyPair); return(_contractTesterFactory.Create <AEDPoSContractImplContainer.AEDPoSContractImplStub>( _consensusContractAddress, keyPair), new BytesValue { Value = ByteString.CopyFrom(pubkey) }); }
private (AEDPoSContractImplContainer.AEDPoSContractImplStub, BytesValue) ProperContractStub( MinerInRound minerInRound) { var pubkey = ByteArrayHelper.HexStringToByteArray(minerInRound.Pubkey); var keyPair = SampleAccount.Accounts.First(a => a.KeyPair.PublicKey.BytesEqual(pubkey)).KeyPair; _testDataProvider.SetKeyPair(keyPair); Debug.WriteLine($"Chosen miner: {keyPair.PublicKey.ToHex()}"); return(_contractTesterFactory.Create <AEDPoSContractImplContainer.AEDPoSContractImplStub>( _consensusContractAddress, keyPair), new BytesValue { Value = ByteString.CopyFrom(pubkey) }); }