本文整理汇总了C++中PublicKey::slice方法的典型用法代码示例。如果您正苦于以下问题:C++ PublicKey::slice方法的具体用法?C++ PublicKey::slice怎么用?C++ PublicKey::slice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PublicKey
的用法示例。
在下文中一共展示了PublicKey::slice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STObject
STValidation::STValidation(
uint256 const& ledgerHash,
std::uint32_t ledgerSeq,
uint256 const& consensusHash,
NetClock::time_point signTime,
PublicKey const& publicKey,
SecretKey const& secretKey,
NodeID const& nodeID,
bool isFull,
FeeSettings const& fees,
std::vector<uint256> const& amendments)
: STObject(getFormat(), sfValidation), mNodeID(nodeID), mSeen(signTime)
{
// This is our own public key and it should always be valid.
if (!publicKeyType(publicKey))
LogicError("Invalid validation public key");
assert(mNodeID.isNonZero());
setFieldH256(sfLedgerHash, ledgerHash);
setFieldH256(sfConsensusHash, consensusHash);
setFieldU32(sfSigningTime, signTime.time_since_epoch().count());
setFieldVL(sfSigningPubKey, publicKey.slice());
if (isFull)
setFlag(kFullFlag);
setFieldU32(sfLedgerSequence, ledgerSeq);
if (fees.loadFee)
setFieldU32(sfLoadFee, *fees.loadFee);
if (fees.baseFee)
setFieldU64(sfBaseFee, *fees.baseFee);
if (fees.reserveBase)
setFieldU32(sfReserveBase, *fees.reserveBase);
if (fees.reserveIncrement)
setFieldU32(sfReserveIncrement, *fees.reserveIncrement);
if (!amendments.empty())
setFieldV256(sfAmendments, STVector256(sfAmendments, amendments));
setFlag(vfFullyCanonicalSig);
auto const signingHash = getSigningHash();
setFieldVL(
sfSignature, signDigest(getSignerPublic(), secretKey, signingHash));
setTrusted();
}
示例2: STObject
STValidation::STValidation (
uint256 const& ledgerHash,
NetClock::time_point signTime,
PublicKey const& publicKey,
bool isFull)
: STObject (getFormat (), sfValidation)
, mSeen (signTime)
{
// Does not sign
setFieldH256 (sfLedgerHash, ledgerHash);
setFieldU32 (sfSigningTime, signTime.time_since_epoch().count());
setFieldVL (sfSigningPubKey, publicKey.slice());
mNodeID = calcNodeID(publicKey);
assert (mNodeID.isNonZero ());
if (isFull)
setFlag (kFullFlag);
}