Last active
December 21, 2020 21:17
-
-
Save sanket1729/2e1bf9f2a1bae326f75ebcf983a369ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn witness_script<ToPkCtx: Copy>(&self, to_pk_ctx: ToPkCtx) -> BtcScript | |
where | |
Pk: ToPublicKey<ToPkCtx>, | |
{ | |
let tweak = self.desc.witness_script(to_pk_ctx).into_bytes(); | |
let mut builder = script::Builder::new() | |
.push_opcode(opcodes::all::OP_DEPTH) | |
.push_int(self.fed_k as i64 + 1) | |
.push_opcode(opcodes::all::OP_EQUAL) | |
.push_opcode(opcodes::all::OP_IF) | |
.push_int(self.fed_k as i64); | |
for key in &self.fed_pks { | |
// Typing error here: | |
let tweaked_pk = key.to_public_key((to_pk_ctx, &tweak)); | |
//^^^^^^^^^^^^^^^^^^^ expected type parameter `ToPkCtx`, found tuple | |
builder = builder.push_key(&tweaked_pk); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment