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

Add tools for generating a simulated Payment History for testing (replaces #4655) #4656

Merged
merged 1 commit into from
Oct 10, 2016
Merged

Add tools for generating a simulated Payment History for testing (replaces #4655) #4656

merged 1 commit into from
Oct 10, 2016

Conversation

willy-b
Copy link
Contributor

@willy-b willy-b commented Oct 10, 2016

Adds npm script: npm run add-simulated-payment-history

This generates a simulated Payment History, allowing testing of features that depend transactions without spending BTC or waiting.

Also tools/lib/transactionHelpers.js has a few functions for generating randomized transaction data (with constraints if you like) and a general transaction validator (using Joi).

fixes #4199

Test Plan:

  1. Clear user data (npm run clean userData)
  2. Start Brave
  3. Enable Brave Payments
  4. Observe no transactions, empty wallet, Payment History link is unavailable
  5. Run npm run add-simulated-payment-history
  6. Switch to Brave and Toggle Payments
  7. Observe Payment History link is available
  8. Open Payment History.
  9. Observe 10 months of randomized Payments data
  10. Open /\<UserDataPath\>/ledger-state.json and confirm transactions are present

simulated_payments_history_script

- `tools/lib/transactionHelpers.js`: Tools for generating and validating (w/ Joi) Ledger transactions
- `npm run add-simulated-payment-history`: new npm script which generates a simulated payment history, allowing testing related features without spending BTC

fixes #4199
@diracdeltas
Copy link
Member

++

@diracdeltas diracdeltas merged commit 7959e5c into brave:master Oct 10, 2016
@luixxiul luixxiul added this to the 0.12.5dev milestone Oct 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sample Ledger data files (ledger-*.json) for testing & development?
3 participants