Closes #203
This PR adds TransactionRequest, a struct for defining transactions in a general way.
This implies a client API change to Client::new_transaction(transaction_request: TransactionRequest). The TransactionTemplate enum was left in order to facilitate common transactions, and a client function was introduced to build the template into a TransactionRequest: Client::build_transaction_request(transaction_template: TransactionTemplate).
An integration test was also introduced in order to test note args functionality and custom tx code. The test creates a note with custom code that asserts the note args are as expected. After that, it runs a transaction that consumes the note with the expected note args. It also tests the custom tx code by running an assertion (the tx is executed twice, once with the assertion failing and the other one succeeding, also consuming the note).
Closes #203 This PR adds
TransactionRequest
, a struct for defining transactions in a general way. This implies a client API change toClient::new_transaction(transaction_request: TransactionRequest)
. TheTransactionTemplate
enum was left in order to facilitate common transactions, and a client function was introduced to build the template into aTransactionRequest
:Client::build_transaction_request(transaction_template: TransactionTemplate)
.An integration test was also introduced in order to test note args functionality and custom tx code. The test creates a note with custom code that asserts the note args are as expected. After that, it runs a transaction that consumes the note with the expected note args. It also tests the custom tx code by running an assertion (the tx is executed twice, once with the assertion failing and the other one succeeding, also consuming the note).