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

[lightapi/python] task: add NemConnector endpoints #464

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from

Conversation

AnthonyLaw
Copy link
Member

@AnthonyLaw AnthonyLaw commented Jun 28, 2023

What was the issue?

  • We like to add a few Nem endpoints to use for the explorer puller repo.

What's the fix?

  • added POST support into BasicConnector
  • added 2 POST endpoints /local/chain/blocks-after and /local/block/at
  • added Block model
  • added Transaction model

@AnthonyLaw AnthonyLaw changed the title [lightapi/python] task: add NemConnector endpoint [lightapi/python] task: add NemConnector endpoints Jun 28, 2023
@AnthonyLaw AnthonyLaw force-pushed the lightapi/nem branch 3 times, most recently from e60197d to d79236b Compare June 28, 2023 22:48
@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #464 (5569c66) into dev (ae4d2f7) will increase coverage by 0.01%.
Report is 6 commits behind head on dev.
The diff coverage is 98.67%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #464      +/-   ##
==========================================
+ Coverage   98.22%   98.23%   +0.01%     
==========================================
  Files         161      163       +2     
  Lines        6528     6748     +220     
  Branches      143      143              
==========================================
+ Hits         6412     6629     +217     
- Misses        116      119       +3     
Flag Coverage Δ
explorer-nodewatch 98.40% <ø> (ø)
explorer-rest 99.17% <ø> (ø)
faucet-authenticator 100.00% <ø> (ø)
faucet-backend 98.91% <ø> (ø)
faucet-frontend 100.00% <ø> (ø)
lightapi-python 98.44% <98.67%> (+0.09%) ⬆️
tools-shoestring 96.75% <ø> (ø)
tools-vanity 99.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...pi/python/symbollightapi/connector/NemConnector.py 100.00% <100.00%> (ø)
lightapi/python/symbollightapi/model/Block.py 100.00% <100.00%> (ø)
lightapi/python/symbollightapi/model/Exceptions.py 100.00% <100.00%> (ø)
.../python/symbollightapi/connector/BasicConnector.py 97.61% <94.73%> (-2.39%) ⬇️
...ightapi/python/symbollightapi/model/Transaction.py 98.75% <98.75%> (ø)

Raises NodeException on connection or content failure.
"""

return await self._dispatch('post', url_path, property_name, data=json.dumps(request_payload), headers={
Copy link
Member

Choose a reason for hiding this comment

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

you probably want to use json= instead of data:
a) it doesn't require json.dumps
b) you don't need headers as it does that automatically

apart from that, looks ok

Copy link
Member Author

Choose a reason for hiding this comment

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

good to know, that is powerful! 👍🏼

@AnthonyLaw
Copy link
Member Author

Do you think we should rename it, because this endpoint is only use for local node?

get_blocks_after -> get_local_blocks_after

get_block -> get_local_block

@AnthonyLaw AnthonyLaw force-pushed the lightapi/nem branch 3 times, most recently from a3369ee to a59a4d9 Compare July 18, 2023 05:53
@AnthonyLaw AnthonyLaw requested a review from Wayonb July 19, 2023 17:14
Wayonb
Wayonb previously approved these changes Jul 25, 2023
Wayonb
Wayonb previously approved these changes Aug 2, 2023
Copy link
Contributor

@Wayonb Wayonb left a comment

Choose a reason for hiding this comment

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

👍🏾

… ImportanceTransferTransaction and ConvertAccountToMultisig
…on, MosaicDefinitionTransaction and MosaicSupplyChangeTransaction
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.

3 participants