diff --git a/go.mod b/go.mod index 69f65c63..d7153c12 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( dario.cat/mergo v1.0.1 github.com/CosmWasm/wasmd v0.53.0 github.com/Masterminds/sprig/v3 v3.3.0 - github.com/axone-protocol/prolog v1.0.1-0.20241123121322-d4ffd777d1cd + github.com/axone-protocol/prolog/v2 v2.0.1 github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 @@ -34,7 +34,6 @@ require ( github.com/cucumber/godog v0.15.0 github.com/cucumber/messages/go/v21 v21.0.1 github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 - github.com/goccy/go-yaml v1.9.7 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-metrics v0.5.3 @@ -305,7 +304,6 @@ require ( golang.org/x/text v0.20.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.22.0 // indirect - golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/api v0.171.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect diff --git a/go.sum b/go.sum index 1621787b..0ac7206c 100644 --- a/go.sum +++ b/go.sum @@ -289,10 +289,8 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/axone-protocol/prolog v1.0.1-0.20241120160414-7be6699dffe3 h1:iFAq3IER5fwxg9//SIer2yvONGmaS5OWhoTZM5yjJbQ= -github.com/axone-protocol/prolog v1.0.1-0.20241120160414-7be6699dffe3/go.mod h1:ZLTfrR1+oVoiSkfkI/QttzYoWWNBYVwt/TBv+MJ8mqA= -github.com/axone-protocol/prolog v1.0.1-0.20241123121322-d4ffd777d1cd h1:C41uQli3nMy+74Gy7aptG9HOhiiNIrmY5/9EJMy0Qa0= -github.com/axone-protocol/prolog v1.0.1-0.20241123121322-d4ffd777d1cd/go.mod h1:ZLTfrR1+oVoiSkfkI/QttzYoWWNBYVwt/TBv+MJ8mqA= +github.com/axone-protocol/prolog/v2 v2.0.1 h1:0GKnhtnKti8jYxDh1h4qdpdocXAwLz/Y6HlnSYgN+44= +github.com/axone-protocol/prolog/v2 v2.0.1/go.mod h1:UH8qX2oWdoFuMnprJumA6Cgspi4pvmj60JhPzpNmSas= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -578,15 +576,11 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -602,8 +596,6 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/goccy/go-yaml v1.9.7 h1:D/Vx+JITklB1ugSkncB4BNR67M3X6AKs9+rqVeo3ddw= -github.com/goccy/go-yaml v1.9.7/go.mod h1:JubOolP3gh0HpiBc4BLRD4YmjEjHAmIIB2aaXKkTfoE= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -918,7 +910,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k= @@ -1604,7 +1595,6 @@ golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/x/logic/interpreter/interpreter.go b/x/logic/interpreter/interpreter.go index d95437ae..0c0f1864 100644 --- a/x/logic/interpreter/interpreter.go +++ b/x/logic/interpreter/interpreter.go @@ -6,8 +6,8 @@ import ( "io" "io/fs" - "github.com/axone-protocol/prolog" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2" + "github.com/axone-protocol/prolog/v2/engine" ) // Option is a function that configures an Interpreter. diff --git a/x/logic/interpreter/registry.go b/x/logic/interpreter/registry.go index 105e7dda..bd2ad518 100644 --- a/x/logic/interpreter/registry.go +++ b/x/logic/interpreter/registry.go @@ -5,8 +5,8 @@ import ( "strconv" "strings" - "github.com/axone-protocol/prolog" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2" + "github.com/axone-protocol/prolog/v2/engine" orderedmap "github.com/wk8/go-ordered-map/v2" "github.com/axone-protocol/axoned/v10/x/logic/predicate" diff --git a/x/logic/keeper/interpreter.go b/x/logic/keeper/interpreter.go index 6894de5b..454ea98d 100644 --- a/x/logic/keeper/interpreter.go +++ b/x/logic/keeper/interpreter.go @@ -6,8 +6,8 @@ import ( "io" "strings" - "github.com/axone-protocol/prolog" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2" + "github.com/axone-protocol/prolog/v2/engine" "github.com/samber/lo" orderedmap "github.com/wk8/go-ordered-map/v2" diff --git a/x/logic/keeper/metrics.go b/x/logic/keeper/metrics.go index 41e30b30..fcd415fe 100644 --- a/x/logic/keeper/metrics.go +++ b/x/logic/keeper/metrics.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/hashicorp/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" diff --git a/x/logic/keeper/metrics_test.go b/x/logic/keeper/metrics_test.go index e15eb398..f32abf1c 100644 --- a/x/logic/keeper/metrics_test.go +++ b/x/logic/keeper/metrics_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/predicate/address.go b/x/logic/predicate/address.go index 13341b21..6e817f5f 100644 --- a/x/logic/predicate/address.go +++ b/x/logic/predicate/address.go @@ -1,7 +1,7 @@ package predicate import ( - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" bech322 "github.com/cosmos/cosmos-sdk/types/bech32" diff --git a/x/logic/predicate/atom.go b/x/logic/predicate/atom.go index 5dd4cb77..275f5f0d 100644 --- a/x/logic/predicate/atom.go +++ b/x/logic/predicate/atom.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/prolog" ) diff --git a/x/logic/predicate/atom_test.go b/x/logic/predicate/atom_test.go index e39875fd..84dc1ef8 100644 --- a/x/logic/predicate/atom_test.go +++ b/x/logic/predicate/atom_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/bank.go b/x/logic/predicate/bank.go index 0cb4f1dc..ca596e94 100644 --- a/x/logic/predicate/bank.go +++ b/x/logic/predicate/bank.go @@ -3,7 +3,7 @@ package predicate import ( "context" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/samber/lo" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/logic/predicate/bank_test.go b/x/logic/predicate/bank_test.go index e80e58a1..3ad6ba30 100644 --- a/x/logic/predicate/bank_test.go +++ b/x/logic/predicate/bank_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" "github.com/samber/lo" "go.uber.org/mock/gomock" diff --git a/x/logic/predicate/block.go b/x/logic/predicate/block.go index 88162b01..27ebdcad 100644 --- a/x/logic/predicate/block.go +++ b/x/logic/predicate/block.go @@ -3,7 +3,7 @@ package predicate import ( "context" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/prolog" ) diff --git a/x/logic/predicate/builtin_test.go b/x/logic/predicate/builtin_test.go index adef21cf..c6d616cd 100644 --- a/x/logic/predicate/builtin_test.go +++ b/x/logic/predicate/builtin_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" "go.uber.org/mock/gomock" diff --git a/x/logic/predicate/chain.go b/x/logic/predicate/chain.go index dc3dce49..03d00e22 100644 --- a/x/logic/predicate/chain.go +++ b/x/logic/predicate/chain.go @@ -3,7 +3,7 @@ package predicate import ( "context" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/proto/tendermint/version" diff --git a/x/logic/predicate/chain_test.go b/x/logic/predicate/chain_test.go index f7145fb0..baabf617 100644 --- a/x/logic/predicate/chain_test.go +++ b/x/logic/predicate/chain_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/crypto.go b/x/logic/predicate/crypto.go index 84c7204e..11547516 100644 --- a/x/logic/predicate/crypto.go +++ b/x/logic/predicate/crypto.go @@ -3,7 +3,7 @@ package predicate import ( "slices" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/prolog" "github.com/axone-protocol/axoned/v10/x/logic/util" diff --git a/x/logic/predicate/crypto_test.go b/x/logic/predicate/crypto_test.go index 3ddeb3c7..f43705dd 100644 --- a/x/logic/predicate/crypto_test.go +++ b/x/logic/predicate/crypto_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/database.go b/x/logic/predicate/database.go index 8893af9d..957c90be 100644 --- a/x/logic/predicate/database.go +++ b/x/logic/predicate/database.go @@ -1,6 +1,6 @@ package predicate -import "github.com/axone-protocol/prolog/engine" +import "github.com/axone-protocol/prolog/v2/engine" // Asserta is a predicate that asserts a clause into the database as the first clause of the predicate. // diff --git a/x/logic/predicate/did.go b/x/logic/predicate/did.go index 3bc7381f..8a3ac431 100644 --- a/x/logic/predicate/did.go +++ b/x/logic/predicate/did.go @@ -3,7 +3,7 @@ package predicate import ( "strings" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" godid "github.com/nuts-foundation/go-did/did" "github.com/samber/lo" diff --git a/x/logic/predicate/did_test.go b/x/logic/predicate/did_test.go index 516201f6..1160368a 100644 --- a/x/logic/predicate/did_test.go +++ b/x/logic/predicate/did_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/encoding.go b/x/logic/predicate/encoding.go index 713cbd78..09ba5bcd 100644 --- a/x/logic/predicate/encoding.go +++ b/x/logic/predicate/encoding.go @@ -3,7 +3,7 @@ package predicate import ( "encoding/hex" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/prolog" ) diff --git a/x/logic/predicate/encoding_test.go b/x/logic/predicate/encoding_test.go index 18f7f888..31faff09 100644 --- a/x/logic/predicate/encoding_test.go +++ b/x/logic/predicate/encoding_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/file.go b/x/logic/predicate/file.go index 49058880..e2ebbea9 100644 --- a/x/logic/predicate/file.go +++ b/x/logic/predicate/file.go @@ -6,7 +6,7 @@ import ( "reflect" "sort" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/prolog" ) diff --git a/x/logic/predicate/io.go b/x/logic/predicate/io.go index 905f380d..32b309db 100644 --- a/x/logic/predicate/io.go +++ b/x/logic/predicate/io.go @@ -1,6 +1,6 @@ package predicate -import "github.com/axone-protocol/prolog/engine" +import "github.com/axone-protocol/prolog/v2/engine" // CurrentOutput is a predicate that unifies the given term with the current output stream. // diff --git a/x/logic/predicate/json.go b/x/logic/predicate/json.go index b9dad74b..b89f27e0 100644 --- a/x/logic/predicate/json.go +++ b/x/logic/predicate/json.go @@ -10,7 +10,7 @@ import ( "strings" "unicode/utf8" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/samber/lo" "github.com/axone-protocol/axoned/v10/x/logic/prolog" diff --git a/x/logic/predicate/json_test.go b/x/logic/predicate/json_test.go index 4d79d329..be35544c 100644 --- a/x/logic/predicate/json_test.go +++ b/x/logic/predicate/json_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/string.go b/x/logic/predicate/string.go index e8089854..2ce4cdf5 100644 --- a/x/logic/predicate/string.go +++ b/x/logic/predicate/string.go @@ -5,7 +5,7 @@ import ( "io" "strings" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/prolog" ) diff --git a/x/logic/predicate/string_test.go b/x/logic/predicate/string_test.go index a5dd2558..8f36c1c8 100644 --- a/x/logic/predicate/string_test.go +++ b/x/logic/predicate/string_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/term.go b/x/logic/predicate/term.go index 1cfdb807..743f985a 100644 --- a/x/logic/predicate/term.go +++ b/x/logic/predicate/term.go @@ -1,6 +1,6 @@ package predicate -import "github.com/axone-protocol/prolog/engine" +import "github.com/axone-protocol/prolog/v2/engine" // WriteTerm3 is a predicate that writes a term to a stream or alias. // diff --git a/x/logic/predicate/uri.go b/x/logic/predicate/uri.go index 9531ac4c..7bfa0648 100644 --- a/x/logic/predicate/uri.go +++ b/x/logic/predicate/uri.go @@ -1,7 +1,7 @@ package predicate import ( - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/prolog" ) diff --git a/x/logic/predicate/uri_test.go b/x/logic/predicate/uri_test.go index df80e9a9..2aa2771b 100644 --- a/x/logic/predicate/uri_test.go +++ b/x/logic/predicate/uri_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" dbm "github.com/cosmos/cosmos-db" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/predicate/util.go b/x/logic/predicate/util.go index a93d9064..9152a12c 100644 --- a/x/logic/predicate/util.go +++ b/x/logic/predicate/util.go @@ -4,7 +4,7 @@ import ( "context" "sort" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/samber/lo" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/logic/prolog/assert.go b/x/logic/prolog/assert.go index 35f8e9cb..3df13df4 100644 --- a/x/logic/prolog/assert.go +++ b/x/logic/prolog/assert.go @@ -4,7 +4,7 @@ import ( "strings" "unicode/utf8" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/samber/lo" "github.com/axone-protocol/axoned/v10/x/logic/util" diff --git a/x/logic/prolog/assert_test.go b/x/logic/prolog/assert_test.go index 9947667d..c58c21e7 100644 --- a/x/logic/prolog/assert_test.go +++ b/x/logic/prolog/assert_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/samber/lo" . "github.com/smartystreets/goconvey/convey" diff --git a/x/logic/prolog/atom.go b/x/logic/prolog/atom.go index 7e71085e..220e2085 100644 --- a/x/logic/prolog/atom.go +++ b/x/logic/prolog/atom.go @@ -1,6 +1,6 @@ package prolog -import "github.com/axone-protocol/prolog/engine" +import "github.com/axone-protocol/prolog/v2/engine" var ( // AtomAs is the term used to indicate the as encoding type option. diff --git a/x/logic/prolog/byte.go b/x/logic/prolog/byte.go index 499472ea..8f676d89 100644 --- a/x/logic/prolog/byte.go +++ b/x/logic/prolog/byte.go @@ -1,7 +1,7 @@ package prolog import ( - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" ) // ByteListTermToBytes try to convert a given list of bytes into native golang []byte. diff --git a/x/logic/prolog/byte_test.go b/x/logic/prolog/byte_test.go index 3d0bf9bc..d1e94f3d 100644 --- a/x/logic/prolog/byte_test.go +++ b/x/logic/prolog/byte_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/prolog/context.go b/x/logic/prolog/context.go index 9a32b8f1..98a6a45f 100644 --- a/x/logic/prolog/context.go +++ b/x/logic/prolog/context.go @@ -3,7 +3,7 @@ package prolog import ( "context" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/logic/prolog/encode.go b/x/logic/prolog/encode.go index c50e73ea..bc170cd9 100644 --- a/x/logic/prolog/encode.go +++ b/x/logic/prolog/encode.go @@ -3,7 +3,7 @@ package prolog import ( "errors" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/util" ) diff --git a/x/logic/prolog/error.go b/x/logic/prolog/error.go index d36e8ae1..237dd7fa 100644 --- a/x/logic/prolog/error.go +++ b/x/logic/prolog/error.go @@ -1,7 +1,7 @@ package prolog import ( - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" ) var ( diff --git a/x/logic/prolog/hex.go b/x/logic/prolog/hex.go index 2e2d9933..7d330cc9 100644 --- a/x/logic/prolog/hex.go +++ b/x/logic/prolog/hex.go @@ -3,7 +3,7 @@ package prolog import ( "encoding/hex" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" ) // TermHexToBytes try to convert an hexadecimal encoded atom to native golang []byte. diff --git a/x/logic/prolog/hex_test.go b/x/logic/prolog/hex_test.go index efb8b453..04e8af46 100644 --- a/x/logic/prolog/hex_test.go +++ b/x/logic/prolog/hex_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/prolog/json.go b/x/logic/prolog/json.go index 9fbdf708..f74a1bdb 100644 --- a/x/logic/prolog/json.go +++ b/x/logic/prolog/json.go @@ -1,7 +1,7 @@ package prolog import ( - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" ) var ( diff --git a/x/logic/prolog/json_test.go b/x/logic/prolog/json_test.go index d3b27776..2ca4935a 100644 --- a/x/logic/prolog/json_test.go +++ b/x/logic/prolog/json_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/prolog/list.go b/x/logic/prolog/list.go index 309138bd..c0987e1e 100644 --- a/x/logic/prolog/list.go +++ b/x/logic/prolog/list.go @@ -1,7 +1,7 @@ package prolog import ( - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" ) // ListHead returns the first element of the given list. diff --git a/x/logic/prolog/list_test.go b/x/logic/prolog/list_test.go index a1302362..0baaba67 100644 --- a/x/logic/prolog/list_test.go +++ b/x/logic/prolog/list_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/prolog/option.go b/x/logic/prolog/option.go index 2bf36f9b..6ca79ad4 100644 --- a/x/logic/prolog/option.go +++ b/x/logic/prolog/option.go @@ -1,7 +1,7 @@ package prolog import ( - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" ) // GetOption returns the value of the first option with the given name in the given options. diff --git a/x/logic/prolog/option_test.go b/x/logic/prolog/option_test.go index 3f65c179..1781b0f4 100644 --- a/x/logic/prolog/option_test.go +++ b/x/logic/prolog/option_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/prolog/text.go b/x/logic/prolog/text.go index c6d571e6..45d84c90 100644 --- a/x/logic/prolog/text.go +++ b/x/logic/prolog/text.go @@ -4,7 +4,7 @@ import ( "strings" "unicode/utf8" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2/engine" ) // AtomToString try to convert a given atom to a string. diff --git a/x/logic/prolog/tuple.go b/x/logic/prolog/tuple.go index f27f3c03..a1db5ce5 100644 --- a/x/logic/prolog/tuple.go +++ b/x/logic/prolog/tuple.go @@ -1,6 +1,6 @@ package prolog -import "github.com/axone-protocol/prolog/engine" +import "github.com/axone-protocol/prolog/v2/engine" // Tuple is a predicate which unifies the given term with a tuple of the given arity. func Tuple(args ...engine.Term) engine.Term { diff --git a/x/logic/prolog/unify.go b/x/logic/prolog/unify.go index fd7882d3..4f6446a0 100644 --- a/x/logic/prolog/unify.go +++ b/x/logic/prolog/unify.go @@ -1,6 +1,6 @@ package prolog -import "github.com/axone-protocol/prolog/engine" +import "github.com/axone-protocol/prolog/v2/engine" // ConvertFunc is a function mapping a domain which is a list of terms with a codomain which is a set of terms. // Domains and co-domains can have different cardinalities. diff --git a/x/logic/testutil/logic.go b/x/logic/testutil/logic.go index fffb5502..d79b67c3 100644 --- a/x/logic/testutil/logic.go +++ b/x/logic/testutil/logic.go @@ -5,8 +5,8 @@ import ( "fmt" "regexp" - "github.com/axone-protocol/prolog" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2" + "github.com/axone-protocol/prolog/v2/engine" "github.com/axone-protocol/axoned/v10/x/logic/interpreter/bootstrap" ) diff --git a/x/logic/util/prolog.go b/x/logic/util/prolog.go index 90f20900..2cb88be3 100644 --- a/x/logic/util/prolog.go +++ b/x/logic/util/prolog.go @@ -3,10 +3,11 @@ package util import ( "context" "errors" + "fmt" "strings" - "github.com/axone-protocol/prolog" - "github.com/axone-protocol/prolog/engine" + "github.com/axone-protocol/prolog/v2" + "github.com/axone-protocol/prolog/v2/engine" "github.com/samber/lo" errorsmod "cosmossdk.io/errors" @@ -20,6 +21,11 @@ const ( defaultEnvCap = uint64(50) ) +var ( + errMessageVar = engine.NewVariable() + errPanicError = engine.Atom("error").Apply(engine.AtomPanicError.Apply(errMessageVar)) +) + // QueryInterpreter interprets a query and returns the solutions up to the given limit. // //nolint:nestif,funlen @@ -56,12 +62,14 @@ func QueryInterpreter( return nil, callErr } - var panicErr engine.PanicError - if errors.As(callErr, &panicErr) && errors.Is(panicErr.OriginErr, engine.ErrMaxVariables) { - return nil, errorsmod.Wrapf(types.LimitExceeded, panicErr.OriginErr.Error()) //nolint:govet + var err engine.Exception + if errors.As(callErr, &err) { + if err, ok := isPanicError(err.Term(), env); ok { + return nil, errorsmod.Wrapf(types.LimitExceeded, "%s", err) + } } - if err = func() error { + if err := func() error { defer func() { _ = recover() }() @@ -137,3 +145,12 @@ func isBound(v engine.ParsedVariable, env *engine.Env) bool { return !ok } + +// isPanicError returns the panic error message if the given term is a panic_error. +func isPanicError(term engine.Term, env *engine.Env) (string, bool) { + if env, ok := env.Unify(term, errPanicError); ok { + return fmt.Sprintf("%s", env.Resolve(errMessageVar)), true + } + + return "", false +}