Skip to content

Commit b972fc9

Browse files
committed
Fix getTokenListByName
1 parent d0b87c6 commit b972fc9

File tree

6 files changed

+70
-2
lines changed

6 files changed

+70
-2
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ In order to contribute you can
168168

169169
## Recent History
170170

171+
__2.9.1__
172+
* Fix `trx.getTokenListByName`
173+
174+
__2.9.0__
175+
* Support smart contracts with function that requires an array of addresses as a parameter, included the constructor during the deployment
176+
171177
__2.8.1__
172178
* Add options `keepTxID` to show also the txID when triggering a contract with `shouldPollResponse`
173179

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tronweb",
3-
"version": "2.9.0",
3+
"version": "2.9.1",
44
"description": "JavaScript SDK that encapsulates the TRON HTTP API",
55
"main": "dist/TronWeb.node.js",
66
"scripts": {

pre-commit-result

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test skipped before git commit.

src/lib/trx.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,9 @@ export default class Trx {
12851285
this.tronWeb.fullNode.request('wallet/getassetissuelistbyname', {
12861286
value: this.tronWeb.fromUtf8(tokenID)
12871287
}, 'post').then(token => {
1288-
if (!token.name)
1288+
if (Array.isArray(token.assetIssue)) {
1289+
callback(null, token.assetIssue.map(t => this._parseToken(t)));
1290+
} else if (!token.name)
12891291
return callback('Token does not exist');
12901292

12911293
callback(null, this._parseToken(token));

test-git-hash

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test failed.

test-report

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+

3+
 TronWeb.lib.event
4+
 Trongrid-compatible version
5+
 #getEventsByTransactionID
6+
Sleeping for 0.5 seconds... Slept.
7+
Sleeping for 0.5 seconds... Slept.
8+
Sleeping for 0.5 seconds... Slept.
9+
  ✓ should emit an unconfirmed event and get it (1562ms)
10+
 ✓ should emit an event, wait for confirmation and get it (9139ms)
11+
 #getEventsByContractAddress
12+
 1) should emit an event and wait for it
13+
 #contract.method.watch
14+
 2) should watch for an event
15+
 3) should only watch for an event with given filters
16+
17+
18+
  2 passing (11s)
19+
 3 failing
20+
21+
 1) TronWeb.lib.event
22+
Trongrid-compatible version
23+
#getEventsByContractAddress
24+
should emit an event and wait for it:
25+
 Error: the object {
26+
"error": {
27+
"code": 404
28+
"status": "Not Found"
29+
}
30+
} was thrown, throw an Error :)
31+
at processTicksAndRejections (internal/process/task_queues.js:93:5)
32+

33+
 2) TronWeb.lib.event
34+
Trongrid-compatible version
35+
#contract.method.watch
36+
should watch for an event:
37+
 Error: the object {
38+
"error": {
39+
"code": 404
40+
"status": "Not Found"
41+
}
42+
} was thrown, throw an Error :)
43+
at processTicksAndRejections (internal/process/task_queues.js:93:5)
44+

45+
 3) TronWeb.lib.event
46+
Trongrid-compatible version
47+
#contract.method.watch
48+
should only watch for an event with given filters:
49+
 Error: the object {
50+
"error": {
51+
"code": 404
52+
"status": "Not Found"
53+
}
54+
} was thrown, throw an Error :)
55+
at processTicksAndRejections (internal/process/task_queues.js:93:5)
56+

57+
58+

0 commit comments

Comments
 (0)