From 71f94b44a81ad661fbdaf675a9b042583f19b842 Mon Sep 17 00:00:00 2001 From: Benjamin DENEUX Date: Wed, 8 Mar 2023 15:53:40 +0100 Subject: [PATCH] fix(logic): remove unused files --- x/logic/interpreter/fs/fs.go | 2 +- x/logic/predicate/wasm.go | 36 ------------------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 x/logic/predicate/wasm.go diff --git a/x/logic/interpreter/fs/fs.go b/x/logic/interpreter/fs/fs.go index d8c9bb39..282155ed 100644 --- a/x/logic/interpreter/fs/fs.go +++ b/x/logic/interpreter/fs/fs.go @@ -79,7 +79,7 @@ func (o Object) Stat() (fs.FileInfo, error) { } func (o Object) Read(bytes []byte) (int, error) { - //TODO implement me + // TODO implement me panic("implement me") } diff --git a/x/logic/predicate/wasm.go b/x/logic/predicate/wasm.go deleted file mode 100644 index 10437fd2..00000000 --- a/x/logic/predicate/wasm.go +++ /dev/null @@ -1,36 +0,0 @@ -package predicate - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/types" - "github.com/okp4/okp4d/x/logic/util" -) - -func QueryWasm(vm *engine.VM, contractAddr engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { - return engine.Delay(func(ctx context.Context) *engine.Promise { - sdkContext, err := util.UnwrapSDKContext(ctx) - if err != nil { - return engine.Error(fmt.Errorf("query_wasm/1: %w", err)) - } - wasmKeeper := sdkContext.Value(types.WasmKeeperContextKey).(types.WasmKeeper) - addr, err := getBech32(env, contractAddr) - if err != nil { - return engine.Error(fmt.Errorf("query_wasm/1: %w", err)) - } - - req := []byte("{\"ask\":{\"query\": \"query_wasm('okp410gnd30r45k9658jm7hzxvp8ehz4ptf33tqjnaepwkunev6kax5ks3mnvmf').\"}}") - if !json.Valid(req) { - return engine.Error(fmt.Errorf("query_wasm/1: wasm query must be a valid json")) - } - res, err := wasmKeeper.QuerySmart(sdkContext, addr, req) - if err != nil { - return engine.Error(fmt.Errorf("query_wasm/1: %w", err)) - } - fmt.Printf("result %w", string(res)) - return engine.Unify(vm, contractAddr, engine.Integer(sdkContext.BlockHeight()), cont, env) - }) -}