Skip to content

Commit

Permalink
fix date parsing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloKashif committed Oct 14, 2020
1 parent d4d118d commit e4a6b4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/asgardex-bitcoin/__tests__/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('BitcoinClient Test', () => {
const txPages = await btcClient.getTransactions({ address:addyThree, limit: 4 })
expect(txPages.total).toEqual(1)
expect(txPages.txs[0].asset).toEqual(AssetBTC)
expect(txPages.txs[0].date).toEqual(new Date("2020-10-07T16:28:33.000Z"))
expect(txPages.txs[0].date).toEqual(new Date("2020-10-08T01:28:33.000Z"))
expect(txPages.txs[0].hash).toEqual('63fe21150a285bd4c4266e6e3aafe5d99cc76eafb8e92a0c0b2896d3c3a21c78')
expect(txPages.txs[0].type).toEqual('transfer')
expect(txPages.txs[0].to.length).toEqual(2)
Expand Down
2 changes: 1 addition & 1 deletion packages/asgardex-bitcoin/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class Client implements BitcoinClient, AsgardexClient {
asset: AssetBTC,
from: rawTx.inputs.map((i) => ({ from: i.recipient, amount: baseAmount(i.value) })),
to: rawTx.outputs.map((i) => ({ to: i.recipient, amount: baseAmount(i.value) })),
date: new Date(rawTx.transaction.time),
date: new Date(`${rawTx.transaction.time} UTC`), //blockchair api doesn't append UTC so need to put that manually
type: 'transfer',
hash: rawTx.transaction.hash,
}
Expand Down

0 comments on commit e4a6b4c

Please sign in to comment.