Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
fix: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie committed Mar 29, 2019
1 parent eb7c3b0 commit c077aa5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/ckb/wallet.rb
Expand Up @@ -9,7 +9,7 @@
require "securerandom"

module Ckb
VERIFY_SCRIPT = File.read(File.expand_path("../../../scripts/bitcoin_unlock.rb", __FILE__))
VERIFY_SCRIPT = File.read(File.expand_path("../../../scripts/secp256k1_blake2b_lock.rb", __FILE__))

class Wallet
attr_reader :api
Expand Down
2 changes: 1 addition & 1 deletion scripts
39 changes: 16 additions & 23 deletions test/ckb/utils_test.rb
Expand Up @@ -23,19 +23,16 @@ def test_calculate_cell_min_capacity
output = {
capacity: 5000000,
data: "",
lock: "0da2fe99fe549e082d4ed483c2e968a89ea8d11aabf5d79e5cbf06522de6e674",
type: {
lock: {
args: [],
binary: "0100000000000000",
reference: nil,
signed_args: [],
binary_hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
version: 0
}
}

min_capacity = 57
min_capacity = 41

assert Ckb::Utils.calculate_cell_min_capacity(output), min_capacity
assert_equal Ckb::Utils.calculate_cell_min_capacity(output), min_capacity
end

def test_normalize_tx_for_json
Expand All @@ -48,20 +45,18 @@ def test_normalize_tx_for_json
hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
index: 4294967295
},
unlock: {
args: [],
binary: "0x0100000000000000",
reference: nil,
signed_args: [],
version: 0
}
args: []
}
],
outputs: [
{
capacity: 5000000,
data: "0x",
lock: "0x0da2fe99fe549e082d4ed483c2e968a89ea8d11aabf5d79e5cbf06522de6e674",
lock: {
args: ["0x616263"],
binary_hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
version: 0
},
type: nil
}
]
Expand All @@ -76,20 +71,18 @@ def test_normalize_tx_for_json
hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
index: 4294967295
},
unlock: {
args: [],
binary: ["0100000000000000"].pack("H*"),
reference: nil,
signed_args: [],
version: 0
}
args: []
}
],
outputs: [
{
capacity: 5000000,
data: "",
lock: "0x0da2fe99fe549e082d4ed483c2e968a89ea8d11aabf5d79e5cbf06522de6e674",
lock: {
args: ["abc"],
binary_hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
version: 0
},
type: nil
}
]
Expand Down

0 comments on commit c077aa5

Please sign in to comment.