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

refactor APIProvider to NodeProvider #400

Merged
merged 8 commits into from
Jun 14, 2021
Merged

Conversation

evan-forbes
Copy link
Member

@evan-forbes evan-forbes commented Jun 9, 2021

Description

This simple PR refactors APIProvider to NodeProvider, where it now would return a full *core.IPFS object instead of only the DAG portion.

Closes: #399

@evan-forbes evan-forbes self-assigned this Jun 9, 2021
@evan-forbes evan-forbes requested review from Wondertan and removed request for tac0turtle June 9, 2021 04:17
ipfs/provider.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2021

Codecov Report

Merging #400 (c8f6f93) into master (b7fe560) will decrease coverage by 0.08%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #400      +/-   ##
==========================================
- Coverage   61.81%   61.73%   -0.09%     
==========================================
  Files         262      262              
  Lines       22981    22979       -2     
==========================================
- Hits        14206    14185      -21     
- Misses       7273     7284      +11     
- Partials     1502     1510       +8     
Impacted Files Coverage Δ
cmd/tendermint/commands/light.go 18.12% <0.00%> (+0.22%) ⬆️
light/client.go 64.34% <0.00%> (ø)
node/node.go 55.92% <100.00%> (ø)
privval/signer_listener_endpoint.go 80.00% <0.00%> (-7.06%) ⬇️
privval/socket_listeners.go 78.72% <0.00%> (-4.26%) ⬇️
privval/secret_connection.go 72.68% <0.00%> (-3.61%) ⬇️
libs/clist/clist.go 63.74% <0.00%> (-3.51%) ⬇️
blockchain/v0/reactor.go 63.06% <0.00%> (-2.26%) ⬇️
consensus/replay.go 70.53% <0.00%> (-0.83%) ⬇️
p2p/switch.go 65.43% <0.00%> (-0.62%) ⬇️
... and 7 more

ipfs/mock.go Outdated Show resolved Hide resolved
ipfs/provider.go Outdated Show resolved Hide resolved
ipfs/embedded.go Outdated Show resolved Hide resolved
@evan-forbes evan-forbes changed the title refactor APIProvider refactor APIProvider to NodeProvider Jun 11, 2021
@liamsi
Copy link
Member

liamsi commented Jun 11, 2021

Just noting here before restarting CI; these 2 tests look highly unrelated:

?   	github.com/lazyledger/lazyledger-core/libs/fail	[no test files]
--- FAIL: TestWriter (0.48s)
    io_test.go:150: w.Status(0)
        expected: {2021-06-11 21:51:01.14 +0000 UTC 80 4 200 200 200 200 20 400ms 0s 100ms 80.000% true}
        got     : {2021-06-11 21:51:01.14 +0000 UTC 80 4 200 200 200 200 20 400ms 20ms 100ms 80.000% true}
FAIL

--- FAIL: TestTransportMultiplexAcceptNonBlocking (0.23s)
    transport_test.go:349: auth failure: conn.ID (8a87dfa34aa525256f40129427284a32109d8d8f) NodeInfo.ID (fd2d6e0caf965a8118c82109571daa885026e54c) mismatch
FAIL

Note: the first one is from libs/flowrate which isn't even used in tendermint (and hence was removed there: https://github.com/tendermint/tendermint/tree/master/libs) NVM, it's used in p2p/connection and it was jujst moved to internal: https://github.com/tendermint/tendermint/tree/master/internal/libs/flowrate

And the 2nd has nothing to do with any change here.

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Thanks @evan-forbes. Looks great!

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

Bellissimo!!!

@evan-forbes evan-forbes merged commit a7326d5 into master Jun 14, 2021
@evan-forbes evan-forbes deleted the evan/apiprovider-refactor branch June 14, 2021 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor APIProvider to accomodate manual providing, offline dags, and easy mocks
4 participants