[英]truffle test fail when --network flag is set
Below is my truffle.js
file. 以下是我的
truffle.js
文件。 As you can see, development
and privateLive
are exactly the same. 如您所见,
development
和privateLive
完全相同。
// truffle.js
module.exports = {
networks: {
development: {
provider: () => new PrivateKeyProvider(privateKey, sidechainEndpoint),
host: 'http://222.200.180.185',
port: 8545,
network_id: '*', // eslint-disable-line camelcase
from: '0xab2ec9c41aee37c87466fe54194bb88ba5c5ca31'
},
privateLive: {
provider: () => new PrivateKeyProvider(privateKey, sidechainEndpoint),
host: 'http://222.200.180.185',
port: 8545,
network_id: '*', // eslint-disable-line camelcase
from: '0xab2ec9c41aee37c87466fe54194bb88ba5c5ca31'
},
...
}
I have an empty test file test/test.js
. 我有一个空的测试文件
test/test.js
// test/test.js
// empty
Below command succeeds. 下面的命令成功。
$ ./node_modules/truffle/build/cli.bundled.js test test/testp.js
Using network 'development'.
0 passing (1ms)
However, below command fails. 但是,以下命令失败。
$ ./node_modules/truffle/build/cli.bundled.js --network privateLive test test/test.js
Using network 'privateLive'.
Transaction: 0x4d11ca4f12122d8b70ad71bd272ef7fd01a70a96025c3b2249237e5631287507 exited with an error (status 0).
Please check that the transaction:
- satisfies all conditions set by Solidity `require` statements.
- does not trigger a Solidity `revert` statement.
Could anyone tell me what's the difference and why truffle
behaved like that. 谁能告诉我有什么区别,以及
truffle
为什么如此表现。
I also want to know how can I get the reason why transaction failed. 我还想知道如何获取交易失败的原因。 I tried
eth.getTransaction
and eth.getTransactionReceipt
and found nothing helpful. 我尝试了
eth.getTransaction
和eth.getTransactionReceipt
,但发现没有任何帮助。
Thanks a lot. 非常感谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.