Skip to content

Commit

Permalink
Merge pull request #772 from axone-protocol/refactor/prolog-hard-fork
Browse files Browse the repository at this point in the history
refactor(prolog): directly import our hard fork of the prolog engine
  • Loading branch information
amimart authored Oct 7, 2024
2 parents 274bf3b + 2f0d3b6 commit 4d8205b
Show file tree
Hide file tree
Showing 46 changed files with 53 additions and 58 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +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.20241007111431-c4c18d4393b9
github.com/cometbft/cometbft v0.38.12
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/cosmos-proto v1.0.0-beta.5
Expand All @@ -39,7 +40,6 @@ require (
github.com/hashicorp/go-metrics v0.5.3
github.com/huandu/xstrings v1.5.0
github.com/hyperledger/aries-framework-go v0.3.2
github.com/ichiban/prolog v1.2.0
github.com/ignite/cli v0.27.2
github.com/muesli/reflow v0.3.0
github.com/nuts-foundation/go-did v0.14.0
Expand Down Expand Up @@ -75,9 +75,6 @@ replace (
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0

// Use cutom fork of prolog interpreter
github.com/ichiban/prolog => github.com/axone-protocol/prolog v1.0.1-0.20240930131208-a7e37dcfde82

// replace broken goleveldb
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,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.20240924120526-53584b2b5c0b h1:s4U2NJBSdjZHRVOQuS2USITMFZO+Y3DuQBZagP527Q4=
github.com/axone-protocol/prolog v1.0.1-0.20240924120526-53584b2b5c0b/go.mod h1:lbZPekEi6qr5WX29GgEmhZlTxUkeWeiJ8cZZRq8qjAE=
github.com/axone-protocol/prolog v1.0.1-0.20240930131208-a7e37dcfde82 h1:Q9L+P3plaPoLLRUyLPYMk/HogUDoOVucInvsweOFYs0=
github.com/axone-protocol/prolog v1.0.1-0.20240930131208-a7e37dcfde82/go.mod h1:lbZPekEi6qr5WX29GgEmhZlTxUkeWeiJ8cZZRq8qjAE=
github.com/axone-protocol/prolog v1.0.1-0.20241007111431-c4c18d4393b9 h1:jn+ld5dI6Jfc0E9H3nELeU+CdieIzsbT+agfyyOZNuc=
github.com/axone-protocol/prolog v1.0.1-0.20241007111431-c4c18d4393b9/go.mod h1:6jc/PgoaC+m8Zsews7MQwxlcE1nLyu28peJb4qEcve8=
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=
Expand Down
4 changes: 2 additions & 2 deletions x/logic/interpreter/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"io/fs"

"github.com/ichiban/prolog"
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"

"cosmossdk.io/math"
)
Expand Down
4 changes: 2 additions & 2 deletions x/logic/interpreter/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"strings"

"github.com/ichiban/prolog"
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"
orderedmap "github.com/wk8/go-ordered-map/v2"

"github.com/axone-protocol/axoned/v10/x/logic/predicate"
Expand Down
4 changes: 2 additions & 2 deletions x/logic/keeper/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"strings"

"github.com/ichiban/prolog"
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"
"github.com/samber/lo"
orderedmap "github.com/wk8/go-ordered-map/v2"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/address.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package predicate

import (
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

bech322 "github.com/cosmos/cosmos-sdk/types/bech32"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package predicate
import (
"context"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
"github.com/samber/lo"

cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/golang/mock/gomock"
"github.com/ichiban/prolog/engine"
"github.com/samber/lo"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package predicate
import (
"context"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/prolog"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/builtin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/golang/mock/gomock"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package predicate
import (
"context"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/prolog"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package predicate
import (
"slices"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/prolog"
"github.com/axone-protocol/axoned/v10/x/logic/util"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/did.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package predicate
import (
"strings"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
godid "github.com/nuts-foundation/go-did/did"
"github.com/samber/lo"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/did_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package predicate
import (
"encoding/hex"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/prolog"
)
Expand Down
4 changes: 2 additions & 2 deletions x/logic/predicate/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"
"testing"

"github.com/axone-protocol/prolog"
"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/ichiban/prolog"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"sort"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/prolog"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/io.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package predicate

import "github.com/ichiban/prolog/engine"
import "github.com/axone-protocol/prolog/engine"

// CurrentOutput is a predicate that unifies the given term with the current output stream.
//
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"strings"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
"github.com/samber/lo"

"cosmossdk.io/math"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"strings"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/prolog"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/uri.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package predicate

import (
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/prolog"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/uri_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"testing"

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/ichiban/prolog/engine"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"sort"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
"github.com/samber/lo"

cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"unicode/utf8"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
"github.com/samber/lo"

"github.com/axone-protocol/axoned/v10/x/logic/util"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/assert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
"github.com/samber/lo"

. "github.com/smartystreets/goconvey/convey"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/atom.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package prolog

import "github.com/ichiban/prolog/engine"
import "github.com/axone-protocol/prolog/engine"

var (
// AtomAs is the term used to indicate the as encoding type option.
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/byte.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package prolog

import (
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
)

// ByteListTermToBytes try to convert a given list of bytes into native golang []byte.
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package prolog
import (
"context"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

sdk "github.com/cosmos/cosmos-sdk/types"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package prolog
import (
"errors"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

"github.com/axone-protocol/axoned/v10/x/logic/util"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/error.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package prolog

import (
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/hex.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package prolog
import (
"encoding/hex"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
)

// TermHexToBytes try to convert an hexadecimal encoded atom to native golang []byte.
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/hex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

. "github.com/smartystreets/goconvey/convey"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/json.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package prolog

import (
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
)

// JSONNull returns the compound term @(null).
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"

. "github.com/smartystreets/goconvey/convey"
)
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/list.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package prolog

import "github.com/ichiban/prolog/engine"
import "github.com/axone-protocol/prolog/engine"

// ListHead returns the first element of the given list.
func ListHead(list engine.Term, env *engine.Env) engine.Term {
Expand Down
2 changes: 1 addition & 1 deletion x/logic/prolog/option.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package prolog

import (
"github.com/ichiban/prolog/engine"
"github.com/axone-protocol/prolog/engine"
)

// GetOption returns the value of the first option with the given name in the given options.
Expand Down
Loading

0 comments on commit 4d8205b

Please sign in to comment.