From edc0746eac6c2912d4def3971cd3552f3ffaa6e0 Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Tue, 29 Aug 2017 20:08:11 +0200 Subject: Some updates on state tests, note on outdated structure --- docs/state_tests/index.rst | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/state_tests/index.rst b/docs/state_tests/index.rst index c648c30b5..978d2542a 100644 --- a/docs/state_tests/index.rst +++ b/docs/state_tests/index.rst @@ -1,16 +1,31 @@ .. _state_tests: ################################################################################ -State Tests +General State Tests ################################################################################ -Found in ``/StateTest``, the state tests aim is to test the basic workings of the state in isolation. +Found in `/GeneralStateTests `_, +the state tests aim is to test the basic workings of the state in isolation. -It is based around the notion of executing a single transaction, described by the ``transaction`` portion of the test. The overarching environment in which it is executed is described by the ``env`` portion of the test and includes attributes of the current and previous blocks. A set of pre-existing accounts are detailed in the ``pre`` portion and form the world state prior to execution. Similarly, a set of accounts are detailed in the ``post`` portion to specify the end world state. Since the data of the blockchain is not given, the opcode ``BLOCKHASH`` could not return the hashes of the corresponding blocks. Therefore we define the hash of block number ``n`` to be ``SHA256("n")``. +A state test is based around the notion of executing a single transaction, described +by the ``transaction`` portion of the test. The overarching environment +in which it is executed is described by the ``env`` portion of the test and +includes attributes of the current and previous blocks. A set of pre-existing accounts +are detailed in the ``pre`` portion and form the world state prior to execution. +Similarly, a set of accounts are detailed in the ``post`` portion to specify the +end world state. Since the data of the blockchain is not given, the opcode ``BLOCKHASH`` +could not return the hashes of the corresponding blocks. Therefore we define the hash of +block number ``n`` to be ``SHA256("n")``. The log entries (``logs``) as well as any output returned from the code (``output``) is also detailed. -It is generally expected that the test implementer will read ``env``, ``transaction`` and ``pre`` then check their results against ``logs``, ``out``, and ``post``. +It is generally expected that the test implementer will read ``env``, ``transaction`` +and ``pre`` then check their results against ``logs``, ``out``, and ``post``. + +.. note:: + The structure description of state tests is outdated. A more up-to-date description + can be found `here `_ and should be + integrated in these docs in the future. Basic structure -------------------------------------------------------------------------------- -- cgit v1.2.3