@omisego/omg-js-childchain
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "@omisego/omg-js-childchain", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Module to interact with OMG ChildChain", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "96445b5c2197d63dabf93da9484934c26d8fd689" | ||
"gitHead": "80ba66efc5e93f05ca69772edb7cec127ae38b27" | ||
} |
@@ -83,2 +83,8 @@ /* | ||
async getChallengeData (utxo) { | ||
// Calculate the utxoPos | ||
const utxoPos = transaction.encodeUtxoPos(utxo) | ||
return watcherApi.get(`${this.watcherUrl}/utxo/${utxoPos}/challenge_data`) | ||
} | ||
/** | ||
@@ -85,0 +91,0 @@ * Create an unsigned transaction |
@@ -17,2 +17,3 @@ /* | ||
const { InvalidArgumentError } = require('@omisego/omg-js-util') | ||
const Web3Utils = require('web3-utils') | ||
@@ -25,3 +26,3 @@ const MAX_INPUTS = 2 | ||
const BLOCK_OFFSET = 1000000000 | ||
const BLOCK_OFFSET = Web3Utils.toBN(1000000000) | ||
const TX_OFFSET = 10000 | ||
@@ -108,3 +109,5 @@ | ||
function encodeUtxoPos (utxo) { | ||
return BLOCK_OFFSET * utxo.blknum + TX_OFFSET * utxo.txindex + utxo.oindex | ||
const blk = Web3Utils.toBN(utxo.blknum).mul(BLOCK_OFFSET) | ||
const tx = Web3Utils.toBN(utxo.txindex).muln(TX_OFFSET) | ||
return blk.add(tx).addn(utxo.oindex) | ||
} | ||
@@ -111,0 +114,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
37660
13
734
4