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

Get list of the public keys by account address on which these keys depend #16

Merged
merged 11 commits into from
Apr 24, 2019

Conversation

anastasiia-bilova
Copy link
Contributor

@anastasiia-bilova anastasiia-bilova commented Apr 16, 2019

Jira references

Description

Get a list of the addresses of the public keys by its account address command line interface's command implementation.

Arguments Type Required Description
address String Yes Account address to get a list of the addresses of the public keys by.
node-url String No Node URL to apply a command to.

Example of the usage:

$ remme public-key get-list \
      --address=1120076ecf036e857f42129b58303bcf1e03723764a1702cbe98529802aad8514ee3cf \
      --node-url=node-genesis-testnet.remme.io
{
    "result": {
        "public_key_addresses": [
            "a23be10b3aad1b4a98f338c71d6dcdb2aa2f296c7e31fb400615e335dc10dd1d4f62bf",
            "a23be14b362514d624c1985277005327f6fc40413fb090eee6fccb673a32c9809060ff"
        ]
    }
}

Implemented

— Command line interface's command.
— Service to get the account public keys of the public key class.

References

@codecov-io
Copy link

codecov-io commented Apr 16, 2019

Codecov Report

Merging #16 into develop will increase coverage by 0.68%.
The diff coverage is 97.95%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #16      +/-   ##
===========================================
+ Coverage    95.03%   95.71%   +0.68%     
===========================================
  Files           10       15       +5     
  Lines          161      210      +49     
===========================================
+ Hits           153      201      +48     
- Misses           8        9       +1
Impacted Files Coverage Δ
cli/public_key/help.py 100% <100%> (ø)
cli/entrypoint.py 100% <100%> (ø) ⬆️
cli/public_key/forms.py 100% <100%> (ø)
cli/public_key/service.py 100% <100%> (ø)
cli/public_key/cli.py 100% <100%> (ø)
cli/public_key/interfaces.py 66.66% <66.66%> (ø)
... and 1 more

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 850d3a3...3a6a41e. Read the comment docs.

@anastasiia-bilova anastasiia-bilova force-pushed the get-list-of-public-keys-by-account-address branch from 4624c3e to 9b1c09d Compare April 16, 2019 19:46
@anastasiia-bilova anastasiia-bilova force-pushed the get-list-of-public-keys-by-account-address branch from 9b1c09d to 67514d1 Compare April 17, 2019 17:07
@anastasiia-bilova anastasiia-bilova force-pushed the get-list-of-public-keys-by-account-address branch from 14eb5f3 to 40b7c70 Compare April 18, 2019 14:02
@anastasiia-bilova anastasiia-bilova force-pushed the get-list-of-public-keys-by-account-address branch from 25eee14 to 3cf9c52 Compare April 23, 2019 09:56
@anastasiia-bilova anastasiia-bilova requested review from Annitra and removed request for Alladin9393 April 23, 2019 10:20
README.md Outdated
@@ -139,6 +140,26 @@ $ remme account transfer-tokens \
}
```

### Public key

Get list of the public keys by account address — ``remme public-key get-list``:
Copy link
Contributor

@dmytrostriletskyi dmytrostriletskyi Apr 24, 2019

Choose a reason for hiding this comment

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

Get list of the public keys ... > Get a list of the addresses of the public keys....

Apply the same to the code and tests documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

README.md Outdated

| Arguments | Type | Required | Description |
| :-------: | :----: | :------: | ------------------------------------------ |
| address | String | Yes | Address to get list of the public keys by. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Apply the comment above to the argument description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

README.md Outdated
@@ -174,7 +195,7 @@ $ docker exec -it remme-core-cli bash

And now being in the container, you can develop the project. For instance, run tests and linters:

```bash
```bashpytest -vv tests/
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert this change, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

print_result,
)

loop = asyncio.get_event_loop()
Copy link
Contributor

Choose a reason for hiding this comment

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

You do not need it anymore here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

address = arguments.get('address')
node_url = arguments.get('node_url')

remme = Remme(network_config={'node_address': str(node_url) + ':8080'})
Copy link
Contributor

Choose a reason for hiding this comment

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

Follow this style, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,18 @@
"""
Provide forms for command line interface's account commands.
Copy link
Contributor

Choose a reason for hiding this comment

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

account > public key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"""
Get list of the public keys by account address.
"""
public_keys = loop.run_until_complete(self.service.public_key_storage.get_account_public_keys(address=address))
Copy link
Contributor

Choose a reason for hiding this comment

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

Remember to handle Exception and write tests for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anastasiia-bilova anastasiia-bilova force-pushed the get-list-of-public-keys-by-account-address branch from 4c5d483 to 51e381b Compare April 24, 2019 14:02
public_key_addresses = json.loads(result.output).get('result').get('public_key_addresses')

assert PASSED_EXIT_FROM_COMMAND_CODE == result.exit_code
assert isinstance(public_key_addresses, list)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add checking that list is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anastasiia-bilova anastasiia-bilova force-pushed the get-list-of-public-keys-by-account-address branch from 51e381b to 3a6a41e Compare April 24, 2019 14:09
@anastasiia-bilova anastasiia-bilova merged commit ef7ecd5 into develop Apr 24, 2019
@delete-merged-branch delete-merged-branch bot deleted the get-list-of-public-keys-by-account-address branch April 24, 2019 14:14
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.

4 participants