예제 #1
0
        public async Task TestStructMemory()
        {
            // Update our values 7 times.
            for (int i = 0; i < 7; i++)
            {
                await _contract.updateStateValues();
            }

            // Throw an exception in a function call (so we can simply check locals on latest execution point, since we have no front end/UI to choose an execution point at the time of writing this).
            await _contract.throwStruct().ExpectRevertTransaction();

            // TODO: Verify variables.
            Assert.Inconclusive();
        }
예제 #2
0
        public async Task TestStructMemory()
        {
            // Update our values 7 times.
            for (int i = 0; i < 7; i++)
            {
                await _contract.updateStateValues();
            }

            // Throw an exception in a function call (so we can simply check locals on latest execution point, since we have no front end/UI to choose an execution point at the time of writing this).
            await _contract.throwStruct().ExpectRevertTransaction();

            // Obtain an execution trace and parse locals from the last point in it (where the exception occurred).
            var executionTrace = await RpcClient.GetExecutionTrace();

            ExecutionTraceAnalysis traceAnalysis = new ExecutionTraceAnalysis(executionTrace);

            // Obtain our local/state variables.
            var localVariables = traceAnalysis.GetLocalVariables();
            var stateVariables = traceAnalysis.GetStateVariables();

            // TODO: Verify variables.
            Assert.Inconclusive();
        }