Add in return value check in test-vector runner

This commit is contained in:
austinabell 2020-08-27 11:42:01 -04:00
parent efd2129187
commit 679a8e0c24
No known key found for this signature in database
GPG Key ID: C1CB22918F2A46DE

View File

@ -4,6 +4,7 @@ import (
"bytes"
"compress/gzip"
"context"
"encoding/base64"
"encoding/json"
"io/ioutil"
"os"
@ -195,6 +196,9 @@ func executeMessageVector(t *testing.T, vector *schema.TestVector) {
if expected, actual := receipt.GasUsed, ret.GasUsed; expected != actual {
t.Errorf("gas used of msg %d did not match; expected: %d, got: %d", i, expected, actual)
}
if expected, actual := []byte(receipt.ReturnValue), ret.Return; !bytes.Equal(expected, actual) {
t.Errorf("return value of msg %d did not match; expected: %s, got: %s", i, base64.StdEncoding.EncodeToString(expected), base64.StdEncoding.EncodeToString(actual))
}
}
// Once all messages are applied, assert that the final state root matches