cli/sc: don't rewrite RPC bindings by default

TestAssistedRPCBindings didn't respect rewriteExpectedOutputs setting, with
this behavior compiler could produce any result and the test wouldn't notice.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
Roman Khimov 2023-11-21 17:41:34 +03:00
parent ff958706f4
commit 7f9e2e5047

View file

@ -395,6 +395,7 @@ func TestAssistedRPCBindings(t *testing.T) {
} }
testName += fmt.Sprintf(", predefined hash: %t", hasDefinedHash) testName += fmt.Sprintf(", predefined hash: %t", hasDefinedHash)
t.Run(testName, func(t *testing.T) { t.Run(testName, func(t *testing.T) {
outFile := filepath.Join(tmpDir, "out.go")
configFile := filepath.Join(source, "config.yml") configFile := filepath.Join(source, "config.yml")
expectedFile := filepath.Join(source, "rpcbindings.out") expectedFile := filepath.Join(source, "rpcbindings.out")
if len(suffix) != 0 { if len(suffix) != 0 {
@ -421,14 +422,14 @@ func TestAssistedRPCBindings(t *testing.T) {
cmds := []string{"", "contract", "generate-rpcwrapper", cmds := []string{"", "contract", "generate-rpcwrapper",
"--config", bindingF, "--config", bindingF,
"--manifest", manifestF, "--manifest", manifestF,
"--out", expectedFile, "--out", outFile,
} }
if hasDefinedHash { if hasDefinedHash {
cmds = append(cmds, "--hash", "0x00112233445566778899aabbccddeeff00112233") cmds = append(cmds, "--hash", "0x00112233445566778899aabbccddeeff00112233")
} }
require.NoError(t, app.Run(cmds)) require.NoError(t, app.Run(cmds))
data, err := os.ReadFile(expectedFile) data, err := os.ReadFile(outFile)
require.NoError(t, err) require.NoError(t, err)
data = bytes.ReplaceAll(data, []byte("\r"), []byte{}) // Windows. data = bytes.ReplaceAll(data, []byte("\r"), []byte{}) // Windows.
if rewriteExpectedOutputs { if rewriteExpectedOutputs {