Skip to content

Commit

Permalink
Merge 5cf6228 into 00019b4
Browse files Browse the repository at this point in the history
  • Loading branch information
qvantor committed Dec 4, 2018
2 parents 00019b4 + 5cf6228 commit 2f3e13d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"big-integer": "^1.6.36",
"bitcoinjs-lib": "^3.3.2",
"core.js": "^0.4.2",
"exonum-client": "0.12.1",
"exonum-client": "0.13.0",
"idb-keyval": "^2.3.0"
},
"browser": {
Expand Down
4 changes: 2 additions & 2 deletions src/Provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ export default class Provider {
}

static parseConfigAddress ({ services }) {
const pubKeys = services.btc_anchoring.anchoring_keys.map((hex) => Buffer.from(hex, 'hex'))
const pubKeysLen = services.btc_anchoring.anchoring_keys.length
const pubKeys = services.btc_anchoring.public_keys.map((hex) => Buffer.from(hex, 'hex'))
const pubKeysLen = services.btc_anchoring.public_keys.length
const signCount = pubKeysLen < 4 ? pubKeysLen : pubKeysLen * 2 / 3 + 1
const redeemScript = script.multisig.output.encode(signCount, pubKeys)
const scriptPubKey = script.witnessScriptHash.output.encode(crypto.sha256(redeemScript))
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/exonum/configs-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"majority_count": null,
"services": {
"btc_anchoring": {
"anchoring_keys": [
"public_keys": [
"02109c0809a7e7bea5f029966cb107c8998f25781dd19ebc6f6b0b356e0c2ae3cd"
],
"fee": 1000,
Expand Down
6 changes: 3 additions & 3 deletions test/mocks/exonum/configs-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"previous_cfg_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"services": {
"btc_anchoring": {
"anchoring_keys": [
"public_keys": [
"02473e862a0e90d86a1c97bc838b23b60ad39bf13706a6a88166331f194b87f04a"
],
"fee": 10000,
Expand Down Expand Up @@ -51,7 +51,7 @@
"previous_cfg_hash": "d27ec3bb766c2fcda88832f5e84ac9559d10a2ae702c3dc08871f04a8c5eabe6",
"services": {
"btc_anchoring": {
"anchoring_keys": [
"public_keys": [
"03d728ad6757d4784effea04d47baafa216cf474866c2d4dc99b1e8e3eb936e730",
"02d83bba35a8022c247b645eed6f81ac41b7c1580de550e7e82c75ad63ee9ac2fd"
],
Expand Down Expand Up @@ -88,7 +88,7 @@
"previous_cfg_hash": "d27ec3bb766c2fcda88832f5e84ac9559d10a2ae702c3dc08871f04a8c5eabe6",
"services": {
"btc_anchoring": {
"anchoring_keys": [
"public_keys": [
"03d728ad6757d4784effea04d47baafa216cf474866c2d4dc99b1e8e3eb936e730",
"02d83bba35a8022c247b645eed6f81ac41b7c1580de550e7e82c75ad63ee9ac2fd",
"03aeb681df5ac19e449a872b9e9347f1db5a0394d2ec5caf2a9c143f86e232b0d9"
Expand Down
12 changes: 6 additions & 6 deletions test/provider/address.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('address', function () {
it('parsing address with one ancoring key and bitcoin network', () => {
const address = Provider.parseConfigAddress({services: {
'btc_anchoring': {
'anchoring_keys': [
'public_keys': [
'031cf96b4fef362af7d86ee6c7159fa89485730dac8e3090163dd0c282dbc84f22'
],
'fee': 20000,
Expand All @@ -25,7 +25,7 @@ describe('address', function () {
it('parsing address with one ancoring key and testnet network', () => {
const address = Provider.parseConfigAddress({services: {
'btc_anchoring': {
'anchoring_keys': [
'public_keys': [
'031cf96b4fef362af7d86ee6c7159fa89485730dac8e3090163dd0c282dbc84f22'
],
'fee': 20000,
Expand All @@ -42,7 +42,7 @@ describe('address', function () {
it('parsing address with four ancoring keys and testnet network', () => {
const address = Provider.parseConfigAddress({services: {
'btc_anchoring': {
'anchoring_keys': [
'public_keys': [
'031cf96b4fef362af7d86ee6c7159fa89485730dac8e3090163dd0c282dbc84f22',
'028839757bba9bdf46ae553c124479e5c3ded609495f3e93e88ab23c0f559e8be5',
'035c70ffb21d1b454ec650e511e76f6bd3fe76f49c471522ee187abac8d0131a18',
Expand All @@ -58,7 +58,7 @@ describe('address', function () {
it('parsing address with four ancoring keys and main network', () => {
const address = Provider.parseConfigAddress({services: {
'btc_anchoring': {
'anchoring_keys': [
'public_keys': [
'031cf96b4fef362af7d86ee6c7159fa89485730dac8e3090163dd0c282dbc84f22',
'028839757bba9bdf46ae553c124479e5c3ded609495f3e93e88ab23c0f559e8be5',
'035c70ffb21d1b454ec650e511e76f6bd3fe76f49c471522ee187abac8d0131a18',
Expand All @@ -74,7 +74,7 @@ describe('address', function () {
it('parsing address with 3 ancoring keys and testnet network', () => {
const address = Provider.parseConfigAddress({services: {
'btc_anchoring': {
'anchoring_keys': [
'public_keys': [
'031cf96b4fef362af7d86ee6c7159fa89485730dac8e3090163dd0c282dbc84f22',
'028839757bba9bdf46ae553c124479e5c3ded609495f3e93e88ab23c0f559e8be5',
'035c70ffb21d1b454ec650e511e76f6bd3fe76f49c471522ee187abac8d0131a18'
Expand All @@ -89,7 +89,7 @@ describe('address', function () {
it('parsing address with 3 ancoring keys and main network', () => {
const address = Provider.parseConfigAddress({services: {
'btc_anchoring': {
'anchoring_keys': [
'public_keys': [
'031cf96b4fef362af7d86ee6c7159fa89485730dac8e3090163dd0c282dbc84f22',
'028839757bba9bdf46ae553c124479e5c3ded609495f3e93e88ab23c0f559e8be5',
'035c70ffb21d1b454ec650e511e76f6bd3fe76f49c471522ee187abac8d0131a18'
Expand Down

0 comments on commit 2f3e13d

Please sign in to comment.