generated from puria/README
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ onAfter and onBefore hooks, to mangle input/output
- Loading branch information
Showing
7 changed files
with
296 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ The list of the attributes are: | |
|
||
## 📋 Testing | ||
|
||
``yarn test` | ||
`yarn test` | ||
|
||
**[🔝 back to top](#toc)** | ||
|
||
|
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,11 +1,11 @@ | ||
const {execute} = require('./build/main/index') | ||
const bench = require('nanobench') | ||
const { execute } = require('./build/main/index'); | ||
const bench = require('nanobench'); | ||
|
||
const signPetition = async () => { | ||
const account = `{"username": "Alice"}` | ||
const participants = `{ "participants": [ "[email protected]", "[email protected]", "[email protected]" ] }` | ||
const account = `{"username": "Alice"}`; | ||
const participants = `{ "participants": [ "[email protected]", "[email protected]", "[email protected]" ] }`; | ||
|
||
const participant_email = `{"email": "[email protected]", "petition_uid": "More privacy for all!"}` | ||
const participant_email = `{"email": "[email protected]", "petition_uid": "More privacy for all!"}`; | ||
const steps = { | ||
verbose: false, | ||
conf: 'memmanager=lw', | ||
|
@@ -156,15 +156,19 @@ and print the 'public key' inside 'keypair' | |
], | ||
}; | ||
|
||
(await execute(steps)); | ||
await execute(steps); | ||
}; | ||
|
||
bench('petition flow 200.000 times', function (b) { | ||
b.start() | ||
const tries = 150; | ||
|
||
for (var i = 0; i < 100; i++) { | ||
(async () => { await signPetition() })() | ||
bench(`petition flow ${tries} times`, function (b) { | ||
b.start(); | ||
|
||
for (var i = 0; i < tries; i++) { | ||
(async () => { | ||
await signPetition(); | ||
})(); | ||
} | ||
|
||
b.end() | ||
}) | ||
b.end(); | ||
}); |
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
Oops, something went wrong.