Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

tronbox migrating can not use the .at(contract address) #63

Open
bigopher opened this issue Dec 16, 2018 · 7 comments
Open

tronbox migrating can not use the .at(contract address) #63

bigopher opened this issue Dec 16, 2018 · 7 comments
Labels
enhancement New feature or request

Comments

@bigopher
Copy link

when writing following migratation script in tronbox, there will happen to some error. but that can work well in truffle, please check it, thanks!
let a = await A.at('4174ca9d500f00601b8e1db69734c05e04b7b67be8');

the errors show that:
(node:3722) UnhandledPromiseRejectionWarning: TypeError: this.getContract is not a function
at TronWrap.tronWrap._getContract (/usr/local/Cellar/node/11.2.0/lib/node_modules/tronbox/build/webpack:/packages/tronwrap/index.js:135:1)
at /usr/local/Cellar/node/11.2.0/lib/node_modules/tronbox/build/webpack:/packages/truffle-contract/contract.js:413:1
at new Promise ()
at /usr/local/Cellar/node/11.2.0/lib/node_modules/tronbox/build/webpack:/packages/truffle-contract/contract.js:412:1
at new Promise ()

@sullof sullof added the bug Something isn't working label Dec 16, 2018
@MioGreen
Copy link

@sullof do you have any recommendation on how we can do .at function right now?

@sullof
Copy link
Contributor

sullof commented Dec 18, 2018

Can you point me to some sample code to replicate the error?

@sullof
Copy link
Contributor

sullof commented Dec 18, 2018

@bigopher @MioGreen
I just released a debug version of TronBox. Can you install it with

npm i -g tronbox-stage@latest

and use it as usual?

tronbox-stage test

and let me know if it works?
If so, I will propagate the fix to the main version.

@MioGreen
Copy link

@sullof I've received a new error:

(node:24235) UnhandledPromiseRejectionWarning: TypeError: code.replace is not a function
at /usr/local/lib/node_modules/tronbox-stage/build/webpack:/packages/truffle-contract/contract.js:416:1
at /usr/local/lib/node_modules/tronbox-stage/build/webpack:/packages/tronwrap/index.js:149:1
at
at process._tickCallback (internal/process/next_tick.js:188:7)

@sullof
Copy link
Contributor

sullof commented Dec 18, 2018

Can you post some code that allows me to replicate the issue, please?

@bigopher
Copy link
Author

same the error to the description from MioGreen

@sullof
Copy link
Contributor

sullof commented Mar 26, 2019

I think the problem is that TronBox artifacts don't support .at(address). If you need that, you must use TronWeb.
We could add support for .at and .new in the future. I am leaving this issue opened as a reminder.

@sullof sullof added enhancement New feature or request and removed bug Something isn't working labels Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants