Skip to content

Commit

Permalink
[ECR-1960] all else tests fixed
Browse files Browse the repository at this point in the history
transactions valid tests fix
transactions invalid tests fixed
blocks-valid test fixed
blocks-invalid tests fixed
checkBlockChain tests fixed
  • Loading branch information
qvantor committed Jul 27, 2018
1 parent 96685b5 commit b4aec95
Show file tree
Hide file tree
Showing 32 changed files with 3,653 additions and 13,720 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.6.0 (Jul 26, 2018)

* Added Exonum 0.9 support. #42 #35
* Added Smartbit API provider. #42
* Removed BlockTrail API and BTC.COM API provider. #42

## 0.5.1 (Jul 20, 2018)

* Add BlockCypher API provider. #27 #28 #29 #31 #32 #33 #34 #36
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,12 @@ Driver is a class, which provides
([anchoring transactions](https://exonum.com/doc/advanced/bitcoin-anchoring/))
from Bitcoin blockchain by using HTTP API.

By default there are two drivers are implemented:
By default there is one driver is implemented:

- [BTC.com API](https://chain.api.btc.com/)
- [BlockCypher API](https://www.blockcypher.com/dev/bitcoin/)
- [Smartbit API](https://smartbit.com.au/api)

If you need a driver for another HTTP API,
you can implement it yourself by extending the Driver class. See [example](#driver-example) to get details.
you can implement it yourself by extending the Driver class. For this purpose use API with Bech32 addresses support. See [example](#driver-example) to get details.

#### Provider

Expand All @@ -88,9 +87,9 @@ blockchain by using HTTP API.
import exonum from 'exonum-client-anchoring'

const config = {
driver: exonum.drivers.BtcDotCom({
token: 'TOKEN' // Your BTC.com API Token here. Required
version: 'v3' // Version of BTC.com API. Optional
driver: exonum.drivers.Smartbit({
network: 'testnet', // use testnet for testnet, mainnet by default
version: 'v1' // Version of smartbit API. Optional
}),
provider: {
nodes: ['http://192.168.1.1:8000', 'http://192.168.1.2:8000'] // list of IP addresses of Exonum nodes
Expand Down Expand Up @@ -201,7 +200,8 @@ according to provider limitations.

## Driver example

Here you can see an example of a driver to [BTC.com API](https://btc.com/api-doc#API):
Here you can see an example of a driver to [BTC.com API](https://btc.com/api-doc#API).
This driver is provided for your information only, but non-operating because it doesn't support Bech32 addresses:

```js
import { drivers } from 'exonum-client-anchoring'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exonum-client-anchoring",
"version": "0.5.1",
"version": "0.6.0",
"description": "Exonum anchoring check library",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/Anchoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function Anchoring (params) {

const tx = await _(this).provider.getTx(txHash)
if (tx.type === 'MemPool') return status.transaction(9, { tx })
const rootHash = merkleRootHash(tx.proof_to_block_merkle_root)
const rootHash = merkleRootHash(tx.location_proof)

const block = await this.blockStatus(tx.location.block_height, ignoreBlockProof)
const proof = { block, tx }
Expand Down
34 changes: 0 additions & 34 deletions src/drivers/BlockCypher.driver.js

This file was deleted.

32 changes: 0 additions & 32 deletions src/drivers/BtcDotCom.driver.js

This file was deleted.

4 changes: 1 addition & 3 deletions src/drivers/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import BtcDotCom from './BtcDotCom.driver'
import BlockCypher from './BlockCypher.driver'
import Smartbit from './Smartbit.driver'
import Driver from './Driver'

export default { BlockCypher, BtcDotCom, Smartbit, Driver }
export default { Smartbit, Driver }
45 changes: 0 additions & 45 deletions test/btc-network/blockcypher/anchoring-configs.test.js

This file was deleted.

56 changes: 0 additions & 56 deletions test/btc-network/blockcypher/anchoring-events.test.js

This file was deleted.

57 changes: 0 additions & 57 deletions test/btc-network/blockcypher/anchoring-load.test.js

This file was deleted.

44 changes: 0 additions & 44 deletions test/btc-network/btcdotcom/anchoring-configs.test.js

This file was deleted.

Loading

0 comments on commit b4aec95

Please sign in to comment.