Skip to content

Commit d4c3663

Browse files
committed
test(address): Merge master
2 parents 7594ecb + 9c6ea18 commit d4c3663

File tree

6 files changed

+339
-1
lines changed

6 files changed

+339
-1
lines changed

dist/web3data.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web3data.min.js.map

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,39 @@ includePrice: true
12381238

12391239

12401240

1241+
#### getAll(filterOptions)
1242+
1243+
1244+
See 'getTransactions' for details.
1245+
1246+
1247+
1248+
1249+
##### Parameters
1250+
1251+
| Name | Type | Description | |
1252+
| ---- | ---- | ----------- | -------- |
1253+
| filterOptions | | |   |
1254+
1255+
1256+
1257+
1258+
##### Examples
1259+
1260+
```javascript
1261+
1262+
```
1263+
1264+
1265+
##### Returns
1266+
1267+
1268+
- `Void`
1269+
1270+
1271+
1272+
1273+
12411274
#### getTransaction(hash, filterOptions)
12421275

12431276

src/transaction.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ class Transaction {
4848
}).then(onFulfilled.bind({formatter: recordsFormatter}), onError)
4949
}
5050

51+
/**
52+
* See 'getTransactions' for details.
53+
*
54+
* @param filterOptions
55+
* @example
56+
*/
57+
getAll(filterOptions) {
58+
return this.getTransactions(filterOptions)
59+
}
60+
5161
/**
5262
* Retrieves the transaction data for the specified hash.
5363
*

test/recordings/transaction_1963546403/recording.har

Lines changed: 279 additions & 0 deletions
Large diffs are not rendered by default.

test/transaction.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ test('Successfully calls getTransactions - with filters', async t => {
8383
t.is(pendingTxn.statusResult.name, 'pending')
8484
})
8585

86+
/*********** Test getAll() ***********/
87+
test('Successfully calls getAll', async t => {
88+
const [txn] = await t.context.web3data.transaction.getAll()
89+
t.true(txn.hasProp('hash'))
90+
})
91+
test('Successfully calls getAll - with filters', async t => {
92+
const [pendingTxn] = await t.context.web3data.transaction.getAll({status: 'pending'})
93+
t.true(pendingTxn.hasProp('statusResult'))
94+
t.true(pendingTxn.statusResult.hasProp('name'))
95+
t.is(pendingTxn.statusResult.name, 'pending')
96+
})
97+
8698
/*********** Test getTransaction() ***********/
8799
test(rejectsPromise, {method: 'getTransaction'}, NO_HASH)
88100
test('Successfully calls getTransaction', async t => {

0 commit comments

Comments
 (0)