-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Txs by sender api #4224
Txs by sender api #4224
Conversation
Codecov Report
@@ Coverage Diff @@
## feat/new-tx-api #4224 +/- ##
==================================================
Coverage ? 75.86%
==================================================
Files ? 645
Lines ? 85294
Branches ? 0
==================================================
Hits ? 64708
Misses ? 15789
Partials ? 4797 Continue to review full report at Codecov.
|
api/groups/transactionGroup_test.go
Outdated
@@ -98,6 +98,16 @@ type txsPoolResponse struct { | |||
Code string `json:"code"` | |||
} | |||
|
|||
type txsForSenderResponseData struct { | |||
TransactionsForSender common.TransactionsForSenderApiResponse `json:"transactionsForSender"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json tag could have been transactions
api/groups/transactionGroup.go
Outdated
@@ -30,6 +30,7 @@ const ( | |||
sendMultiplePath = "/send-multiple" | |||
getTransactionPath = "/:txhash" | |||
getTransactionsPool = "/pool" | |||
getTransactionsPoolForSender = "/pool/:sender" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think /pool/by-sender/:sender
it's better
@@ -103,6 +105,51 @@ func (atp *apiTransactionProcessor) GetTransactionsPool() (*common.TransactionsP | |||
return txsPoolResponse, nil | |||
} | |||
|
|||
// GetTransactionsPoolForSender will return a structure containing the transactions for sender that is to be returned on API calls | |||
func (atp *apiTransactionProcessor) GetTransactionsPoolForSender(sender string) (*common.TransactionsPoolForSenderApiResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in future refactors, we could have something like:
apiTransactionProcessor.GetTransactionsPool(options GetTxsPoolOptions)
where GetTxsPoolOptions could contain WithSender string
, WithReceiver string
, WithFields []string
and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted, new PRs will be created for this
No description provided.