예제 #1
0
        public async Task TestBytesMemory()
        {
            // Create a byte array
            byte[] param1 = { 0x77, 0x88, 0x99, 0x88, 0x77, 0x00, 0x00, 0x00 };

            // 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.throwBytes(param1).ExpectRevertTransaction();

            // TODO: Verify variables.
            Assert.Inconclusive();
        }
예제 #2
0
        public async Task TestBytesMemory()
        {
            // Create a byte array
            byte[] param1 = { 0x77, 0x88, 0x99, 0x88, 0x77, 0x00, 0x00, 0x00 };

            // 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.throwBytes(param1).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();
        }