Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Problem(fix #1043) watch-only mode cannot be used in client-cli #1074

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

linfeng-crypto
Copy link
Contributor

solution: add restore basic wallet and create watch address in client-cli

Copy link
Collaborator

@leejw51crypto leejw51crypto left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -123,11 +129,26 @@ impl AddressCommand {
success(&format!("New address: {}", address));
Ok(())
}
AddressType::StakingWatch => {
let enckey = ask_seckey(None)?;
let public_key = ask_public_key(None)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

public key is not secret stuff, maybe pass it in the argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But when creating a normal staking address or transfer address, no need to pass the pubkey, if we pass the pubkey in the arguments, it may make some confusion.

Copy link
Collaborator

@yihuang yihuang Feb 14, 2020

Choose a reason for hiding this comment

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

It's more like import an existing address, rather than create an new address?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The state of a staking addres is public, anyone with the staking address is able to check its state.

@codecov
Copy link

codecov bot commented Feb 14, 2020

Codecov Report

Merging #1074 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #1074      +/-   ##
==========================================
- Coverage   66.26%   66.24%   -0.02%     
==========================================
  Files         147      145       -2     
  Lines       18791    18839      +48     
==========================================
+ Hits        12451    12480      +29     
- Misses       6340     6359      +19
Impacted Files Coverage Δ
client-cli/src/command/wallet_command.rs 0% <0%> (ø) ⬆️
client-cli/src/command/address_command.rs 0% <0%> (ø) ⬆️
chain-storage/src/lib.rs 62.69% <0%> (-6.33%) ⬇️
chain-tx-validation/src/lib.rs 70.43% <0%> (-4.79%) ⬇️
chain-core/src/init/params.rs 77.77% <0%> (-3%) ⬇️
chain-abci/src/enclave_bridge/mock.rs 87.64% <0%> (-1.13%) ⬇️
chain-abci/tests/tx_validation.rs 97.57% <0%> (-0.11%) ⬇️
chain-abci/src/main.rs 0% <0%> (ø) ⬆️
chain-abci/src/app/end_block.rs 100% <0%> (ø) ⬆️
...hain-tx-enclave/rust-sgx-sdk/common/inc/sys/stat.h
... and 9 more

Staking,
StakingWatch,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think no need for this, as it's public information -- just use "state" command to retrieve it: #1035

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

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

no need for staking address watch, as it's already there / directly queryable

@tomtau
Copy link
Contributor

tomtau commented Feb 18, 2020

bors r+

bors bot added a commit that referenced this pull request Feb 18, 2020
1074: Problem(fix #1043) watch-only mode cannot be used in client-cli r=tomtau a=linfeng-crypto

solution: add `restore basic wallet ` and `create watch address` in client-cli

1081: Bump sgx_types from `93c76de` to `71a88b6` r=tomtau a=dependabot-preview[bot]

Bumps [sgx_types](https://github.com/apache/teaclave-sgx-sdk) from `93c76de` to `71a88b6`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/71a88b647bb76a16cbc5c3e29403e2afb67f82fd"><code>71a88b6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/apache/teaclave-sgx-sdk/issues/205">#205</a> from volcano0dr/master</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/35a250b62dd8a71425f5dcf41e98e787a053d55a"><code>35a250b</code></a> Fix read/write buffer check</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/8d9f05abd2ebe0a3f1db901f2280513c36325553"><code>8d9f05a</code></a> Fix http_req makefile for default SGX_SDK_RUST location</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/dadd11780ca88893b279cf00469f10d47a083f20"><code>dadd117</code></a> Refine http_req by using in-enclave dns lookup ocall</li>
<li>See full diff in <a href="https://github.com/apache/teaclave-sgx-sdk/compare/93c76de88befbfc1f483ce8336c7ee1f0c7f7563...71a88b647bb76a16cbc5c3e29403e2afb67f82fd">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

1082: Bump sgx_urts from `93c76de` to `71a88b6` r=tomtau a=dependabot-preview[bot]

Bumps [sgx_urts](https://github.com/apache/teaclave-sgx-sdk) from `93c76de` to `71a88b6`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/71a88b647bb76a16cbc5c3e29403e2afb67f82fd"><code>71a88b6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/apache/teaclave-sgx-sdk/issues/205">#205</a> from volcano0dr/master</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/35a250b62dd8a71425f5dcf41e98e787a053d55a"><code>35a250b</code></a> Fix read/write buffer check</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/8d9f05abd2ebe0a3f1db901f2280513c36325553"><code>8d9f05a</code></a> Fix http_req makefile for default SGX_SDK_RUST location</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/dadd11780ca88893b279cf00469f10d47a083f20"><code>dadd117</code></a> Refine http_req by using in-enclave dns lookup ocall</li>
<li>See full diff in <a href="https://github.com/apache/teaclave-sgx-sdk/compare/93c76de88befbfc1f483ce8336c7ee1f0c7f7563...71a88b647bb76a16cbc5c3e29403e2afb67f82fd">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

1083: Bump sgx_tcrypto from `93c76de` to `71a88b6` r=tomtau a=dependabot-preview[bot]

Bumps [sgx_tcrypto](https://github.com/apache/teaclave-sgx-sdk) from `93c76de` to `71a88b6`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/71a88b647bb76a16cbc5c3e29403e2afb67f82fd"><code>71a88b6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/apache/teaclave-sgx-sdk/issues/205">#205</a> from volcano0dr/master</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/35a250b62dd8a71425f5dcf41e98e787a053d55a"><code>35a250b</code></a> Fix read/write buffer check</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/8d9f05abd2ebe0a3f1db901f2280513c36325553"><code>8d9f05a</code></a> Fix http_req makefile for default SGX_SDK_RUST location</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/dadd11780ca88893b279cf00469f10d47a083f20"><code>dadd117</code></a> Refine http_req by using in-enclave dns lookup ocall</li>
<li>See full diff in <a href="https://github.com/apache/teaclave-sgx-sdk/compare/93c76de88befbfc1f483ce8336c7ee1f0c7f7563...71a88b647bb76a16cbc5c3e29403e2afb67f82fd">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: linfeng <linfeng@crypto.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Feb 18, 2020

Build failed (retrying...)

bors bot added a commit that referenced this pull request Feb 18, 2020
1074: Problem(fix #1043) watch-only mode cannot be used in client-cli r=tomtau a=linfeng-crypto

solution: add `restore basic wallet ` and `create watch address` in client-cli

1081: Bump sgx_types from `93c76de` to `71a88b6` r=tomtau a=dependabot-preview[bot]

Bumps [sgx_types](https://github.com/apache/teaclave-sgx-sdk) from `93c76de` to `71a88b6`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/71a88b647bb76a16cbc5c3e29403e2afb67f82fd"><code>71a88b6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/apache/teaclave-sgx-sdk/issues/205">#205</a> from volcano0dr/master</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/35a250b62dd8a71425f5dcf41e98e787a053d55a"><code>35a250b</code></a> Fix read/write buffer check</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/8d9f05abd2ebe0a3f1db901f2280513c36325553"><code>8d9f05a</code></a> Fix http_req makefile for default SGX_SDK_RUST location</li>
<li><a href="https://github.com/apache/incubator-teaclave-sgx-sdk/commit/dadd11780ca88893b279cf00469f10d47a083f20"><code>dadd117</code></a> Refine http_req by using in-enclave dns lookup ocall</li>
<li>See full diff in <a href="https://github.com/apache/teaclave-sgx-sdk/compare/93c76de88befbfc1f483ce8336c7ee1f0c7f7563...71a88b647bb76a16cbc5c3e29403e2afb67f82fd">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: linfeng <linfeng@crypto.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Feb 18, 2020

@bors bors bot merged commit b81a895 into crypto-com:master Feb 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants