diff --git a/internal/controller/system/module.go b/internal/controller/system/module.go index 126720dcb..1bc3e76d8 100644 --- a/internal/controller/system/module.go +++ b/internal/controller/system/module.go @@ -40,7 +40,8 @@ func NewFXModule(configuration ModuleConfiguration) fx.Option { })) } - if configuration.NSCacheConfiguration.MaxCount != 0 { + // TEMP enable again + if false && configuration.NSCacheConfiguration.MaxCount != 0 { options = append(options, WithUpdateParser(func(oldParser ledgercontroller.NumscriptParser) ledgercontroller.NumscriptParser { if oldParser == nil { oldParser = ledgercontroller.NewDefaultNumscriptParser() diff --git a/test/e2e/api_bulk.go b/test/e2e/api_bulk.go index 756a52346..1f74f755d 100644 --- a/test/e2e/api_bulk.go +++ b/test/e2e/api_bulk.go @@ -163,8 +163,14 @@ var _ = Context("Ledger engine tests", func() { Expect(err).To(Succeed()) }) It("should respond with an error", func() { + var expectedErr string + if data.numscriptRewrite { + expectedErr = "INTERPRETER_RUNTIME" + } else { + expectedErr = "INSUFFICIENT_FUND" + } Expect(bulkResponse[1].Type).To(Equal(components.V2BulkElementResultType("ERROR"))) - Expect(bulkResponse[1].V2BulkElementResultError.ErrorCode).To(Equal("INTERPRETER_RUNTIME")) + Expect(bulkResponse[1].V2BulkElementResultError.ErrorCode).To(Equal(expectedErr)) }) }) }) diff --git a/test/e2e/api_transactions_create.go b/test/e2e/api_transactions_create.go index bae66b995..20f711cd0 100644 --- a/test/e2e/api_transactions_create.go +++ b/test/e2e/api_transactions_create.go @@ -24,6 +24,22 @@ import ( . "github.com/onsi/gomega" ) +func MigrateRuntimeErr(numscriptRewrite bool) string { + if numscriptRewrite { + return string(components.V2ErrorsEnumInterpreterRuntime) + } else { + return string(components.V2ErrorsEnumInsufficientFund) + } +} + +func MigrateErrCompilationFailed(numscriptRewrite bool) string { + if numscriptRewrite { + return string(components.V2ErrorsEnumInterpreterRuntime) + } else { + return string(components.V2ErrorsEnumCompilationFailed) + } +} + var _ = Context("Ledger accounts list API tests", func() { for _, data := range []struct { description string @@ -210,8 +226,15 @@ var _ = Context("Ledger accounts list API tests", func() { }} }) It("should fail", func() { + var expectedErr string + if data.numscriptRewrite { + expectedErr = string(components.V2ErrorsEnumInterpreterRuntime) + } else { + expectedErr = string(components.V2ErrorsEnumInsufficientFund) + } + Expect(err).To(HaveOccurred()) - Expect(err).To(HaveErrorCode(string(components.V2ErrorsEnumInterpreterRuntime))) + Expect(err).To(HaveErrorCode(expectedErr)) }) }) When("with nil amount", func() { @@ -334,9 +357,17 @@ var _ = Context("Ledger accounts list API tests", func() { Ledger: "default", } }) - It("should fail with "+string(components.V2ErrorsEnumInterpreterRuntime)+" code", func() { + + var expectedErr string + if data.numscriptRewrite { + expectedErr = string(components.V2ErrorsEnumInterpreterRuntime) + } else { + expectedErr = string(components.V2ErrorsEnumCompilationFailed) + } + + It("should fail with "+expectedErr+" code", func() { Expect(err).NotTo(Succeed()) - Expect(err).To(HaveErrorCode(string(components.V2ErrorsEnumInterpreterRuntime))) + Expect(err).To(HaveErrorCode(expectedErr)) }) }) When("using a negative amount in the script with a variable", func() { @@ -361,9 +392,16 @@ var _ = Context("Ledger accounts list API tests", func() { Ledger: "default", } }) - It("should fail with "+string(components.V2ErrorsEnumInterpreterRuntime)+" code", func() { + + var expectedErr string + if data.numscriptRewrite { + expectedErr = string(components.V2ErrorsEnumInterpreterRuntime) + } else { + expectedErr = string(components.V2ErrorsEnumCompilationFailed) + } + It("should fail with "+expectedErr+" code", func() { Expect(err).NotTo(Succeed()) - Expect(err).To(HaveErrorCode(string(components.V2ErrorsEnumInterpreterRuntime))) + Expect(err).To(HaveErrorCode(expectedErr)) }) }) Context("with error on script", func() { @@ -380,9 +418,15 @@ var _ = Context("Ledger accounts list API tests", func() { Ledger: "default", } }) - It("should fail with "+string(components.V2ErrorsEnumInterpreterParse)+" code", func() { + var expectedErr string + if data.numscriptRewrite { + expectedErr = string(components.V2ErrorsEnumInterpreterParse) + } else { + expectedErr = string(components.V2ErrorsEnumCompilationFailed) + } + It("should fail with "+expectedErr+" code", func() { Expect(err).NotTo(Succeed()) - Expect(err).To(HaveErrorCode(string(components.V2ErrorsEnumInterpreterParse))) + Expect(err).To(HaveErrorCode(expectedErr)) }) }) Context("with no postings", func() { @@ -498,5 +542,4 @@ var _ = Context("Ledger accounts list API tests", func() { }) }) } - })