mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-24 15:40:08 +00:00
Revert "feat(consensus): expose manifest binding identity"
This reverts commit dae0d64b3e.
This commit is contained in:
@@ -421,51 +421,6 @@ public:
|
||||
getDatabasePath() / boost::filesystem::path(dbName));
|
||||
}
|
||||
|
||||
void
|
||||
testBindingID()
|
||||
{
|
||||
testcase("bindingID");
|
||||
|
||||
auto const sk = randomSecretKey();
|
||||
auto const kp = randomKeyPair(KeyType::secp256k1);
|
||||
auto const manifest = makeManifest(
|
||||
sk, KeyType::ed25519, kp.second, KeyType::secp256k1, 1);
|
||||
|
||||
auto const reparsed = deserializeManifest(manifest.serialized);
|
||||
BEAST_EXPECT(reparsed);
|
||||
if (reparsed)
|
||||
BEAST_EXPECT(manifest.bindingID() == reparsed->bindingID());
|
||||
|
||||
auto const changedSequence = makeManifest(
|
||||
sk, KeyType::ed25519, kp.second, KeyType::secp256k1, 2);
|
||||
BEAST_EXPECT(manifest.bindingID() != changedSequence.bindingID());
|
||||
|
||||
STObject st(sfGeneric);
|
||||
SerialIter sit(manifest.serialized.data(), manifest.serialized.size());
|
||||
st.set(sit);
|
||||
|
||||
auto sig = st.getFieldVL(sfSignature);
|
||||
auto masterSig = st.getFieldVL(sfMasterSignature);
|
||||
BEAST_EXPECT(!sig.empty());
|
||||
BEAST_EXPECT(!masterSig.empty());
|
||||
sig.front() ^= 0x01;
|
||||
masterSig.front() ^= 0x01;
|
||||
st.setFieldVL(sfSignature, sig);
|
||||
st.setFieldVL(sfMasterSignature, masterSig);
|
||||
|
||||
Serializer s;
|
||||
st.add(s);
|
||||
auto const alteredSignatures = deserializeManifest(
|
||||
std::string(static_cast<char const*>(s.data()), s.size()));
|
||||
BEAST_EXPECT(alteredSignatures);
|
||||
if (alteredSignatures)
|
||||
{
|
||||
BEAST_EXPECT(
|
||||
manifest.bindingID() == alteredSignatures->bindingID());
|
||||
BEAST_EXPECT(manifest.hash() != alteredSignatures->hash());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
testGetSignature()
|
||||
{
|
||||
@@ -1119,7 +1074,6 @@ public:
|
||||
}
|
||||
|
||||
testLoadStore(cache);
|
||||
testBindingID();
|
||||
testGetSignature();
|
||||
testGetKeys();
|
||||
testValidatorToken();
|
||||
|
||||
@@ -128,10 +128,6 @@ struct Manifest
|
||||
uint256
|
||||
hash() const;
|
||||
|
||||
/// Returns hash of manifest data authenticated by signatures
|
||||
uint256
|
||||
bindingID() const;
|
||||
|
||||
/// Returns `true` if manifest revokes master key
|
||||
// The maximum possible sequence number means that the master key has
|
||||
// been revoked
|
||||
|
||||
@@ -209,15 +209,6 @@ Manifest::hash() const
|
||||
return st.getHash(HashPrefix::manifest);
|
||||
}
|
||||
|
||||
uint256
|
||||
Manifest::bindingID() const
|
||||
{
|
||||
STObject st(sfGeneric);
|
||||
SerialIter sit(serialized.data(), serialized.size());
|
||||
st.set(sit);
|
||||
return st.getSigningHash(HashPrefix::manifest);
|
||||
}
|
||||
|
||||
bool
|
||||
Manifest::revoked() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user