Skip to content
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

transactions pool API endpoint #4009

Merged
merged 4 commits into from
Apr 21, 2022
Merged

transactions pool API endpoint #4009

merged 4 commits into from
Apr 21, 2022

Conversation

bogdan-rosianu
Copy link
Contributor

added a new API endpoint GET /transaction/pool that returns the txs hashes for regular transactions, smart contract results or rewards txs

@bogdan-rosianu bogdan-rosianu added the type:feature New feature or request label Apr 20, 2022
@bogdan-rosianu bogdan-rosianu self-assigned this Apr 20, 2022
@iulianpascalau iulianpascalau self-requested a review April 20, 2022 15:52
func TestGetTransactionsPoolShouldError(t *testing.T) {
t.Parallel()

expectedErr := errors.New("i am the error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"do not try to be funny" :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok :( renamed

func (shardedData *ShardedDataStub) RegisterOnAdded(handler func(key []byte, value interface{})) {
if shardedData.RegisterOnAddedCalled != nil {
shardedData.RegisterOnAddedCalled(handler)
func (sd *ShardedDataStub) RegisterOnAdded(handler func(key []byte, value interface{})) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for all stub, I name the receiver pointer as stub
So this will yield as func (stub *ShardedDataStub) RegisterOnAdded(handler func(key []byte, value interface{})) {
This name will match each and every stub we create :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting approach. however, it could come in a future PR that changes all stubs, so I wouldn't change this in this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, for all new stubs I do it like this.

// IsInterfaceNil returns true if there is no value under the interface
func (shardedData *ShardedDataStub) IsInterfaceNil() bool {
return shardedData == nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from linter:

cannot use facade (variable of type Facade) as type groups.transactionFacadeHandler in argument to groups.NewTransactionGroup:

integrationTests/testProcessorNodeWithTestWebServer.go#L1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@ssd04 ssd04 self-requested a review April 20, 2022 18:47
@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #4009 (5192d92) into development (c726193) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           development    #4009      +/-   ##
===============================================
+ Coverage        74.93%   74.94%   +0.01%     
===============================================
  Files              610      610              
  Lines            81539    81596      +57     
===============================================
+ Hits             61100    61151      +51     
- Misses           15792    15797       +5     
- Partials          4647     4648       +1     
Impacted Files Coverage Δ
dataRetriever/interface.go 12.12% <ø> (ø)
api/groups/transactionGroup.go 76.39% <100.00%> (+1.46%) ⬆️
dataRetriever/shardedData/shardedData.go 71.42% <100.00%> (+1.64%) ⬆️
dataRetriever/txpool/shardedTxPool.go 90.67% <100.00%> (+0.40%) ⬆️
facade/initial/initialNodeFacade.go 80.32% <100.00%> (+0.32%) ⬆️
facade/nodeFacade.go 70.14% <100.00%> (+0.22%) ⬆️
node/external/nodeApiResolver.go 60.60% <100.00%> (+0.81%) ⬆️
...external/transactionAPI/apiTransactionProcessor.go 88.42% <100.00%> (+0.71%) ⬆️
consensus/broadcast/delayedBroadcast.go 84.81% <0.00%> (-1.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb3bf6d...5192d92. Read the comment docs.

api/groups/transactionGroup.go Outdated Show resolved Hide resolved
dataRetriever/txpool/shardedTxPool.go Show resolved Hide resolved
Copy link
Contributor

@popenta popenta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ Log scanner @@

txs-pool-api-endpoint

================================================================================

  • Known Warnings 168
  • New Warnings 1
  • Known Errors 0
  • New Errors 0
  • Panics 0
    ================================================================================

@popenta popenta merged commit ed2819d into development Apr 21, 2022
@popenta popenta deleted the txs-pool-api-endpoint branch April 21, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants