This repository has been archived by the owner on Dec 12, 2018. It is now read-only.
forked from trufflesuite/ganache-cli-archive
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge trufflesuite#24. Add -s/--seed option to see the addresses that…
… are created. Add -a/--accounts options to specify how many accounts you want to create.
- Loading branch information
Tim Coulter
authored and
Tim Coulter
committed
Mar 24, 2016
1 parent
ac4e085
commit d374a4b
Showing
5 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
// Mimics crypto.random bytes, but takes in a random number generator | ||
// as its second parameter. rng is expected to be a function that takes | ||
// no parameters and returns a result like Math.random(). | ||
// This is important because it allows for a seeded random number generator. | ||
// Since this is a mock RPC library, the rng doesn't need to be cryptographically secure. | ||
randomBytes: function(length, rng) { | ||
var buf = []; | ||
|
||
for (var i = 0; i < length; i++) { | ||
buf.push(rng()*255); | ||
} | ||
|
||
return new Buffer(buf); | ||
} | ||
} |
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