Skip to content

Commit

Permalink
add spec for function
Browse files Browse the repository at this point in the history
  • Loading branch information
SachinMeier committed Feb 12, 2023
1 parent 0d18d7a commit 45ea0b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions lib/script.ex
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ defmodule Bitcoinex.Script do
{:ok, script, r}
end

@spec calculate_unsolvable_internal_key(non_neg_integer) ::
{:error, String.t()} | Bitcoinex.Secp256k1.Point.t()
def calculate_unsolvable_internal_key(r) do
case PrivateKey.new(r) do
{:error, msg} ->
Expand Down
9 changes: 1 addition & 8 deletions scripts/dlc.exs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ fund_scriptpubkeys = [Script.serialize_with_compact_size(fund_scriptpubkey)]
oracle_sk = new_privkey.()
oracle_pk = PrivateKey.to_point(oracle_sk)

# Oracle creates 2 tweak/point pairs, one for each possible outcome
# The bet will be a simple MOON or CRASH bet.
# The bet will be a simple EAGLES or CHIEFS bet.

# the same nonce must be used for both outcomes in order to guarantee that the Oracle
# cannot sign both events without leaking their own private key. In a more trust-minimized
Expand Down Expand Up @@ -416,12 +415,6 @@ control_block_hex = control_block |> Base.encode16(case: :lower)


# She then adds these to the Moon CET and broadcasts it
tx = %Transaction{moon_cet | witnesses: [
%Transaction.Witness{
txinwitness: [bob_moon_sig_hex, alice_moon_sig_hex, fund_script_hex, control_block_hex]
}
]
}

tx = %Transaction{moon_cet | witnesses: [
%Transaction.Witness{
Expand Down

0 comments on commit 45ea0b3

Please sign in to comment.