Merge pull request #3359 from austinabell/runner/returnval
Add in return value check in test-vector runner
This commit is contained in:
commit
22bdc43023
@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@ -195,6 +196,9 @@ func executeMessageVector(t *testing.T, vector *schema.TestVector) {
|
|||||||
if expected, actual := receipt.GasUsed, ret.GasUsed; expected != actual {
|
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)
|
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
|
// Once all messages are applied, assert that the final state root matches
|
||||||
|
Loading…
Reference in New Issue
Block a user