Adds tests to the new Transactor component, introduced by the Rosetta Construction API (#387) and the new method on the rosetta retriever, Sequence.
Refactors the ParseTransaction method from the Transactor into its own dedicated type for readability and testability.
Additional Notes
// FIXME: The naming of those funcs conflict with the transactor's, since they have the same dependencies :(
// How can we name this in a consistent way that makes sense?
func ParseTransaction(tx *sdk.Transaction) func(*TransactionParser) {
return func(parser *TransactionParser) {
parser.tx = tx
}
}
func ParseValidator(validate Validator) func(*TransactionParser) {
return func(parser *TransactionParser) {
parser.validate = validate
}
}
func ParseGenerator(generate Generator) func(*TransactionParser) {
return func(parser *TransactionParser) {
parser.generate = generate
}
}
func ParseInvoker(invoke Invoker) func(*TransactionParser) {
return func(parser *TransactionParser) {
parser.invoke = invoke
}
}
Any suggestions? Since we already have WithX for injecting those dependencies to the Transactor in the same package.
Goal of this PR
Part of #333
Sequence
.ParseTransaction
method from theTransactor
into its own dedicated type for readability and testability.Additional Notes
Any suggestions? Since we already have
WithX
for injecting those dependencies to the Transactor in the same package.Checklist