Skip to content

Commit 0c4676f

Browse files
authored
Merge pull request #186 from tronprotocol/feature/3.2.0
Feature/3.2.0
2 parents eb005e8 + 38313c2 commit 0c4676f

File tree

158 files changed

+35538
-4061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+35538
-4061
lines changed

.eslintrc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
},
77
"globals": {},
88
"rules": {
9-
"semi": [
10-
2,
11-
"never"
12-
],
139
"quotes": [
1410
2,
1511
"single",
@@ -110,5 +106,21 @@
110106
"extends": [
111107
"eslint:recommended",
112108
"plugin:node/recommended"
109+
],
110+
"overrides": [
111+
{
112+
"files": ["./test/**/*.js"],
113+
"env": {
114+
"mocha": true
115+
},
116+
"globals": {
117+
"tronWeb": "readonly",
118+
"tronWrap": "readonly",
119+
"assert": "readonly",
120+
"expect": "readonly",
121+
"artifacts": "readonly",
122+
"contract": "readonly"
123+
}
124+
}
113125
]
114126
}

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"tabWidth": 2,
3+
"semi": true,
4+
"printWidth": 120,
5+
"arrowParens": "avoid",
6+
"trailingComma": "none",
7+
"bracketSpacing": true,
8+
"singleQuote": true,
9+
"quoteProps": "as-needed"
10+
}

CHANGELOG.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
__3.2.0__
2+
* Add support `deployProxy`, `deployBeacon` and `deployBeaconProxy` of `@openzeppelin/truffle-upgrades` in migrations
3+
4+
```javascript
5+
const { deployProxy } = require('@openzeppelin/truffle-upgrades');
6+
const Box = artifacts.require('TransparentBox');
7+
8+
module.exports = async function (deployer) {
9+
try {
10+
// Setup tronbox deployer
11+
deployer.trufflePlugin = true;
12+
const instance = await deployProxy(Box, [42], { deployer });
13+
console.info('Deployed', instance.address);
14+
} catch (error) {
15+
console.error('Transparent: deploy box error', error);
16+
}
17+
}
18+
19+
```
120
__3.1.2__
221
* Add support for Solidity compiler 0.8.18
322

@@ -30,39 +49,39 @@ __3.0.0__
3049
* Add `tre_unlockedAccounts` RPC method. The method can set up any arbitrary account to impersonate during development.
3150

3251
`tre_setAccountBalance`:
33-
```js
52+
```javascript
3453
const address = "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL";
3554
const balance = "0x3e8";
3655
const result = await tronWrap.send("tre_setAccountBalance", [address, balance]);
3756
console.log(result);
3857
```
3958
`tre_setAccountCode`:
40-
```js
59+
```javascript
4160
const address = "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL";
4261
const data = "0xbaddad42";
4362
const result = await tronWrap.send("tre_setAccountCode", [address, data]);
4463
console.log(result);
4564
```
4665
`tre_setAccountStorageAt`:
47-
```js
66+
```javascript
4867
const address = "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL";
4968
const slot = "0x0000000000000000000000000000000000000000000000000000000000000005";
5069
const data = "0xbaddad42";
5170
const result = await tronWrap.send("tre_setAccountStorageAt", [address, slot, data]);
5271
console.log(result);
5372
```
5473
`tre_blockTime`:
55-
```js
74+
```javascript
5675
const result = await tronWrap.send("tre_blockTime", [3]);
5776
console.log(result);
5877
```
5978
`tre_mine`:
60-
```js
79+
```javascript
6180
const result = await tronWrap.send("tre_mine", [{ blocks: 5}]);
6281
console.log(result);
6382
```
6483
`tre_unlockedAccounts`:
65-
```js
84+
```javascript
6685
const result = await tronWrap.send("tre_unlockedAccounts", [["TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL"]]);
6786
console.log(result);
6887
```

