Skip to content

smite: add revoke_and_ack message codec implementation#34

Open
kartikangiras wants to merge 1 commit intomorehouse:masterfrom
kartikangiras:revoke-ack
Open

smite: add revoke_and_ack message codec implementation#34
kartikangiras wants to merge 1 commit intomorehouse:masterfrom
kartikangiras:revoke-ack

Conversation

@kartikangiras
Copy link
Copy Markdown

Add support for Revoke Ack message codec.
relates to #5

Copy link
Copy Markdown

@kushagra0902 kushagra0902 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR in general looks good and has all the fields from the Bolt-02 type 133. There is a small naming/intent problem in one of the tests mentioned.

let secret1 = [0x01; 32];
let secret2 = [0x02; 32];

for secret_bytes in &[secret1, secret2] {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test does not generate different public keys; it uses the same constant key in every iteration, so the test name is misleading, as the code let pk = PublicKey::from_slice(&[0x02; 33]).expect("valid public key"); Generates same keys in every iteration
It would be better to use this:

let sk1 = SecretKey::from_slice(&[0x01; 32]).unwrap();
    let sk2 = SecretKey::from_slice(&[0x03; 32]).unwrap();

    for sk in &[sk1, sk2] {
        let pk = PublicKey::from_secret_key(&secp, sk);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants