The function verifyPoolL2Tx used here https://github.com/hermeznetwork/hermez-node/blob/develop/api/txspool.go#L37 internaly works with the type apiError however, the return type is error, by doing this we're returning less accurate errors in terms of error type and error code. Note that verifyPoolL2Tx internaly set the right type and code, but then we end up returning a generic error
Rationale
The function
verifyPoolL2Tx
used here https://github.com/hermeznetwork/hermez-node/blob/develop/api/txspool.go#L37 internaly works with the typeapiError
however, the return type iserror
, by doing this we're returning less accurate errors in terms of error type and error code. Note thatverifyPoolL2Tx
internaly set the right type and code, but then we end up returning a generic errorImplementation
make
verifyPoolL2Tx
return theapiError