Skip to content

Commit

Permalink
Merge pull request #42 from getsafle/dev
Browse files Browse the repository at this point in the history
Adding async call to get transaction Size - merge dev to test
  • Loading branch information
sshubhamagg authored Dec 4, 2023
2 parents 8f446d1 + 3f41775 commit 4ac08e8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,10 @@
- Updated node version in CI
- Updated raw transaction paramaters, amount to be accepted in satoshi
- Added badges
- Updated license in package json
- Updated license in package json

### 2.0.3 (2023-12-04)

##### GetFees() update

- Added await for the async call to get transactionSize and updated tests
4 changes: 2 additions & 2 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
@@ -1,6 +1,6 @@
{
"name": "@getsafle/vault-bitcoin-controller",
"version": "2.0.2",
"version": "2.0.3",
"description": "",
"engines": {
"node": ">= 10"
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class KeyringController {
const sochainURL = SOCHAIN_BASE_URL + `unspent_outputs/${networkType === TESTNET.NETWORK ? 'BTCTEST' : "BTC"}/${from}`
const headers = { "API-KEY": SOCHAIN_API_KEY}

let {transactionSize} = helpers.getTransactionSize(sochainURL, headers)
let { transactionSize } = await helpers.getTransactionSize(sochainURL, headers)

return {
transactionSize,
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('Initialize wallet ', () => {
const acc = await bitcoinWallet.getAccounts()
const result = await bitcoinWallet.getFees(acc[0]);
} catch (err) {
assert.equal(err, "Cannot destructure property 'from' of 'transaction' as it is undefined.", "Should throw TyprError")
assert.equal(err.message, "Request failed with status code 404", "Should throw 404 error")
}

})
Expand Down

0 comments on commit 4ac08e8

Please sign in to comment.