From 5fff7b3c1b8b86bb45bd171f709ffe19cb79f77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Sun, 11 Feb 2018 19:17:39 +0100 Subject: [PATCH] Alpha: rename `Tezos_context` -> `Alpha_context` --- docs/tutorials/entering_alpha.rst | 20 ++++----- src/bin_attacker/attacker_minimal.ml | 4 +- .../lib_client/client_baking_blocks.ml | 2 +- .../lib_client/client_baking_blocks.mli | 2 +- .../lib_client/client_baking_daemon.mli | 2 +- .../lib_client/client_baking_endorsement.ml | 2 +- .../lib_client/client_baking_endorsement.mli | 2 +- .../lib_client/client_baking_forge.ml | 6 +-- .../lib_client/client_baking_forge.mli | 2 +- .../lib_client/client_baking_lib.ml | 2 +- .../lib_client/client_baking_lib.mli | 2 +- .../lib_client/client_baking_operations.ml | 4 +- .../lib_client/client_baking_operations.mli | 2 +- .../lib_client/client_baking_revelation.ml | 2 +- .../lib_client/client_baking_revelation.mli | 2 +- .../lib_client/client_proto_args.ml | 2 +- .../lib_client/client_proto_args.mli | 2 +- .../lib_client/client_proto_context.ml | 2 +- .../lib_client/client_proto_context.mli | 2 +- .../client_proto_context_commands.ml | 2 +- .../lib_client/client_proto_contracts.ml | 2 +- .../lib_client/client_proto_contracts.mli | 2 +- .../client_proto_contracts_commands.ml | 2 +- .../lib_client/client_proto_nonces.ml | 2 +- .../lib_client/client_proto_nonces.mli | 2 +- .../lib_client/client_proto_programs.ml | 2 +- .../lib_client/client_proto_programs.mli | 2 +- .../lib_client/client_proto_rpcs.ml | 14 +++--- .../lib_client/client_proto_rpcs.mli | 2 +- .../lib_client/michelson_v1_emacs.mli | 2 +- .../lib_client/michelson_v1_error_reporter.ml | 2 +- .../lib_client/michelson_v1_parser.mli | 2 +- .../lib_client/michelson_v1_printer.mli | 2 +- .../lib_client/test/proto_alpha_helpers.ml | 2 +- .../lib_client/test/proto_alpha_helpers.mli | 4 +- .../lib_client/test/test_endorsement.ml | 2 +- .../lib_client/test/test_origination.ml | 2 +- .../lib_client/test/test_transaction.ml | 2 +- src/proto_alpha/lib_client/test/test_vote.ml | 2 +- .../lib_protocol/src/TEZOS_PROTOCOL | 2 +- .../{tezos_context.ml => alpha_context.ml} | 0 .../{tezos_context.mli => alpha_context.mli} | 0 src/proto_alpha/lib_protocol/src/amendment.ml | 2 +- .../lib_protocol/src/amendment.mli | 2 +- src/proto_alpha/lib_protocol/src/apply.ml | 2 +- src/proto_alpha/lib_protocol/src/baking.ml | 4 +- src/proto_alpha/lib_protocol/src/baking.mli | 2 +- src/proto_alpha/lib_protocol/src/gas.ml | 2 +- src/proto_alpha/lib_protocol/src/gas.mli | 2 +- src/proto_alpha/lib_protocol/src/main.ml | 44 +++++++++---------- src/proto_alpha/lib_protocol/src/main.mli | 2 +- .../lib_protocol/src/script_interpreter.ml | 2 +- .../lib_protocol/src/script_interpreter.mli | 6 +-- .../lib_protocol/src/script_ir_translator.ml | 6 +-- .../lib_protocol/src/script_ir_translator.mli | 6 +-- .../lib_protocol/src/script_tc_errors.ml | 2 +- .../src/script_tc_errors_registration.ml | 2 +- .../lib_protocol/src/script_typed_ir.ml | 2 +- src/proto_alpha/lib_protocol/src/services.ml | 4 +- .../lib_protocol/src/services_registration.ml | 10 ++--- .../test/helpers/helpers_account.ml | 2 +- .../test/helpers/helpers_account.mli | 2 +- .../test/helpers/helpers_apply.mli | 2 +- .../test/helpers/helpers_assert.ml | 2 +- .../test/helpers/helpers_assert.mli | 2 +- .../test/helpers/helpers_block.ml | 10 ++--- .../test/helpers/helpers_block.mli | 14 +++--- .../lib_protocol/test/helpers/helpers_cast.ml | 2 +- .../test/helpers/helpers_cast.mli | 4 +- .../test/helpers/helpers_crypto.ml | 2 +- .../test/helpers/helpers_crypto.mli | 2 +- .../lib_protocol/test/helpers/helpers_init.ml | 4 +- .../test/helpers/helpers_operation.ml | 4 +- .../test/helpers/helpers_operation.mli | 4 +- .../test/helpers/helpers_script.ml | 4 +- .../test/helpers/helpers_script.mli | 4 +- .../test/helpers/helpers_services.ml | 2 +- .../test/helpers/helpers_services.mli | 8 ++-- .../test/helpers/isolate_helpers.ml | 6 +-- .../lib_protocol/test/test_big_maps.ml | 12 ++--- .../lib_protocol/test/test_endorsement.ml | 4 +- .../lib_protocol/test/test_michelson.ml | 12 ++--- .../lib_protocol/test/test_transaction.ml | 2 +- 83 files changed, 166 insertions(+), 166 deletions(-) rename src/proto_alpha/lib_protocol/src/{tezos_context.ml => alpha_context.ml} (100%) rename src/proto_alpha/lib_protocol/src/{tezos_context.mli => alpha_context.mli} (100%) diff --git a/docs/tutorials/entering_alpha.rst b/docs/tutorials/entering_alpha.rst index 0deffaf29..75e067ea2 100644 --- a/docs/tutorials/entering_alpha.rst +++ b/docs/tutorials/entering_alpha.rst @@ -30,7 +30,7 @@ These layers follow the linking order: the first modules are the tower’s foundation that talk to the raw key-value store, and going forward in the module list means climbing up the abstraction tower. -The big abstraction barrier: ``Tezos_context`` +The big abstraction barrier: ``Alpha_context`` ---------------------------------------------- the proof-of-stake algorithm, as described in the white paper, relies on @@ -43,31 +43,31 @@ The proof-of-stake is thus implemented over a generic key-value store whose keys and associated binary data must implement the abstract structure. -The ``Tezos_context`` module enforces the separation of concerns +The ``Alpha_context`` module enforces the separation of concerns between, on one hand, mapping the abstract state of the ledger to the concrete structure of the key-value store, and, on the other hand, implementing the proof-of-stake algorithm over this state. -In more practical terms, ``Tezos_context`` defines a type ``t`` that +In more practical terms, ``Alpha_context`` defines a type ``t`` that represents a state of the ledger. This state is an abstracted out version of the key-value store that can only be manipulated through the -use of the few selected manipulations reexported by ``Tezos_context``, +use of the few selected manipulations reexported by ``Alpha_context``, that always preserve the well-typed aspect and internal consistency invariants of the state. When validating a block, the low-level state that result from the predecessor block is read from the disk, then abstracted out to a -``Tezos_context.t``, which is then only updated by high level operations +``Alpha_context.t``, which is then only updated by high level operations that preserve consistency, and finally, the low level state is extracted to be committed on disk. This way, we have two well separated parts in the code. The code below -``Tezos_context`` implements the ledger’s state storage, while the code +``Alpha_context`` implements the ledger’s state storage, while the code on top of it is the proof-of-stake algorithm. Thanks to this barrier, the latter can remain nice, readable OCaml that only manipulates plain OCaml values. -Below the ``Tezos_context`` +Below the ``Alpha_context`` --------------------------- For this part, in a first discovery of the source code, you can start by @@ -137,7 +137,7 @@ These transaction do not go as far as checking that, for instance, when the destination of a transaction is credited, the source is also debitted, as in some cases, it might not be the case. -Above the ``Tezos_context`` +Above the ``Alpha_context`` --------------------------- The three next sections describe the main entrypoints to the protocol: @@ -158,7 +158,7 @@ understood with minimum OCaml knowledge. You want to start from the shell entry points (validation of the block header, validation of an operation, finalization of a block validation), -and follow the control flow until you hit the ``Tezos_context`` +and follow the control flow until you hit the ``Alpha_context`` abstraction barrier. This will lead you to reading modules ``Baking`` and ``Amendment``. @@ -175,7 +175,7 @@ Protocol RPC API ~~~~~~~~~~~~~~~~ Finally, the RPCs specific to Alpha are also defined above the -``Tezos_context`` barrier. The definition is split into two parts. +``Alpha_context`` barrier. The definition is split into two parts. The first part, ``Services``, defines the RPC API: URL schemes with the types of parameters, and input and output JSON schemas. This interface diff --git a/src/bin_attacker/attacker_minimal.ml b/src/bin_attacker/attacker_minimal.ml index 23f539a67..3205a7ccb 100644 --- a/src/bin_attacker/attacker_minimal.ml +++ b/src/bin_attacker/attacker_minimal.ml @@ -40,11 +40,11 @@ let block_forged ?prev ops = let open Proto in let generate_proof_of_work_nonce () = Rand.generate - Proto.Tezos_context.Constants.proof_of_work_nonce_size in + Proto.Alpha_context.Constants.proof_of_work_nonce_size in let generate_seed_nonce () = match Proto.Nonce_storage.of_bytes @@ Rand.generate - Proto.Tezos_context.Constants.nonce_length with + Proto.Alpha_context.Constants.nonce_length with | Error _ -> assert false | Ok nonce -> nonce in Block_repr.forge_header (block ops) diff --git a/src/proto_alpha/lib_client/client_baking_blocks.ml b/src/proto_alpha/lib_client/client_baking_blocks.ml index 84fd23fdc..319d0b5cf 100644 --- a/src/proto_alpha/lib_client/client_baking_blocks.ml +++ b/src/proto_alpha/lib_client/client_baking_blocks.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context type block_info = { hash: Block_hash.t ; diff --git a/src/proto_alpha/lib_client/client_baking_blocks.mli b/src/proto_alpha/lib_client/client_baking_blocks.mli index 140f8ef6e..fe5eaa871 100644 --- a/src/proto_alpha/lib_client/client_baking_blocks.mli +++ b/src/proto_alpha/lib_client/client_baking_blocks.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context type block_info = { hash: Block_hash.t ; diff --git a/src/proto_alpha/lib_client/client_baking_daemon.mli b/src/proto_alpha/lib_client/client_baking_daemon.mli index 9a24ac5da..6023c44df 100644 --- a/src/proto_alpha/lib_client/client_baking_daemon.mli +++ b/src/proto_alpha/lib_client/client_baking_daemon.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val run: #Client_commands.full_context -> diff --git a/src/proto_alpha/lib_client/client_baking_endorsement.ml b/src/proto_alpha/lib_client/client_baking_endorsement.ml index 8a4f6b28e..bd057b181 100644 --- a/src/proto_alpha/lib_client/client_baking_endorsement.ml +++ b/src/proto_alpha/lib_client/client_baking_endorsement.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Logging.Client.Endorsement diff --git a/src/proto_alpha/lib_client/client_baking_endorsement.mli b/src/proto_alpha/lib_client/client_baking_endorsement.mli index a672e8c60..ee6087ff1 100644 --- a/src/proto_alpha/lib_client/client_baking_endorsement.mli +++ b/src/proto_alpha/lib_client/client_baking_endorsement.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val forge_endorsement: #Client_commands.full_context -> diff --git a/src/proto_alpha/lib_client/client_baking_forge.ml b/src/proto_alpha/lib_client/client_baking_forge.ml index 70263a33f..69d43e14e 100644 --- a/src/proto_alpha/lib_client/client_baking_forge.ml +++ b/src/proto_alpha/lib_client/client_baking_forge.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Logging.Client.Baking @@ -28,7 +28,7 @@ let forge_block_header let rec loop () = let proof_of_work_nonce = generate_proof_of_work_nonce () in let unsigned_header = - Tezos_context.Block_header.forge_unsigned + Alpha_context.Block_header.forge_unsigned shell { priority ; seed_nonce_hash ; proof_of_work_nonce } in Client_keys.append delegate_sk unsigned_header >>=? fun signed_header -> let block_hash = Block_hash.hash_bytes [signed_header] in @@ -43,7 +43,7 @@ let empty_proof_of_work_nonce = (String.make Constants_repr.proof_of_work_nonce_size '\000') let forge_faked_proto_header ~priority ~seed_nonce_hash = - Tezos_context.Block_header.forge_unsigned_proto_header + Alpha_context.Block_header.forge_unsigned_proto_header { priority ; seed_nonce_hash ; proof_of_work_nonce = empty_proof_of_work_nonce } diff --git a/src/proto_alpha/lib_client/client_baking_forge.mli b/src/proto_alpha/lib_client/client_baking_forge.mli index 13b83563f..f0bb0f735 100644 --- a/src/proto_alpha/lib_client/client_baking_forge.mli +++ b/src/proto_alpha/lib_client/client_baking_forge.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val generate_seed_nonce: unit -> Nonce.t (** [generate_seed_nonce ()] is a random nonce that is typically used diff --git a/src/proto_alpha/lib_client/client_baking_lib.ml b/src/proto_alpha/lib_client/client_baking_lib.ml index 50f58db47..38bcb596e 100644 --- a/src/proto_alpha/lib_client/client_baking_lib.ml +++ b/src/proto_alpha/lib_client/client_baking_lib.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context let bake_block (cctxt : #Client_commands.full_context) block ?force ?max_priority ?(free_baking=false) ?src_sk delegate = diff --git a/src/proto_alpha/lib_client/client_baking_lib.mli b/src/proto_alpha/lib_client/client_baking_lib.mli index 13503b366..80b12ad28 100644 --- a/src/proto_alpha/lib_client/client_baking_lib.mli +++ b/src/proto_alpha/lib_client/client_baking_lib.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context (** Mine a block *) val bake_block: diff --git a/src/proto_alpha/lib_client/client_baking_operations.ml b/src/proto_alpha/lib_client/client_baking_operations.ml index ac41c6bdc..b3f049507 100644 --- a/src/proto_alpha/lib_client/client_baking_operations.ml +++ b/src/proto_alpha/lib_client/client_baking_operations.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context type operation = { hash: Operation_hash.t ; @@ -43,7 +43,7 @@ type valid_endorsement = { (* let filter_valid_endorsement cctxt ({ hash ; content } : operation) = - let open Tezos_context in + let open Alpha_context in match content with | None | Some { contents = Anonymous_operations _ } diff --git a/src/proto_alpha/lib_client/client_baking_operations.mli b/src/proto_alpha/lib_client/client_baking_operations.mli index eb1f0edfb..117f3d13c 100644 --- a/src/proto_alpha/lib_client/client_baking_operations.mli +++ b/src/proto_alpha/lib_client/client_baking_operations.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context type operation = { hash: Operation_hash.t ; diff --git a/src/proto_alpha/lib_client/client_baking_revelation.ml b/src/proto_alpha/lib_client/client_baking_revelation.ml index e942bdc02..82df93657 100644 --- a/src/proto_alpha/lib_client/client_baking_revelation.ml +++ b/src/proto_alpha/lib_client/client_baking_revelation.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context let inject_seed_nonce_revelation rpc_config block ?async nonces = let operations = diff --git a/src/proto_alpha/lib_client/client_baking_revelation.mli b/src/proto_alpha/lib_client/client_baking_revelation.mli index 7663daa3e..faa201672 100644 --- a/src/proto_alpha/lib_client/client_baking_revelation.mli +++ b/src/proto_alpha/lib_client/client_baking_revelation.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val inject_seed_nonce_revelation: #RPC_context.simple -> diff --git a/src/proto_alpha/lib_client/client_proto_args.ml b/src/proto_alpha/lib_client/client_proto_args.ml index 28458ecfb..74c4ad726 100644 --- a/src/proto_alpha/lib_client/client_proto_args.ml +++ b/src/proto_alpha/lib_client/client_proto_args.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Cli_entries type error += Bad_tez_arg of string * string (* Arg_name * value *) diff --git a/src/proto_alpha/lib_client/client_proto_args.mli b/src/proto_alpha/lib_client/client_proto_args.mli index e6a3e7df7..90ec654a8 100644 --- a/src/proto_alpha/lib_client/client_proto_args.mli +++ b/src/proto_alpha/lib_client/client_proto_args.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val tez_sym: string diff --git a/src/proto_alpha/lib_client/client_proto_context.ml b/src/proto_alpha/lib_client/client_proto_context.ml index e9860ca87..056894027 100644 --- a/src/proto_alpha/lib_client/client_proto_context.ml +++ b/src/proto_alpha/lib_client/client_proto_context.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Tezos_micheline open Client_proto_contracts open Client_keys diff --git a/src/proto_alpha/lib_client/client_proto_context.mli b/src/proto_alpha/lib_client/client_proto_context.mli index af9783fb1..68d08d1c1 100644 --- a/src/proto_alpha/lib_client/client_proto_context.mli +++ b/src/proto_alpha/lib_client/client_proto_context.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val list_contract_labels : #Client_commands.full_context -> diff --git a/src/proto_alpha/lib_client/client_proto_context_commands.ml b/src/proto_alpha/lib_client/client_proto_context_commands.ml index 478b7bb28..15dea9c28 100644 --- a/src/proto_alpha/lib_client/client_proto_context_commands.ml +++ b/src/proto_alpha/lib_client/client_proto_context_commands.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Tezos_micheline open Client_proto_context open Client_proto_contracts diff --git a/src/proto_alpha/lib_client/client_proto_contracts.ml b/src/proto_alpha/lib_client/client_proto_contracts.ml index 4bbdcb728..f94ea4a5f 100644 --- a/src/proto_alpha/lib_client/client_proto_contracts.ml +++ b/src/proto_alpha/lib_client/client_proto_contracts.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context module ContractEntity = struct type t = Contract.t diff --git a/src/proto_alpha/lib_client/client_proto_contracts.mli b/src/proto_alpha/lib_client/client_proto_contracts.mli index 82cd6e4fe..ea2a1625f 100644 --- a/src/proto_alpha/lib_client/client_proto_contracts.mli +++ b/src/proto_alpha/lib_client/client_proto_contracts.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Cli_entries module RawContractAlias : diff --git a/src/proto_alpha/lib_client/client_proto_contracts_commands.ml b/src/proto_alpha/lib_client/client_proto_contracts_commands.ml index fa0934538..a0a18d543 100644 --- a/src/proto_alpha/lib_client/client_proto_contracts_commands.ml +++ b/src/proto_alpha/lib_client/client_proto_contracts_commands.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Client_proto_contracts let group = diff --git a/src/proto_alpha/lib_client/client_proto_nonces.ml b/src/proto_alpha/lib_client/client_proto_nonces.ml index bd1689c96..32d112276 100644 --- a/src/proto_alpha/lib_client/client_proto_nonces.ml +++ b/src/proto_alpha/lib_client/client_proto_nonces.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context (* TODO locking... *) diff --git a/src/proto_alpha/lib_client/client_proto_nonces.mli b/src/proto_alpha/lib_client/client_proto_nonces.mli index 629b0c4c9..49f519379 100644 --- a/src/proto_alpha/lib_client/client_proto_nonces.mli +++ b/src/proto_alpha/lib_client/client_proto_nonces.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val mem: #Client_commands.wallet -> diff --git a/src/proto_alpha/lib_client/client_proto_programs.ml b/src/proto_alpha/lib_client/client_proto_programs.ml index 92fc8caca..e98303857 100644 --- a/src/proto_alpha/lib_client/client_proto_programs.ml +++ b/src/proto_alpha/lib_client/client_proto_programs.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Tezos_micheline open Michelson_v1_printer diff --git a/src/proto_alpha/lib_client/client_proto_programs.mli b/src/proto_alpha/lib_client/client_proto_programs.mli index 7beb4469f..d93f6ba96 100644 --- a/src/proto_alpha/lib_client/client_proto_programs.mli +++ b/src/proto_alpha/lib_client/client_proto_programs.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Tezos_micheline module Program : Client_aliases.Alias diff --git a/src/proto_alpha/lib_client/client_proto_rpcs.ml b/src/proto_alpha/lib_client/client_proto_rpcs.ml index 96f737646..8deed616b 100644 --- a/src/proto_alpha/lib_client/client_proto_rpcs.ml +++ b/src/proto_alpha/lib_client/client_proto_rpcs.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context let make_call1 cctxt s= RPC_context.make_call1 (s Block_services.S.proto_path) cctxt @@ -184,7 +184,7 @@ module Helpers = struct block ~branch ~source ?sourcePubKey ~counter ~amount ~destination ?parameters ~fee ()= operations cctxt block ~branch ~source ?sourcePubKey ~counter ~fee - Tezos_context.[Transaction { amount ; parameters ; destination }] + Alpha_context.[Transaction { amount ; parameters ; destination }] let origination cctxt block ~branch ~source ?sourcePubKey ~counter @@ -193,7 +193,7 @@ module Helpers = struct ?(delegatable = true) ?delegatePubKey ?script ~fee () = operations cctxt block ~branch ~source ?sourcePubKey ~counter ~fee - Tezos_context.[ + Alpha_context.[ Origination { manager = managerPubKey ; delegate = delegatePubKey ; script ; @@ -204,7 +204,7 @@ module Helpers = struct let delegation cctxt block ~branch ~source ?sourcePubKey ~counter ~fee delegate = operations cctxt block ~branch ~source ?sourcePubKey ~counter ~fee - Tezos_context.[Delegation delegate] + Alpha_context.[Delegation delegate] end module Delegate = struct let operations cctxt @@ -215,15 +215,15 @@ module Helpers = struct let endorsement cctxt b ~branch ~source ~block ~slot () = operations cctxt b ~branch ~source - Tezos_context.[Endorsement { block ; slot }] + Alpha_context.[Endorsement { block ; slot }] let proposals cctxt b ~branch ~source ~period ~proposals () = operations cctxt b ~branch ~source - Tezos_context.[Proposals { period ; proposals }] + Alpha_context.[Proposals { period ; proposals }] let ballot cctxt b ~branch ~source ~period ~proposal ~ballot () = operations cctxt b ~branch ~source - Tezos_context.[Ballot { period ; proposal ; ballot }] + Alpha_context.[Ballot { period ; proposal ; ballot }] end module Dictator = struct let operation cctxt diff --git a/src/proto_alpha/lib_client/client_proto_rpcs.mli b/src/proto_alpha/lib_client/client_proto_rpcs.mli index 961e03090..ef26c1e0a 100644 --- a/src/proto_alpha/lib_client/client_proto_rpcs.mli +++ b/src/proto_alpha/lib_client/client_proto_rpcs.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context type block = Block_services.block diff --git a/src/proto_alpha/lib_client/michelson_v1_emacs.mli b/src/proto_alpha/lib_client/michelson_v1_emacs.mli index 6898f7111..c59a4dc21 100644 --- a/src/proto_alpha/lib_client/michelson_v1_emacs.mli +++ b/src/proto_alpha/lib_client/michelson_v1_emacs.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val print_expr : Format.formatter -> diff --git a/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml b/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml index add65d155..62e5fe15a 100644 --- a/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml +++ b/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Tezos_micheline open Script_typed_ir open Script_tc_errors diff --git a/src/proto_alpha/lib_client/michelson_v1_parser.mli b/src/proto_alpha/lib_client/michelson_v1_parser.mli index 889eac033..1325b018e 100644 --- a/src/proto_alpha/lib_client/michelson_v1_parser.mli +++ b/src/proto_alpha/lib_client/michelson_v1_parser.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Tezos_micheline diff --git a/src/proto_alpha/lib_client/michelson_v1_printer.mli b/src/proto_alpha/lib_client/michelson_v1_printer.mli index 4df68eee8..f8a8bd289 100644 --- a/src/proto_alpha/lib_client/michelson_v1_printer.mli +++ b/src/proto_alpha/lib_client/michelson_v1_printer.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Tezos_micheline val print_expr : diff --git a/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml b/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml index ca54fa286..7793bb92a 100644 --- a/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml +++ b/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context let (//) = Filename.concat diff --git a/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli b/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli index dbab214c7..574060910 100644 --- a/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli +++ b/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val init : ?exe:string -> @@ -19,7 +19,7 @@ val init : forked Tezos node and the block info of the block from where the tests will begin. *) -val level : Block_services.block -> Tezos_context.Level.t tzresult Lwt.t +val level : Block_services.block -> Alpha_context.Level.t tzresult Lwt.t module Account : sig diff --git a/src/proto_alpha/lib_client/test/test_endorsement.ml b/src/proto_alpha/lib_client/test/test_endorsement.ml index 390f86b89..ac4130899 100644 --- a/src/proto_alpha/lib_client/test/test_endorsement.ml +++ b/src/proto_alpha/lib_client/test/test_endorsement.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context module Helpers = Proto_alpha_helpers module Assert = Helpers.Assert diff --git a/src/proto_alpha/lib_client/test/test_origination.ml b/src/proto_alpha/lib_client/test/test_origination.ml index 128db3959..91054dee6 100644 --- a/src/proto_alpha/lib_client/test/test_origination.ml +++ b/src/proto_alpha/lib_client/test/test_origination.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context module Helpers = Proto_alpha_helpers module Assert = Helpers.Assert diff --git a/src/proto_alpha/lib_client/test/test_transaction.ml b/src/proto_alpha/lib_client/test/test_transaction.ml index d8eb84405..ee9173f4b 100644 --- a/src/proto_alpha/lib_client/test/test_transaction.ml +++ b/src/proto_alpha/lib_client/test/test_transaction.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context module Helpers = Proto_alpha_helpers module Assert = Helpers.Assert diff --git a/src/proto_alpha/lib_client/test/test_vote.ml b/src/proto_alpha/lib_client/test/test_vote.ml index 4190f8cca..ff69c4f15 100644 --- a/src/proto_alpha/lib_client/test/test_vote.ml +++ b/src/proto_alpha/lib_client/test/test_vote.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Proto_alpha_helpers let demo_protocol = diff --git a/src/proto_alpha/lib_protocol/src/TEZOS_PROTOCOL b/src/proto_alpha/lib_protocol/src/TEZOS_PROTOCOL index 57e1f01ef..d2e629b3a 100644 --- a/src/proto_alpha/lib_protocol/src/TEZOS_PROTOCOL +++ b/src/proto_alpha/lib_protocol/src/TEZOS_PROTOCOL @@ -43,7 +43,7 @@ "Init_storage", "Public_key_storage", - "Tezos_context", + "Alpha_context", "Script_typed_ir", "Gas", diff --git a/src/proto_alpha/lib_protocol/src/tezos_context.ml b/src/proto_alpha/lib_protocol/src/alpha_context.ml similarity index 100% rename from src/proto_alpha/lib_protocol/src/tezos_context.ml rename to src/proto_alpha/lib_protocol/src/alpha_context.ml diff --git a/src/proto_alpha/lib_protocol/src/tezos_context.mli b/src/proto_alpha/lib_protocol/src/alpha_context.mli similarity index 100% rename from src/proto_alpha/lib_protocol/src/tezos_context.mli rename to src/proto_alpha/lib_protocol/src/alpha_context.mli diff --git a/src/proto_alpha/lib_protocol/src/amendment.ml b/src/proto_alpha/lib_protocol/src/amendment.ml index 15e039e40..735f16203 100644 --- a/src/proto_alpha/lib_protocol/src/amendment.ml +++ b/src/proto_alpha/lib_protocol/src/amendment.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context let () = () diff --git a/src/proto_alpha/lib_protocol/src/amendment.mli b/src/proto_alpha/lib_protocol/src/amendment.mli index a0534736e..ca47a0b9c 100644 --- a/src/proto_alpha/lib_protocol/src/amendment.mli +++ b/src/proto_alpha/lib_protocol/src/amendment.mli @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context val may_start_new_voting_cycle: context -> context tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/src/apply.ml b/src/proto_alpha/lib_protocol/src/apply.ml index ec0d8f5ae..624a4b40b 100644 --- a/src/proto_alpha/lib_protocol/src/apply.ml +++ b/src/proto_alpha/lib_protocol/src/apply.ml @@ -9,7 +9,7 @@ (** Tezos Protocol Implementation - Main Entry Points *) -open Tezos_context +open Alpha_context type error += Wrong_voting_period of Voting_period.t * Voting_period.t (* `Temporary *) type error += Wrong_endorsement_predecessor of Block_hash.t * Block_hash.t (* `Temporary *) diff --git a/src/proto_alpha/lib_protocol/src/baking.ml b/src/proto_alpha/lib_protocol/src/baking.ml index 569d7d8c2..d31526b3e 100644 --- a/src/proto_alpha/lib_protocol/src/baking.ml +++ b/src/proto_alpha/lib_protocol/src/baking.ml @@ -8,7 +8,7 @@ (**************************************************************************) -open Tezos_context +open Alpha_context open Misc type error += Invalid_fitness_gap of int64 * int64 (* `Permanent *) @@ -114,7 +114,7 @@ let minimal_time c priority pred_timestamp = let check_timestamp c priority pred_timestamp = minimal_time c priority pred_timestamp >>=? fun minimal_time -> - let timestamp = Tezos_context.Timestamp.current c in + let timestamp = Alpha_context.Timestamp.current c in fail_unless Timestamp.(minimal_time <= timestamp) (Timestamp_too_early (minimal_time, timestamp)) diff --git a/src/proto_alpha/lib_protocol/src/baking.mli b/src/proto_alpha/lib_protocol/src/baking.mli index 8d3e64c5c..fa0e5b65b 100644 --- a/src/proto_alpha/lib_protocol/src/baking.mli +++ b/src/proto_alpha/lib_protocol/src/baking.mli @@ -8,7 +8,7 @@ (**************************************************************************) -open Tezos_context +open Alpha_context open Misc type error += Invalid_fitness_gap of int64 * int64 (* `Permanent *) diff --git a/src/proto_alpha/lib_protocol/src/gas.ml b/src/proto_alpha/lib_protocol/src/gas.ml index 4d7ea17a4..ee7b77aa2 100644 --- a/src/proto_alpha/lib_protocol/src/gas.ml +++ b/src/proto_alpha/lib_protocol/src/gas.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context (* FIXME: this really is a preliminary estimation of costs, everything in this file needs to be tweaked and proofread. *) diff --git a/src/proto_alpha/lib_protocol/src/gas.mli b/src/proto_alpha/lib_protocol/src/gas.mli index 3695bfa5f..da412aa47 100644 --- a/src/proto_alpha/lib_protocol/src/gas.mli +++ b/src/proto_alpha/lib_protocol/src/gas.mli @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context type t type cost diff --git a/src/proto_alpha/lib_protocol/src/main.ml b/src/proto_alpha/lib_protocol/src/main.ml index 80ad689c3..e8d1dc5b2 100644 --- a/src/proto_alpha/lib_protocol/src/main.ml +++ b/src/proto_alpha/lib_protocol/src/main.ml @@ -9,13 +9,13 @@ (* Tezos Protocol Implementation - Protocol Signature Instance *) -type operation = Tezos_context.operation +type operation = Alpha_context.operation -let parse_operation = Tezos_context.Operation.parse -let acceptable_passes = Tezos_context.Operation.acceptable_passes +let parse_operation = Alpha_context.Operation.parse +let acceptable_passes = Alpha_context.Operation.acceptable_passes let max_block_length = - Tezos_context.Block_header.max_header_length + Alpha_context.Block_header.max_header_length let validation_passes = Updater.[ { max_size = 32 * 1024 ; max_op = None } ; (* 32kB FIXME *) @@ -25,31 +25,31 @@ let rpc_services = Services_registration.rpc_services type validation_mode = | Application of { - block_header : Tezos_context.Block_header.t ; - baker : Tezos_context.public_key_hash ; + block_header : Alpha_context.Block_header.t ; + baker : Alpha_context.public_key_hash ; } | Partial_construction of { predecessor : Block_hash.t ; } | Full_construction of { predecessor : Block_hash.t ; - block_proto_header : Tezos_context.Block_header.proto_header ; - baker : Tezos_context.public_key_hash ; + block_proto_header : Alpha_context.Block_header.proto_header ; + baker : Alpha_context.public_key_hash ; } type validation_state = { mode : validation_mode ; - ctxt : Tezos_context.t ; + ctxt : Alpha_context.t ; op_count : int } let current_context { ctxt } = - return (Tezos_context.finalize ctxt).context + return (Alpha_context.finalize ctxt).context let precheck_block ~ancestor_context:_ ~ancestor_timestamp:_ raw_block = - Lwt.return (Tezos_context.Block_header.parse raw_block) >>=? fun _ -> + Lwt.return (Alpha_context.Block_header.parse raw_block) >>=? fun _ -> (* TODO: decide what other properties should be checked *) return () @@ -58,11 +58,11 @@ let begin_application ~predecessor_timestamp:pred_timestamp ~predecessor_fitness:pred_fitness raw_block = - Lwt.return (Tezos_context.Block_header.parse raw_block) >>=? fun block_header -> + Lwt.return (Alpha_context.Block_header.parse raw_block) >>=? fun block_header -> let level = block_header.shell.level in let fitness = pred_fitness in let timestamp = block_header.shell.timestamp in - Tezos_context.init ~level ~timestamp ~fitness ctxt >>=? fun ctxt -> + Alpha_context.init ~level ~timestamp ~fitness ctxt >>=? fun ctxt -> Apply.begin_application ctxt block_header pred_timestamp >>=? fun (ctxt, baker) -> let mode = Application { block_header ; baker } in @@ -79,7 +79,7 @@ let begin_construction () = let level = Int32.succ pred_level in let fitness = pred_fitness in - Tezos_context.init ~timestamp ~level ~fitness ctxt >>=? fun ctxt -> + Alpha_context.init ~timestamp ~level ~fitness ctxt >>=? fun ctxt -> begin match proto_header with | None -> @@ -107,7 +107,7 @@ let apply_operation ({ mode ; ctxt ; op_count } as data) operation = | Full_construction { predecessor ; block_proto_header ; baker } -> predecessor, block_proto_header.priority, - Some (Tezos_context.Contract.default_contract baker) in + Some (Alpha_context.Contract.default_contract baker) in Apply.apply_operation ctxt baker_contract pred_block block_prio operation >>=? fun (ctxt, _contracts, _ignored_script_error) -> @@ -116,25 +116,25 @@ let apply_operation ({ mode ; ctxt ; op_count } as data) operation = let finalize_block { mode ; ctxt ; op_count } = match mode with | Partial_construction _ -> - let ctxt = Tezos_context.finalize ctxt in + let ctxt = Alpha_context.finalize ctxt in return ctxt | Application { baker ; block_header = { proto = block_proto_header } } | Full_construction { block_proto_header ; baker } -> Apply.finalize_application ctxt block_proto_header baker >>=? fun ctxt -> - let { level } : Tezos_context.Level.t = - Tezos_context. Level.current ctxt in + let { level } : Alpha_context.Level.t = + Alpha_context. Level.current ctxt in let priority = block_proto_header.priority in - let level = Tezos_context.Raw_level.to_int32 level in - let fitness = Tezos_context.Fitness.current ctxt in + let level = Alpha_context.Raw_level.to_int32 level in + let fitness = Alpha_context.Fitness.current ctxt in let commit_message = Format.asprintf "lvl %ld, fit %Ld, prio %d, %d ops" level fitness priority op_count in - let ctxt = Tezos_context.finalize ~commit_message ctxt in + let ctxt = Alpha_context.finalize ~commit_message ctxt in return ctxt let compare_operations op1 op2 = Apply.compare_operations op1 op2 -let configure_sandbox = Tezos_context.configure_sandbox +let configure_sandbox = Alpha_context.configure_sandbox diff --git a/src/proto_alpha/lib_protocol/src/main.mli b/src/proto_alpha/lib_protocol/src/main.mli index 2317d4d80..5be87ad0c 100644 --- a/src/proto_alpha/lib_protocol/src/main.mli +++ b/src/proto_alpha/lib_protocol/src/main.mli @@ -9,4 +9,4 @@ (** Tezos Protocol Implementation - Protocol Signature Instance *) -include Updater.PROTOCOL with type operation = Tezos_context.Operation.t +include Updater.PROTOCOL with type operation = Alpha_context.Operation.t diff --git a/src/proto_alpha/lib_protocol/src/script_interpreter.ml b/src/proto_alpha/lib_protocol/src/script_interpreter.ml index 15c3c4505..1424451ce 100644 --- a/src/proto_alpha/lib_protocol/src/script_interpreter.ml +++ b/src/proto_alpha/lib_protocol/src/script_interpreter.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context open Script open Script_typed_ir open Script_tc_errors diff --git a/src/proto_alpha/lib_protocol/src/script_interpreter.mli b/src/proto_alpha/lib_protocol/src/script_interpreter.mli index e1964ee3f..45e9f416e 100644 --- a/src/proto_alpha/lib_protocol/src/script_interpreter.mli +++ b/src/proto_alpha/lib_protocol/src/script_interpreter.mli @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context type error += Overflow of Script.location type error += Reject of Script.location @@ -18,7 +18,7 @@ val dummy_storage_fee : Tez.t val execute: Contract.origination_nonce -> - Contract.t -> Contract.t -> Tezos_context.t -> + Contract.t -> Contract.t -> Alpha_context.t -> Script.t -> Tez.t -> Script.expr -> Gas.t -> (Script.expr * Script.expr * Gas.t * context * Contract.origination_nonce * @@ -26,7 +26,7 @@ val execute: val trace: Contract.origination_nonce -> - Contract.t -> Contract.t -> Tezos_context.t -> + Contract.t -> Contract.t -> Alpha_context.t -> Script.t -> Tez.t -> Script.expr -> Gas.t -> ((Script.expr * Script.expr * Gas.t * context * Contract.origination_nonce * Script_typed_ir.ex_big_map option) * diff --git a/src/proto_alpha/lib_protocol/src/script_ir_translator.ml b/src/proto_alpha/lib_protocol/src/script_ir_translator.ml index 36bb421db..b5943384f 100644 --- a/src/proto_alpha/lib_protocol/src/script_ir_translator.ml +++ b/src/proto_alpha/lib_protocol/src/script_ir_translator.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context open Micheline open Script open Script_typed_ir @@ -2136,7 +2136,7 @@ let hash_data typ data = let big_map_mem ctx contract key { diff ; key_type } = match map_get key diff with - | None -> Tezos_context.Contract.Big_map_storage.mem ctx contract (hash_data key_type key) + | None -> Alpha_context.Contract.Big_map_storage.mem ctx contract (hash_data key_type key) | Some None -> Lwt.return false | Some (Some _) -> Lwt.return true @@ -2144,7 +2144,7 @@ let big_map_get ctx contract key { diff ; key_type ; value_type } = match map_get key diff with | Some x -> return x | None -> - Tezos_context.Contract.Big_map_storage.get_opt + Alpha_context.Contract.Big_map_storage.get_opt ctx contract (hash_data key_type key) >>=? begin function | None -> return None diff --git a/src/proto_alpha/lib_protocol/src/script_ir_translator.mli b/src/proto_alpha/lib_protocol/src/script_ir_translator.mli index 8a0ee818b..272aff05a 100644 --- a/src/proto_alpha/lib_protocol/src/script_ir_translator.mli +++ b/src/proto_alpha/lib_protocol/src/script_ir_translator.mli @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context open Script_tc_errors type ('ta, 'tb) eq = Eq : ('same, 'same) eq @@ -38,9 +38,9 @@ val map_get : 'key -> ('key, 'value) Script_typed_ir.map -> 'value option val map_key_ty : ('a, 'b) Script_typed_ir.map -> 'a Script_typed_ir.comparable_ty val map_size : ('a, 'b) Script_typed_ir.map -> Script_int.n Script_int.num -val big_map_mem : context -> Tezos_context.Contract.t -> 'key -> ('key, 'value) Script_typed_ir.big_map -> bool Lwt.t +val big_map_mem : context -> Alpha_context.Contract.t -> 'key -> ('key, 'value) Script_typed_ir.big_map -> bool Lwt.t val big_map_get : - context -> Tezos_context.Contract.t -> 'key -> ('key, 'value) Script_typed_ir.big_map -> + context -> Alpha_context.Contract.t -> 'key -> ('key, 'value) Script_typed_ir.big_map -> 'value option tzresult Lwt.t val big_map_update : 'key -> 'value option -> ('key, 'value) Script_typed_ir.big_map -> diff --git a/src/proto_alpha/lib_protocol/src/script_tc_errors.ml b/src/proto_alpha/lib_protocol/src/script_tc_errors.ml index a3b1ee15a..5ac5d09d0 100644 --- a/src/proto_alpha/lib_protocol/src/script_tc_errors.ml +++ b/src/proto_alpha/lib_protocol/src/script_tc_errors.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context open Script open Script_typed_ir diff --git a/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml b/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml index 19d4336d0..c529ce330 100644 --- a/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml +++ b/src/proto_alpha/lib_protocol/src/script_tc_errors_registration.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context open Micheline open Script open Script_typed_ir diff --git a/src/proto_alpha/lib_protocol/src/script_typed_ir.ml b/src/proto_alpha/lib_protocol/src/script_typed_ir.ml index 964f36bba..9d65df7c4 100644 --- a/src/proto_alpha/lib_protocol/src/script_typed_ir.ml +++ b/src/proto_alpha/lib_protocol/src/script_typed_ir.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context open Script_int diff --git a/src/proto_alpha/lib_protocol/src/services.ml b/src/proto_alpha/lib_protocol/src/services.ml index fafcc1872..311692c2e 100644 --- a/src/proto_alpha/lib_protocol/src/services.ml +++ b/src/proto_alpha/lib_protocol/src/services.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Data_encoding -open Tezos_context +open Alpha_context let operations custom_root = RPC_service.post_service @@ -617,7 +617,7 @@ module Helpers = struct (req "nonce_hash" Nonce_hash.encoding) (dft "proof_of_work_nonce" (Fixed.bytes - Tezos_context.Constants.proof_of_work_nonce_size) + Alpha_context.Constants.proof_of_work_nonce_size) empty_proof_of_work_nonce)) ~output: (obj1 (req "proto_header" bytes)) RPC_path.(custom_root / "helpers" / "forge" / "block_proto_header") diff --git a/src/proto_alpha/lib_protocol/src/services_registration.ml b/src/proto_alpha/lib_protocol/src/services_registration.ml index 6d3b3477c..0b901be06 100644 --- a/src/proto_alpha/lib_protocol/src/services_registration.ml +++ b/src/proto_alpha/lib_protocol/src/services_registration.ml @@ -7,14 +7,14 @@ (* *) (**************************************************************************) -open Tezos_context +open Alpha_context type rpc_context = { block_hash: Block_hash.t ; block_header: Block_header.raw ; operation_hashes: unit -> Operation_hash.t list list Lwt.t ; operations: unit -> Operation.raw list list Lwt.t ; - context: Tezos_context.t ; + context: Alpha_context.t ; } let rpc_init (rpc_context : Updater.rpc_context Lwt.t) = @@ -23,7 +23,7 @@ let rpc_init (rpc_context : Updater.rpc_context Lwt.t) = let level = Int32.succ block_header.shell.level in let timestamp = block_header.shell.timestamp in let fitness = block_header.shell.fitness in - Tezos_context.init ~level ~timestamp ~fitness context >>=? fun context -> + Alpha_context.init ~level ~timestamp ~fitness context >>=? fun context -> return { block_hash ; block_header ; operation_hashes ; operations ; context } let rpc_services = ref (RPC_directory.empty : Updater.rpc_context Lwt.t RPC_directory.t) @@ -255,7 +255,7 @@ let minimal_timestamp ctxt prio = let () = register1 Services.Helpers.minimal_timestamp (fun ctxt () slot -> - let timestamp = Tezos_context.Timestamp.current ctxt in + let timestamp = Alpha_context.Timestamp.current ctxt in minimal_timestamp ctxt slot timestamp) let () = @@ -268,7 +268,7 @@ let () = | None -> Error_monad.fail Operation.Cannot_parse_operation | Some (shell, contents) -> let operation = { hash ; shell ; contents ; signature } in - let level = Tezos_context.Level.current ctxt in + let level = Alpha_context.Level.current ctxt in Baking.baking_priorities ctxt level >>=? fun (Misc.LCons (baker_pkh, _)) -> let baker_contract = Contract.default_contract baker_pkh in let block_prio = 0 in diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_account.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_account.ml index 6fa6ad3c0..e31cba790 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_account.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_account.ml @@ -9,7 +9,7 @@ open Proto_alpha.Error_monad -open Proto_alpha.Tezos_context +open Proto_alpha.Alpha_context type account = { hpub : Ed25519.Public_key_hash.t ; diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_account.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_account.mli index 8a852ec98..eeeffc380 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_account.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_account.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context (** Facilities to deal with accounts , bootstrap accounts and make new accounts *) diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_apply.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_apply.mli index f96a1d1e1..7d0c289ac 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_apply.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_apply.mli @@ -10,7 +10,7 @@ (** Functions to build and apply operations *) open Proto_alpha -open Tezos_context +open Alpha_context val operation : tc:context -> ?baker:Helpers_account.t -> ?src:Helpers_account.t -> diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml index a4147c9d3..f40be27c6 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context module Assert = struct let fail expected given msg = diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.mli index 334258e40..250ad07ec 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val fail : string -> string -> string -> 'a (** Raises [Failed] with the passed parameters diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_block.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_block.ml index 5882884d9..7bdfb65e5 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_block.ml @@ -12,7 +12,7 @@ open Error_monad type shell_header = Block_header.shell_header type tezos_header = Block_header.t -type protocol_header = Proto_alpha.Tezos_context.Block_header.proto_header +type protocol_header = Proto_alpha.Alpha_context.Block_header.proto_header type operation_header = Operation.shell_header type init_block = { @@ -33,7 +33,7 @@ type result = { hash : Block_hash.t ; level : Int32.t ; validation : Updater.validation_result ; - tezos_context : Proto_alpha.Tezos_context.t + tezos_context : Proto_alpha.Alpha_context.t } let get_op_header_res (res : result) : operation_header = { @@ -43,7 +43,7 @@ let get_op_header_res (res : result) : operation_header = { let get_proto_header priority : protocol_header = { priority ; proof_of_work_nonce = Helpers_crypto.generate_proof_of_work_nonce (); - seed_nonce_hash = Proto_alpha.Tezos_context.Nonce.hash @@ Helpers_crypto.generate_seed_nonce () + seed_nonce_hash = Proto_alpha.Alpha_context.Nonce.hash @@ Helpers_crypto.generate_seed_nonce () } let get_op_header pbh : operation_header = { @@ -64,7 +64,7 @@ let init (pred_shell_header : shell_header) pred_block_hash let (sourced_operations, operation_hashs) = List.split src_ops_hashs in let proto_header = get_proto_header priority in let proto_header_bytes = - Proto_alpha.Tezos_context.Block_header.forge_unsigned_proto_header + Proto_alpha.Alpha_context.Block_header.forge_unsigned_proto_header proto_header in let timestamp = @@ -127,7 +127,7 @@ let get_header_hash shell = shell_header ; proto = init_block.proto_header_bytes } in - Proto_alpha.Tezos_context.init + Proto_alpha.Alpha_context.init validation_result.context ~level ~timestamp diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_block.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_block.mli index 48107a760..1254fce17 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_block.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_block.mli @@ -13,7 +13,7 @@ open Proto_alpha type shell_header = Block_header.shell_header type tezos_header = Block_header.t -type protocol_header = Tezos_context.Block_header.proto_header +type protocol_header = Alpha_context.Block_header.proto_header type operation_header = Operation.shell_header (** Block before application *) @@ -37,23 +37,23 @@ type result = { hash : Block_hash.t; level : Int32.t; validation : Updater.validation_result; - tezos_context : Tezos_context.t; + tezos_context : Alpha_context.t; } val get_op_header_res : result -> operation_header val get_proto_header : int -> protocol_header val get_op_header : Block_hash.t -> operation_header val make_sourced_operation : Operation.shell_header -> - Tezos_context.proto_operation * + Alpha_context.proto_operation * Helpers_account.t -> ((Proto_alpha.Main.operation * Helpers_account.t) * Operation_hash.t) proto_tzresult val init : shell_header -> Block_hash.t -> Int32.t -> int -> - (Tezos_context.proto_operation * Helpers_account.t) list -> + (Alpha_context.proto_operation * Helpers_account.t) list -> Context.t -> init_block proto_tzresult val init_of_result : ?priority:int -> res:result -> - ops:(Tezos_context.proto_operation * Helpers_account.t) list -> + ops:(Alpha_context.proto_operation * Helpers_account.t) list -> init_block proto_tzresult val get_level : string option -> int32 val get_header_hash : @@ -64,11 +64,11 @@ val begin_construction_pre : val make : init_block -> result proto_tzresult Lwt.t val make_init : shell_header -> Block_hash.t -> Int32.t -> int -> - (Tezos_context.proto_operation * Helpers_account.t) list -> + (Alpha_context.proto_operation * Helpers_account.t) list -> Context.t -> result proto_tzresult Lwt.t val of_res : ?priority:int -> - ?ops:(Tezos_context.proto_operation * Helpers_account.t) list -> + ?ops:(Alpha_context.proto_operation * Helpers_account.t) list -> res:result -> unit -> result proto_tzresult Lwt.t val endorsement : diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.ml index 055a72a7e..6ae71a724 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Proto_alpha.Tezos_context +open Proto_alpha.Alpha_context exception Tez_error diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.mli index 15c4c8b84..fa7e308a7 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_cast.mli @@ -7,11 +7,11 @@ (* *) (**************************************************************************) -open Proto_alpha.Tezos_context +open Proto_alpha.Alpha_context exception Tez_error -(** Common casts between Tezos_context types *) +(** Common casts between Alpha_context types *) val tez_of_int : int -> Tez.tez val cents_of_int : int -> Tez.tez diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.ml index 978869600..368ca66f8 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Proto_alpha.Tezos_context +open Proto_alpha.Alpha_context let generate_proof_of_work_nonce () = Rand.generate Constants.proof_of_work_nonce_size diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.mli index 3976054d1..688f0000d 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_crypto.mli @@ -10,4 +10,4 @@ (** Extension of the Sodium module with helpers functions *) val generate_proof_of_work_nonce : unit -> MBytes.t -val generate_seed_nonce : unit -> Proto_alpha.Tezos_context.Nonce.nonce +val generate_seed_nonce : unit -> Proto_alpha.Alpha_context.Nonce.nonce diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml index 94aac7a98..0fe36c482 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml @@ -37,7 +37,7 @@ let main () = } in let proto_header = Data_encoding.Binary.to_bytes - Tezos_context.Block_header.proto_header_encoding + Alpha_context.Block_header.proto_header_encoding (Helpers_block.get_proto_header 0) in let tezos_header = { Block_header.shell = header ; proto = proto_header } in Proto_alpha.Main.begin_construction @@ -51,7 +51,7 @@ let main () = () >>=? fun vstate -> let hash = Block_header.hash tezos_header in Proto_alpha.Main.finalize_block vstate >>=? fun validation -> - Tezos_context.init + Alpha_context.init ~level: (Int32.succ header.level) ~timestamp: header.timestamp ~fitness: header.fitness diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.ml index a5d09c5a5..f12f115dd 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.ml @@ -9,12 +9,12 @@ open Proto_alpha open Error_monad -open Tezos_context +open Alpha_context let sourced ops = Sourced_operations ops let manager (src : Helpers_account.t) ?(fee = Tez.zero) operations context = - Tezos_context.init ~level:0l ~timestamp:(Time.now ()) ~fitness:[] context >>=? fun context -> + Alpha_context.init ~level:0l ~timestamp:(Time.now ()) ~fitness:[] context >>=? fun context -> Contract.get_counter context src.contract >>=? fun counter -> let counter = Int32.succ counter in return @@ diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli index 78b79cebc..6e672650f 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context (** Functions building operations *) @@ -46,7 +46,7 @@ val origination_full : proto_operation proto_tzresult Lwt.t val transaction_full : - ?fee:Tez.tez -> ?parameters:Proto_alpha.Tezos_context.Script.expr -> Helpers_account.t -> Contract.contract -> Tez.t -> + ?fee:Tez.tez -> ?parameters:Proto_alpha.Alpha_context.Script.expr -> Helpers_account.t -> Contract.contract -> Tez.t -> Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t val delegate : diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_script.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_script.ml index 7ad87d1df..afcb590d5 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_script.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_script.ml @@ -9,7 +9,7 @@ open Proto_alpha open Error_monad -open Tezos_context +open Alpha_context let init_amount = 20000 @@ -28,7 +28,7 @@ let execute_code_pred (Some op) op_header dummy_protop in let dummy_nonce = Contract.initial_origination_nonce apply_op.hash in let amount = Tez.zero in - let gaz = Gas.of_int (Tezos_context.Constants.max_gas tc) in + let gaz = Gas.of_int (Alpha_context.Constants.max_gas tc) in let return = Script_interpreter.execute dummy_nonce op.contract dst tc script amount argument gaz in diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_script.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_script.mli index e47040f19..1fde532d8 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_script.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_script.mli @@ -8,11 +8,11 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context val init_amount : int val execute_code_pred : - ?tc:Tezos_context.t -> Helpers_block.result -> Script.t -> Script.expr -> + ?tc:Alpha_context.t -> Helpers_block.result -> Script.t -> Script.expr -> (Script.expr * Script.expr * Gas.t * context * Contract.origination_nonce * Script_typed_ir.ex_big_map option) proto_tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_services.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_services.ml index 0e4ee013f..36b1a8226 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_services.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_services.ml @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Proto_alpha.Tezos_context +open Proto_alpha.Alpha_context open Helpers_assert let endorsement_rights ~tc () = diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_services.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_services.mli index 5948c5867..f99374e54 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_services.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_services.mli @@ -12,9 +12,9 @@ open Proto_alpha (** Wrappers around Services_registration calls *) val endorsement_rights : - tc:Tezos_context.context -> unit -> - (int * Tezos_context.public_key_hash) list tzresult Lwt.t + tc:Alpha_context.context -> unit -> + (int * Alpha_context.public_key_hash) list tzresult Lwt.t val baking_rights : - tc:Tezos_context.context -> unit -> - (int * Tezos_context.public_key_hash) list tzresult Lwt.t + tc:Alpha_context.context -> unit -> + (int * Alpha_context.public_key_hash) list tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml b/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml index 274f8805c..3ddf1ff32 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml @@ -24,14 +24,14 @@ module Script = Helpers_script module Shorthands = struct let to_tc_full ctxt level fitness = - Tezos_context.init + Alpha_context.init ctxt ~level ~fitness ~timestamp:(Time.now()) let get_tc_full (res:Block.result) = - Tezos_context.init + Alpha_context.init res.validation.context ~level:res.level ~timestamp:res.tezos_header.shell.timestamp @@ -40,7 +40,7 @@ module Shorthands = struct let get_balance_res (account:Account.t) (result:Block.result) = let open Alpha_environment.Error_monad in get_tc_full result >>=? fun tc -> - Tezos_context.Contract.get_balance tc account.contract + Alpha_context.Contract.get_balance tc account.contract let chain_empty_block (result:Block.result) = Block.empty diff --git a/src/proto_alpha/lib_protocol/test/test_big_maps.ml b/src/proto_alpha/lib_protocol/test/test_big_maps.ml index f13069b6a..ddc0b98c9 100644 --- a/src/proto_alpha/lib_protocol/test/test_big_maps.ml +++ b/src/proto_alpha/lib_protocol/test/test_big_maps.ml @@ -19,14 +19,14 @@ module Assert = Helpers.Assert let (>>??) = Helpers.Assert.(>>??) let (>>=??) = Helpers.Assert.(>>=??) -let parse_expr s : Proto_alpha.Tezos_context.Script.expr tzresult = +let parse_expr s : Proto_alpha.Alpha_context.Script.expr tzresult = Micheline_parser.no_parsing_error (Michelson_v1_parser.parse_expression s) >>? fun parsed -> ok parsed.expanded -let parse_script code_str storage_str : Proto_alpha.Tezos_context.Script.t tzresult = +let parse_script code_str storage_str : Proto_alpha.Alpha_context.Script.t tzresult = parse_expr code_str >>? fun code -> parse_expr storage_str >>? fun storage -> - ok { Proto_alpha.Tezos_context.Script.code ; storage } + ok { Proto_alpha.Alpha_context.Script.code ; storage } let code = {| { parameter (list (pair string int)) ; @@ -47,7 +47,7 @@ let expect_big_map tc contract print_key key_type print_data data_type contents iter_p (fun (n, exp) -> let key = Proto_alpha.Script_ir_translator.hash_data key_type n in - Proto_alpha.Tezos_context.Contract.Big_map_storage.get_opt tc contract key >>=? fun data -> + Proto_alpha.Alpha_context.Contract.Big_map_storage.get_opt tc contract key >>=? fun data -> match data, exp with | None, None -> debug " - big_map[%a] is not defined (ok)" print_key n ; @@ -86,9 +86,9 @@ let main () = expect_big_map tc contract (fun ppf k -> Format.fprintf ppf "%s" k) Proto_alpha.Script_typed_ir.String_t - (fun ppf n -> Format.fprintf ppf "%s" (Proto_alpha.Tezos_context.Script_int.to_string n)) + (fun ppf n -> Format.fprintf ppf "%s" (Proto_alpha.Alpha_context.Script_int.to_string n)) Proto_alpha.Script_typed_ir.Int_t - (List.map (fun (n, v) -> (n, Option.map ~f:Proto_alpha.Tezos_context.Script_int.of_int v)) exp) in + (List.map (fun (n, v) -> (n, Option.map ~f:Proto_alpha.Alpha_context.Script_int.of_int v)) exp) in expect_big_map tc [ "A", Some 1 ; "B", Some 2 ; "C", None ; "D", None ] >>=?? fun () -> debug "initial big map is ok" ; diff --git a/src/proto_alpha/lib_protocol/test/test_endorsement.ml b/src/proto_alpha/lib_protocol/test/test_endorsement.ml index 0afb4c161..8c1a9c994 100644 --- a/src/proto_alpha/lib_protocol/test/test_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/test_endorsement.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context open Error_monad let name = "Isolate Endorsement" @@ -46,7 +46,7 @@ let test_wrong_delegate endorse_a starting_block = let test_endorsement_payment () = Init.main () >>=? fun root -> let bootstrap_accounts = Account.bootstrap_accounts in - let open Proto_alpha.Tezos_context in + let open Proto_alpha.Alpha_context in get_tc_full root >>=? fun tc -> let level = Level.succ tc @@ Level.current tc in Proto_alpha.Services_registration.endorsement_rights tc level None >>=? fun (_, endorsers) -> diff --git a/src/proto_alpha/lib_protocol/test/test_michelson.ml b/src/proto_alpha/lib_protocol/test/test_michelson.ml index a6fb728e3..7d0fc1376 100644 --- a/src/proto_alpha/lib_protocol/test/test_michelson.ml +++ b/src/proto_alpha/lib_protocol/test/test_michelson.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Proto_alpha -open Tezos_context +open Alpha_context let name = "Isolate Michelson" module Logger = Logging.Make(struct let name = name end) @@ -25,15 +25,15 @@ open Shorthands let (>>??) = Assert.(>>??) let (>>=??) = Assert.(>>=??) -let parse_param s : Proto_alpha.Tezos_context.Script.expr = +let parse_param s : Proto_alpha.Alpha_context.Script.expr = let (parsed, _) = Michelson_v1_parser.parse_expression s in parsed.expanded -let parse_script code_str storage_str : Proto_alpha.Tezos_context.Script.t = +let parse_script code_str storage_str : Proto_alpha.Alpha_context.Script.t = let code = parse_param code_str in let storage = parse_param storage_str in - let return: Proto_alpha.Tezos_context.Script.t = {code ; storage} in + let return: Proto_alpha.Alpha_context.Script.t = {code ; storage} in return @@ -291,7 +291,7 @@ let test_example () = let bootstrap_0 = List.nth Account.bootstrap_accounts 0 in get_balance_res bootstrap_0 sb >>=?? fun _balance -> - let amount = Proto_alpha.Tezos_context.Tez.to_string @@ Cast.cents_of_int Script.init_amount in + let amount = Proto_alpha.Alpha_context.Tez.to_string @@ Cast.cents_of_int Script.init_amount in (* Get the current balance of the contract *) test_output ~location: __LOC__ "balance" "Unit" "Unit" ("\"" ^ amount ^ "\"") >>=? fun _ -> @@ -435,7 +435,7 @@ let test_example () = test_contract ~tc "create_contract" account_str account_str >>=? fun (cs, tc) -> Assert.equal_int 1 @@ List.length cs ; let contract = List.hd cs in - Proto_alpha.Tezos_context.Contract.get_script tc contract >>=?? fun res -> + Proto_alpha.Alpha_context.Contract.get_script tc contract >>=?? fun res -> let script = Option.unopt_exn (Failure "get_script") res in Script.execute_code_pred ~tc sb script (parse_param "\"abc\"") >>=?? fun (_, ret, _, _, _, _) -> Assert.equal_string ~msg: __LOC__ "\"abc\"" @@ string_of_canon ret ; diff --git a/src/proto_alpha/lib_protocol/test/test_transaction.ml b/src/proto_alpha/lib_protocol/test/test_transaction.ml index 8fcaf2aed..abc272dea 100644 --- a/src/proto_alpha/lib_protocol/test/test_transaction.ml +++ b/src/proto_alpha/lib_protocol/test/test_transaction.ml @@ -65,7 +65,7 @@ let test_basic (): unit tzresult Lwt.t = (* Check sender/receiver balance post transaction *) transfer (account_a, account_b, 1000) >>= Assert.ok_contract ~msg: __LOC__ >>=? fun (_,tc) -> - Proto_alpha.Tezos_context.Contract.get_balance tc account_a.contract >>=? fun _balance -> + Proto_alpha.Alpha_context.Contract.get_balance tc account_a.contract >>=? fun _balance -> Assert.equal_cents_balance ~msg: __LOC__ ~tc (account_a.contract, init_amount * 100 - 1000 - 10) >>=? fun () -> Assert.equal_cents_balance ~msg: __LOC__ ~tc (account_b.contract, 1001000) >>=? fun () -> debug "Transfer balances" ;