From b022a605b43225b04d0c10fa20d05dd1161ab94a Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Sun, 10 Jun 2018 10:45:11 +0200 Subject: [PATCH] Client: identity -> address --- docs/api/rpc_proposal.rst | 42 +++++++------------ docs/introduction/alphanet.rst | 4 +- scripts/alphanet.sh | 2 - src/bin_client/test/test_basic.sh | 2 +- src/bin_client/tezos-init-sandboxed-client.sh | 16 +------ .../client_keys_commands.ml | 14 +++---- .../lib_client/client_proto_args.ml | 8 ++-- .../lib_protocol/src/contract_repr.ml | 4 +- 8 files changed, 31 insertions(+), 61 deletions(-) diff --git a/docs/api/rpc_proposal.rst b/docs/api/rpc_proposal.rst index c112e75f0..2347a8751 100644 --- a/docs/api/rpc_proposal.rst +++ b/docs/api/rpc_proposal.rst @@ -2844,8 +2844,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $error: /* ... FIXME ... */ @@ -3739,8 +3738,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string @@ -4998,8 +4996,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.michelson_v1.expression: /* Micheline expression (michelson_v1 variant) */ @@ -5423,8 +5420,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.michelson_v1.expression: /* Micheline expression (michelson_v1 variant) */ @@ -5703,8 +5699,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.michelson_v1.expression: /* Micheline expression (michelson_v1 variant) */ @@ -6049,8 +6044,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.michelson_v1.expression: /* Micheline expression (michelson_v1 variant) */ @@ -6313,8 +6307,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $error: /* ... FIXME ... */ @@ -6900,8 +6893,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.michelson_v1.expression: /* Micheline expression (michelson_v1 variant) */ @@ -7029,8 +7021,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.michelson_v1.expression: /* Micheline expression (michelson_v1 variant) */ @@ -7213,8 +7204,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.michelson_v1.expression: /* Micheline expression (michelson_v1 variant) */ @@ -7346,8 +7336,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $micheline.location: /* Canonical location in a Micheline expression @@ -8271,8 +8260,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $error: /* ... FIXME ... */ @@ -8728,8 +8716,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $error: /* ... FIXME ... */ @@ -9185,8 +9172,7 @@ Protocol Alpha $contract_id: /* A contract handle A contract notation as given to an RPC or inside scripts. Can be a - base58 public key hash, representing the implicit contract of this - identity, or a base58 originated contract hash. */ + base58 implicit contract hash or a base58 originated contract hash. */ string $error: /* ... FIXME ... */ diff --git a/docs/introduction/alphanet.rst b/docs/introduction/alphanet.rst index a94d6d3e2..ec4fd3a0c 100644 --- a/docs/introduction/alphanet.rst +++ b/docs/introduction/alphanet.rst @@ -311,8 +311,8 @@ the appropriate value: :: - $ ./alphanet.sh client list known identities - my_identity: tz1iFY8aDskx9QGbgBy68SNAGgkc7AE2iG9H (public key known) (secret key known) + $ ./alphanet.sh client list known addresses + my_account: tz1iFY8aDskx9QGbgBy68SNAGgkc7AE2iG9H (public key known) (secret key known) $ ./alphanet.sh client rpc post /chains/main/blocks/head/helpers/rights/baking/delegate/tz1iFY8aDskx9QGbgBy68SNAGgkc7AE2iG9H with {} { "ok": [ { "level": 1400.000000, "priority": 2.000000, diff --git a/scripts/alphanet.sh b/scripts/alphanet.sh index ddafae7cc..d00b9f725 100755 --- a/scripts/alphanet.sh +++ b/scripts/alphanet.sh @@ -448,8 +448,6 @@ usage() { echo " $0 start [--rpc-port ] [OPTIONS]" echo " Launch a full Tezos alphanet node in a docker container" echo " automatically generating a new network identity." - echo " An account 'my_account' for a manager 'my_identity' is also" - echo " created to be used via the client." echo " OPTIONS (others than --rpc-port) are directly passed to the" echo " Tezos node, see '$0 shell tezos-node config --help'" echo " for more details." diff --git a/src/bin_client/test/test_basic.sh b/src/bin_client/test/test_basic.sh index ff62fa20b..4b072fffc 100755 --- a/src/bin_client/test/test_basic.sh +++ b/src/bin_client/test/test_basic.sh @@ -35,7 +35,7 @@ $client gen keys $key2 --sig secp256k1 $client gen keys $key3 --sig ed25519 # $client gen keys $key6 --sig p256 -$client list known identities +$client list known addresses $client get balance for bootstrap1 bake_after $client transfer 1,000 from bootstrap1 to $key1 diff --git a/src/bin_client/tezos-init-sandboxed-client.sh b/src/bin_client/tezos-init-sandboxed-client.sh index 10841cc89..0f94d19b7 100755 --- a/src/bin_client/tezos-init-sandboxed-client.sh +++ b/src/bin_client/tezos-init-sandboxed-client.sh @@ -83,20 +83,6 @@ wait_for_the_node_to_be_bootstraped() { $client bootstrapped } -## Account ################################################################# - -may_create_identity() { - if ! $client get balance for "my_identity" >/dev/null 2>&1 ; then - echo "Generating new manager key (known as 'my_identity')..." - $client gen keys "my_identity" - fi - if ! $client get balance for "my_account" >/dev/null 2>&1 ; then - echo "Creating new account for 'my_identity' (known as 'my_account')..." - $client forget contract "my_account" >/dev/null 2>&1 || true - $client originate free account "my_account" for "my_identity" - fi -} - ## Baker ################################################################### check_baker() { @@ -317,7 +303,7 @@ The client is now properly initialized. In the rest of this shell session, you might now run \`tezos-client\` to communicate with a tezos node launched with \`launch-sandboxed-node $1\`. For instance: - tezos-client rpc get /chains/main/blocks/head/metadata/protocol_hash + tezos-client rpc get /chains/main/blocks/head/metadata Note: if the current protocol version, as reported by the previous command, is "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im", you diff --git a/src/lib_client_commands/client_keys_commands.ml b/src/lib_client_commands/client_keys_commands.ml index 971d35c7d..4438cea4c 100644 --- a/src/lib_client_commands/client_keys_commands.ml +++ b/src/lib_client_commands/client_keys_commands.ml @@ -202,9 +202,9 @@ let commands () : Client_context.io_wallet Clic.command list = Signature.Public_key_hash.pp pkh >>= fun () -> Public_key.add ~force cctxt name (pk_uri, public_key)) ; - command ~group ~desc: "Add an identity to the wallet." + command ~group ~desc: "Add an address to the wallet." (args1 (Public_key.force_switch ())) - (prefixes [ "add" ; "identity" ] + (prefixes [ "add" ; "address" ] @@ Public_key_hash.fresh_alias_param @@ Public_key_hash.source_param @@ stop) @@ -212,9 +212,9 @@ let commands () : Client_context.io_wallet Clic.command list = Public_key_hash.of_fresh cctxt force name >>=? fun name -> Public_key_hash.add ~force cctxt name hash) ; - command ~group ~desc: "List all identities and associated keys." + command ~group ~desc: "List all addresses and associated keys." no_options - (fixed [ "list" ; "known" ; "identities" ]) + (fixed [ "list" ; "known" ; "addresses" ]) (fun () (cctxt : #Client_context.io_wallet) -> list_keys cctxt >>=? fun l -> iter_s begin fun (name, pkh, pk, sk) -> @@ -232,16 +232,16 @@ let commands () : Client_context.io_wallet Clic.command list = end >>= fun () -> return () end l) ; - command ~group ~desc: "Show the keys associated with an identity." + command ~group ~desc: "Show the keys associated with an implicit account." (args1 show_private_switch) - (prefixes [ "show" ; "identity"] + (prefixes [ "show" ; "address"] @@ Public_key_hash.alias_param @@ stop) (fun show_private (name, _) (cctxt : #Client_context.io_wallet) -> alias_keys cctxt name >>=? fun key_info -> match key_info with | None -> - cctxt#message "No keys found for identity" >>= fun () -> + cctxt#message "No keys found for address" >>= fun () -> return () | Some (pkh, pk, skloc) -> cctxt#message "Hash: %a" diff --git a/src/proto_alpha/lib_client/client_proto_args.ml b/src/proto_alpha/lib_client/client_proto_args.ml index 68126658a..a109c94a7 100644 --- a/src/proto_alpha/lib_client/client_proto_args.ml +++ b/src/proto_alpha/lib_client/client_proto_args.ml @@ -77,17 +77,17 @@ let arg_arg = let delegate_arg = Client_keys.Public_key_hash.source_arg ~long:"delegate" - ~placeholder:"identity" + ~placeholder:"address" ~doc:"delegate of the contract\n\ - Must be a known identity." + Must be a known address." () let source_arg = arg ~long:"source" - ~placeholder:"identity" + ~placeholder:"address" ~doc:"source of the deposits to be paid\n\ - Must be a known identity." + Must be a known address." string_parameter let spendable_switch = diff --git a/src/proto_alpha/lib_protocol/src/contract_repr.ml b/src/proto_alpha/lib_protocol/src/contract_repr.ml index 2c0fea3a4..9e240378c 100644 --- a/src/proto_alpha/lib_protocol/src/contract_repr.ml +++ b/src/proto_alpha/lib_protocol/src/contract_repr.ml @@ -54,8 +54,8 @@ let encoding = "A contract handle" ~description: "A contract notation as given to an RPC or inside scripts. \ - Can be a base58 public key hash, representing the implicit contract \ - of this identity, or a base58 originated contract hash." @@ + Can be a base58 implicit contract hash \ + or a base58 originated contract hash." @@ splitted ~binary: (union ~tag_size:`Uint8 [