mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
Document more TODOs as tickets (#1418)
Went through the TODOs, removed a bunch, which are outdated or nothing more than a regular comment, documented a bunch more as actual tickets and made them FIXMEs and unified their structure (`FIXME #TICKETNO DESC` for local tickets, `FIXME: DESC LINK` for external tickets) for easier in-editor support. Further more remove unnecessary remarks and related old code that I noticed in that instance.
This commit is contained in:
committed by
GitHub
parent
d2cfd7b9dc
commit
15ae7cfef6
@@ -49,7 +49,7 @@ impl ChangesTrieConfiguration {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// TODO: use saturating_pow when available
|
||||
// FIXME: use saturating_pow once stabilized - https://github.com/rust-lang/rust/issues/48320
|
||||
let mut max_digest_interval = self.digest_interval;
|
||||
for _ in 1..self.digest_levels {
|
||||
max_digest_interval = match max_digest_interval.checked_mul(self.digest_interval) {
|
||||
|
||||
@@ -238,16 +238,6 @@ impl Pair {
|
||||
r.copy_from_slice(pk);
|
||||
Public(r)
|
||||
}
|
||||
|
||||
/// Derive a child key. Probably unsafe and broken.
|
||||
// TODO: proper HD derivation https://cardanolaunch.com/assets/Ed25519_BIP.pdf
|
||||
pub fn derive_child_probably_bad(&self, chain_data: &[u8]) -> Pair {
|
||||
let sig = self.sign(chain_data);
|
||||
let mut seed = [0u8; 32];
|
||||
seed.copy_from_slice(&sig[..32]);
|
||||
|
||||
Pair::from_seed(&seed)
|
||||
}
|
||||
}
|
||||
|
||||
/// Verify a signature on a message. Returns true if the signature is good.
|
||||
@@ -350,12 +340,6 @@ mod test {
|
||||
assert_eq!(pair1.public(), pair2.public());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn derive_child() {
|
||||
let pair = Pair::generate();
|
||||
let _pair2 = pair.derive_child_probably_bad(b"session_1234");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ss58check_roundtrip_works() {
|
||||
let pair = Pair::from_seed(b"12345678901234567890123456789012");
|
||||
|
||||
Reference in New Issue
Block a user