I'm trying to write a test which verifies I can query a given type of events by the user/address which sign them.
I would like to apply TDD (relevant to say I haven't made the implementation for this particular case yet).
I was expecting something like:
describe('get user history', () => {
it ('returns the events signed by the user', async () => {
# create account for user 'john' with generated private key
# submit transaction 'buyGroceries' with 'john' signature which should emit an event
# submit transaction 'buyNewspaper' with random account which should emit an event
# assert the first and only the first transaction is returned when query for the event type signed by 'john'
});
});
The problem with this is that I don't find any utils which allow me through truffle tests to create an account with a private key on its clean-room environment.
What am I missing?