package-lock.json

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

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tronbox",
33
"namespace": "tronprotocol",
4-
"version": "3.1.2",
4+
"version": "3.2.0",
55
"description": "TronBox - Simple development framework for Tron",
66
"keywords": [
77
"TronBox",
@@ -12,9 +12,10 @@
1212
],
1313
"scripts": {
1414
"build": "scripts/build.sh",
15-
"test": "echo \"Error: tests will be fixed soon in a new release\" && exit 1",
15+
"test": "npm run build && cd test && sh runTest.sh",
1616
"prepare": "npm run build",
17-
"lint": "find src -name '*.js' | xargs node_modules/.bin/eslint"
17+
"lint": "find src -name '*.js' | xargs node_modules/.bin/eslint",
18+
"format": "prettier --write \"src/**/*.js\" \"test/**/*.js\""
1819
},
1920
"dependencies": {
2021
"@truffle/contract-sources": "^0.1.6",
@@ -59,6 +60,8 @@
5960
"temp": "^0.8.3",
6061
"tronweb": "^5.1.0",
6162
"vcsurl": "^0.1.1",
63+
"web3": "1.2.1",
64+
"web3-eth-contract": "1.2.1",
6265
"web3-mock": "1.0.1",
6366
"yargs": "^15.4.1"
6467
},
@@ -75,6 +78,7 @@
7578
"meta-pkgs": "^0.2.0",
7679
"moment": "^2.24.0",
7780
"prepend-file": "^1.3.1",
81+
"prettier": "^2.8.5",
7882
"shebang-loader": "0.0.1",
7983
"stream-buffers": "^3.0.1",
8084
"tmp": "0.0.33",

