This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2341 from trufflesuite/update-packages
Internal improvement: Update packages
- Loading branch information
Showing
42 changed files
with
70 additions
and
65 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions
10
packages/truffle-require/package.json → packages/require/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var path = require("path"); | ||
var module_with_global_require = require(path.join( | ||
__dirname, | ||
"module_with_global_require.js" | ||
)); | ||
|
||
module.exports = function() { | ||
return module_with_global_require; | ||
}; |
2 changes: 1 addition & 1 deletion
2
...t/lib/module_with_local_module_require.js → ...t/lib/module_with_local_module_require.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,64 @@ | ||
const TruffleContract = require('truffle-contract'); | ||
const workflow = require('truffle-workflow-compile'); | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
const TruffleContract = require("truffle-contract"); | ||
const workflow = require("@truffle/workflow-compile"); | ||
const path = require("path"); | ||
const fs = require("fs-extra"); | ||
|
||
const utils = { | ||
|
||
miningId: null, | ||
|
||
// Constants | ||
zeroAddress: '0x0000000000000000000000000000000000000000', | ||
zeroAddress: "0x0000000000000000000000000000000000000000", | ||
|
||
// Paths | ||
buildDir: path.join(__dirname, '../build'), | ||
sourcesDir: path.join(__dirname, '../sources'), | ||
buildDir: path.join(__dirname, "../build"), | ||
sourcesDir: path.join(__dirname, "../sources"), | ||
|
||
compile: async function(){ | ||
const config = { | ||
compile: async function() { | ||
const config = { | ||
contracts_build_directory: utils.buildDir, | ||
contracts_directory: utils.sourcesDir | ||
}; | ||
|
||
return new Promise((accept, reject) => { | ||
workflow.compile(config, err => err ? reject(err) : accept()); | ||
workflow.compile(config, err => (err ? reject(err) : accept())); | ||
}); | ||
}, | ||
|
||
evm_mine: function(web3){ | ||
return new Promise(function(accept, reject){ | ||
web3.currentProvider.send({ | ||
jsonrpc: "2.0", | ||
method: "evm_mine", | ||
id: new Date().getTime() | ||
}, function(err, result){ | ||
(err) ? reject(err) : accept(result); | ||
}); | ||
evm_mine: function(web3) { | ||
return new Promise(function(accept, reject) { | ||
web3.currentProvider.send( | ||
{ | ||
jsonrpc: "2.0", | ||
method: "evm_mine", | ||
id: new Date().getTime() | ||
}, | ||
function(err, result) { | ||
err ? reject(err) : accept(result); | ||
} | ||
); | ||
}); | ||
}, | ||
|
||
startAutoMine: function(web3, interval){ | ||
utils.miningId = setInterval(async() => { | ||
startAutoMine: function(web3, interval) { | ||
utils.miningId = setInterval(async () => { | ||
await utils.evm_mine(web3); | ||
}, interval); | ||
}, | ||
|
||
stopAutoMine: () => clearInterval(utils.miningId), | ||
|
||
waitMS: async (ms) => new Promise(resolve => setTimeout(() => resolve(), ms)), | ||
waitMS: async ms => new Promise(resolve => setTimeout(() => resolve(), ms)), | ||
|
||
cleanUp: () => fs.removeSync(utils.buildDir), | ||
|
||
getContract: function(name, provider, networkId, account){ | ||
getContract: function(name, provider, networkId, account) { | ||
const json = require(`../build/${name}`); | ||
const contract = TruffleContract(json); | ||
contract.setProvider(provider); | ||
contract.setNetwork(networkId); | ||
contract.defaults({ from: account }); | ||
return contract; | ||
}, | ||
} | ||
}; | ||
|
||
module.exports = utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/truffle-require/test/lib/module_with_local_file_require.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
packages/truffle-workflow-compile/README.md → packages/workflow-compile/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...es/truffle-workflow-compile/test/shims.js → packages/workflow-compile/test/shims.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.