signature.json

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
{
2020
"path": ".eslintrc",
21-
"sha512": "b3d4a79e7d428ed8cffc1045928fd28bac36153b811db30f5ed1dd27b6d8f1f62649c18e9c33ada948870f68b1bc109bc30935762b886c79859cc125c761683c"
21+
"sha512": "707b766eb318efe16596da9c1d9db132f0253abb81167d34420881f2bbd997207ae868aa359dcd70d5eaa242f7d90d16ab6ca294a58e97070b30a33186d9816a"
2222
},
2323
{
2424
"path": ".gitmodules",
@@ -34,11 +34,11 @@
3434
},
3535
{
3636
"path": "tronbox.dev",
37-
"sha512": "e57be8cfde455dd62d36946b8b43dcb093c7b95c49bada62c54be4033e5241f5eacdf911c8277802ccdb773e4c47e5ce9ec0cbec04189fe1bd6494e51354cc94"
37+
"sha512": "13fe0333dee3361ad3f242dea9f3f7ccffdb072946bd7d31d94c542309843ce1954f37c8321120f0cf7e9a759529b695410c4a91acc15f0a941f1a5e61937d5c"
3838
},
3939
{
4040
"path": "build/components/Artifactor.js",
41-
"sha512": "7b9f312a439a832dcbf27b680286ee42bf5db460ac56a68a6b5de94e8ff8121f82f5c33cf59bb7f56831eda14aad9157f3c000e5d7d79a9ff397e7a59f711a0b"
41+
"sha512": "03d978e6f34c7d3951abbef6d35e7a7075d7a28b5f5f078bc5453ec26d0c2f299971136192e32aff345c0fe94264ecb7ec38d6e2dd30a86af7f569962e1aea3c"
4242
},
4343
{
4444
"path": "build/lib/assertions.js",
@@ -94,7 +94,7 @@
9494
},
9595
{
9696
"path": "build/components/Contract/contract.js",
97-
"sha512": "201d09d5d2eba28c8945288ed9699051c74bad41e36ff9d103918b0db13b15be4708e83e7128307f4a4948cfbf4a68f3ce5cbcff7a4040f9a4ea6f578863cccf"
97+
"sha512": "43e64d1fbd72c2793d70de911658aeb15a3789f0cebcabdc8bac0067bf7935d899dae430596210dda123e7d1a6cfd3b895c43700c0be60d36c77a9cb03ae1eed"
9898
},
9999
{
100100
"path": "build/lib/commands/convert.js",
@@ -114,7 +114,7 @@
114114
},
115115
{
116116
"path": "build/components/Deployer/src/actions/deploy.js",
117-
"sha512": "1063ec7fc2558bad344af427b4aeb2ab4a1ee7e96ca55e19c742768f238db8c4512d7a816bea3fc172c6cf517f0bd9f5fd237a59feed118fb6298950187cba22"
117+
"sha512": "290b4283d0e517e676355881d5139259367f5d178541648a4bd6c53ff0ecc20b6689f8d1d716b76a0626e260545b5dceab66fca0dd082d4793b819ca0c2ccd14"
118118
},
119119
{
120120
"path": "build/lib/commands/deploy.js",
@@ -154,7 +154,7 @@
154154
},
155155
{
156156
"path": "build/components/Resolver/fs.js",
157-
"sha512": "b7bd5235b378882708d446e860c3820a5477a3c18c516dfece17726a3ecd213271f079075484a8575fda3877dd927cab6bafa3baf989f56743025dc949eb4ae3"
157+
"sha512": "4acbff7ba08e0b9273401fabb3451a27ba2c96494cc3cc9a0fc4fdccda21b267d7c0a86f6164046940dc496b596f58833c7b1007867d604e97ba153556018ca9"
158158
},
159159
{
160160
"path": "build/components/Box/index.js",
@@ -178,23 +178,23 @@
178178
},
179179
{
180180
"path": "build/components/Deployer/index.js",
181-
"sha512": "2d389e9c79121caae22c1a3548d590e6ac9a54248e94d55ecf059b9bffa927330f5c52a91b818fb5674d00fbfb331a40b0381edb73be080579c434224f3766d4"
181+
"sha512": "414538160496fe324feaa5ed1360b0bdb4655e6a19d4992aa0a11b437468c4ed5b63e7fb72ea3df0155e5d3fd159da5047b2817496ce404c324c27470fd111fb"
182182
},
183183
{
184184
"path": "build/components/Migrate/index.js",
185-
"sha512": "30296022fb90824a56a60368ec5e309a081c967af5ac95e8d60189a2017197878836a1803f78aec35b557ff1b02e9e28fb06f7f3ff8334b82e8e6d3cf35f47eb"
185+
"sha512": "ff62a151fd6741bebda0e2e928415d59f21648e861bea9cfca345f62105be1dbc1f7c4990cfcd233dd2ce3fc853940c8d4618c8d9e13520d3ef4e5afda22a885"
186186
},
187187
{
188188
"path": "build/components/Provider/index.js",
189-
"sha512": "07ae64651c5b1b6b63ef2559f00040f89a8ef3e851414e4e422f0b363ce0cd9b43bfe8232dbe92f6c88f4013355d12bd1bd8fccc5b760e1e631c72c3e38e376b"
189+
"sha512": "4976e5c5eefdb96fbdcb3ee1ca67a8f492402eb65fd93026be9b432df2fa4568f7454f333cd05f298a970e3fe03dba00ecc4da11800bb51ed2ac563838e177c8"
190190
},
191191
{
192192
"path": "build/components/Resolver/index.js",
193193
"sha512": "112fa237983f670c487eb270f64d8c3a84529d8ca5da64dab6cbd7e5645fa5f88a3b857be32337ef455df90bc0da21324919145847ac2a9d59be2442e5336b52"
194194
},
195195
{
196196
"path": "build/components/TronWrap/index.js",
197-
"sha512": "01df594886dc575616c68e1161f774a29c66094e22a6d8be43b31f7bfd87a7de99d30bf10da19998d68fb373deb152323ca76b11850437afca2673962b4eef66"
197+
"sha512": "17d3ca3fc6521e16c1c0751da78feb2e90556c939e40136879a51d3f38f2e5759f4dd392eb77cb415b0466e92f2c12b47efab28b6a88f745a6d8cb79bd774a8d"
198198
},
199199
{
200200
"path": "build/index.js",
@@ -222,7 +222,7 @@
222222
},
223223
{
224224
"path": "build/lib/commands/migrate.js",
225-
"sha512": "ae4489a6a9d3be212421d350127557cdd499e1945e77e7c4b882da6b0651b0263b620be6bea574c66b2f3fd71ad82116f178818eed9c701b60aa39d3cc5085c3"
225+
"sha512": "7969ee25a6e06d79fdaa44bd6cbe26080d0a7c441305d6f0eb35a6ee85111b0581b419ccada880c9d12bb31bbba7b08817af587355f52039f7b124ec6c28d5aa"
226226
},
227227
{
228228
"path": "build/lib/networks.js",
@@ -266,7 +266,7 @@
266266
},
267267
{
268268
"path": "build/components/Require.js",
269-
"sha512": "0b3c09fb7fdcecd4a40e2f9d2d31d1fec1224f5c65389652b85497ee5b6eb6bc72e046eff9cb89078490ce02943784c3b7213904c7411374816f7e369a5c2db8"
269+
"sha512": "8d9d88ec45cdafc4775b2240971b89ce299de65efe5b5750b2abad5465e500081f51640412fbf7b503146485147ebca3666b750365a9825374ac9e43c53478b8"
270270
},
271271
{
272272
"path": "build/components/Migrate/resolverintercept.js",
@@ -294,7 +294,7 @@
294294
},
295295
{
296296
"path": "build/lib/test.js",
297-
"sha512": "ad132bbb8fba024b48e9779ca85bb07e8deccf3a5898728b9f2007e6e316ec7396cbe8b25158b2e21ba8c036033ce078b16238c58bf6395c8afd59515b3a2078"
297+
"sha512": "d38b628281cad551d154b5226566cbf00003b0929fa1192748ed85d269c7da256752b4ab214baaf89e7d31824ca76f7f4c38d29f98d8267ec6bf55131f240787"
298298
},
299299
{
300300
"path": "build/lib/testing/testresolver.js",
@@ -348,6 +348,10 @@
348348
"path": "build/components/Provider/wrapper.js",
349349
"sha512": "d4c09bab42293ee7b45ded0bd50826077edd196b4e641a5867925105f391ee728714956b7f16de314ba7d697ed422b2646e3b669bd9af68cf6e2270c2c45c989"
350350
},
351+
{
352+
"path": ".prettierrc.json",
353+
"sha512": "08dfecf5e9d862f5e2b7f5b5513b6d3c8c825c1ddcd8d82792491ac5af968342b024f450784db5211a77d232a3c7c4989c64d65ac6b8493fe0698dedec89a9b7"
354+
},
351355
{
352356
"path": "build/components/ContractSchema/spec/abi.spec.json",
353357
"sha512": "72dea23794dc88b6757b78d62f3906f2998a6a6c2416a45d8f4ab6786cc873ff2dd7721147f6c0ae87348d094043de2bdb8a4b5ae7a5e6617b42b1d10de9ecf8"
@@ -362,7 +366,7 @@
362366
},
363367
{
364368
"path": "CHANGELOG.md",
365-
"sha512": "2a406aafab0806d0db30509ca72815adb053d9c6a195fd3984f6c0b2eaa66e1332ba5969a47a7382b278eac91490141f998578ef0e392e02828f98828feef809"
369+
"sha512": "6510147181272b08c4d3a6ec84c7a771f8dcb7c0023edcfa1836c4df193dcca0ee3a54fd0df624903ca7db064b8d1297bfef607e70b2a131d634e6557500c8e1"
366370
},
367371
{
368372
"path": "CONTRIBUTING.md",
@@ -412,7 +416,7 @@
412416
"scripts",
413417
"version"
414418
],
415-
"sha512": "2a4a35156f25bafb0ae5d0f1536b90e87ac8033dc5b9c8bed2ec2d4fd0cd084da2f4bfacbeeb93f8850bfd878b835390ba170665b2c325ec6112b37508e6d9b5"
419+
"sha512": "983e96d70d540848bd39a179322a6dec5811e052a8dc3770a01b0457995d7cac4bf7c8f23dea4e73803d161cff0ca2b6290c2339ee55d8752f36f08a7974e831"
416420
}
417421
},
418422
{
@@ -421,7 +425,7 @@
421425
"packageJson": {
422426
"name": "tronbox",
423427
"namespace": "tronprotocol",
424-
"version": "3.1.2",
428+
"version": "3.2.0",
425429
"description": "TronBox - Simple development framework for Tron",
426430
"keywords": [
427431
"TronBox",
@@ -432,9 +436,10 @@
432436
],
433437
"scripts": {
434438
"build": "scripts/build.sh",
435-
"test": "echo \"Error: tests will be fixed soon in a new release\" && exit 1",
439+
"test": "npm run build && cd test && sh runTest.sh",
436440
"prepare": "npm run build",
437-
"lint": "find src -name '*.js' | xargs node_modules/.bin/eslint"
441+
"lint": "find src -name '*.js' | xargs node_modules/.bin/eslint",
442+
"format": "prettier --write \"src/**/*.js\" \"test/**/*.js\""
438443
},
439444
"dependencies": {
440445
"@truffle/contract-sources": "^0.1.6",
@@ -479,6 +484,8 @@
479484
"temp": "^0.8.3",
480485
"tronweb": "^5.1.0",
481486
"vcsurl": "^0.1.1",
487+
"web3": "1.2.1",
488+
"web3-eth-contract": "1.2.1",
482489
"web3-mock": "1.0.1",
483490
"yargs": "^15.4.1"
484491
},
@@ -495,6 +502,7 @@
495502
"meta-pkgs": "^0.2.0",
496503
"moment": "^2.24.0",
497504
"prepend-file": "^1.3.1",
505+
"prettier": "^2.8.5",
498506
"shebang-loader": "0.0.1",
499507
"stream-buffers": "^3.0.1",
500508
"tmp": "0.0.33",
@@ -541,5 +549,5 @@
541549
}
542550
}
543551
],
544-
"signature": "-----BEGIN PGP SIGNATURE-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nwsFzBAEBCAAGBQJj/yD5ACEJEAEScGf7i0tYFiEEuL4l7hUU5AsLzHjPARJw\nZ/uLS1ijqhAAn/tQaQGLhGthGxCwPsr266xe/DBW4Ce+eNSg3LKjRCVh9IMZ\nKwHzLXcQLQRrat3H37zjOn4NmYpnHKwAfsgOJbt3zBGGRYOg4FN0t9rk7N5N\n39zBO7L34n1KFBzGuY/8ynHR0eu+f9C7APP8H0Zdb+EF7aHMdMDAJg2tBy56\n21tcEEG8Mwxo4+XFAO+onED22HimhGt01lUNG1K5LD4UxvQTNY/IA6Enmfc3\nwthpyLyaqp4Lje4E2k3cLon4tLqKQk4kEEz2AYWhC41yGtw7xXbvJhgI6ejZ\nRvab6IqjM0AbrCak1PCJ32yZbXUkPXn8pFPEAQjxtWaDEQbEQfV0gX+KmI0C\nE+xs51VCfB3/eHMd43EhMcD67pKXZucPSfpNnGNAm8Lhfv+4EbU7FDTbVMwo\n3EVgflwd/WAQgbcIMZbeqXm8xG8V8qCYeJaMAP/YBP0hPtROn0t6oTsljyRU\nowLDu4UDfcDJ8zlYtb2YaBP6ihVzJFp1pnLxWAFyI/RXfba56RO9CKmK0xB0\neHF95EPluB9n7OQpwVJeWGom5QbOxche0Uvk71PXyDlmpgTY9Ryo2It/iZBm\n7GUo+MVOwaV7MU5nEfx8ajz9gYjQdxZVOsDYbeKv514/Uajq8TqjYKCBgoah\nhTnYEbN4gooib/am9MlNi278zrfH6UpsNbk=\n=t4hP\n-----END PGP SIGNATURE-----\n"
552+
"signature": "-----BEGIN PGP SIGNATURE-----\nVersion: OpenPGP.js v4.10.10\nComment: https://openpgpjs.org\n\nwsFzBAEBCAAGBQJkGsiHACEJEAEScGf7i0tYFiEEuL4l7hUU5AsLzHjPARJw\nZ/uLS1jUPBAAoupBH+7gzMs3cg3Gz57uQFFBTDYk+1AKft2skiNPHDVfj+Mx\n/uG98eEI0ffKAvsaFS6OzUSdn0WeA8eV110HDA9e4zMJR05kIv2VcF1c54md\n3gg/3gt4DhO6NiD9nM45CKIsywlNBHpTzpSwEDVePovKw7IBcrlE4KBwjXsl\ng/1zOrQ6V+aFpCYR+IBLQwBSycqbGtBSrp92Cg1/xwssrIq7C/CNI5TUnnLe\nyBDNEZQ5ZjO3me8w0q38KUJI3TphzTg+n2+D08Fa2MliQDFCb7C67NCwHBVO\nO89OPur4mCqWgZ4l9lxx4lCYxVfGq1lHx8ewcjwncMwJfWETFUWzclb2bF+0\nyzZsh4DLZpN3vyYOM2AUzGzc1g2peiB7V6X0nIEp19R2kdSgW/A1N11G7KRP\niZvpAwuBmqZSEsRRnFJvyGa/ZVJ5/Qxv2jjzcu9JULBT/bbGgmFxHFTEaneq\nV+XgthUVjh7aHK5A7lSyZmO/o5EwqKtiwUKZK1LZn/SudRHKlDy3l+z2JTzh\nguV/qaROQ7cADj3prR5QaWGdcIXqt8S8U3lmuhBwe/dX7Wf91y7mF83Rcvf8\nxvgovc5U9nkbLHiec+u2KpuBq8EJuPbtdFx1oUTAqGpc7xGF8RdBXZzijZnM\noYbeNYMJSzE3DgwzGz8j5q0FzpLezk1RSeY=\n=s3mS\n-----END PGP SIGNATURE-----\n"
545553
}

0 commit comments

Comments
 (0)