From dd9d132968a67d45989df73a44d1b582e87d18a5 Mon Sep 17 00:00:00 2001 From: ccamel Date: Tue, 11 Apr 2023 19:32:21 +0200 Subject: [PATCH] refactor(logic): rename fs to virtual_fs --- app/app.go | 3 ++- x/logic/fs/{fs.go => virtual_fs.go} | 6 +----- x/logic/keeper/keeper.go | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) rename x/logic/fs/{fs.go => virtual_fs.go} (95%) diff --git a/app/app.go b/app/app.go index 48476f47..6cd75d92 100644 --- a/app/app.go +++ b/app/app.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "io/fs" "net/http" "os" "path/filepath" @@ -1061,7 +1062,7 @@ func (app *App) SimulationManager() *module.SimulationManager { // provideFS is used to provide the virtual file system used for the logic module // to load external file. -func (app *App) provideFS(ctx context.Context) logicfs.FS { +func (app *App) provideFS(ctx context.Context) fs.FS { wasmHandler := logicfs.NewWasmHandler(app.WasmKeeper) return logicfs.NewVirtualFS(ctx, []logicfs.URIHandler{wasmHandler}) } diff --git a/x/logic/fs/fs.go b/x/logic/fs/virtual_fs.go similarity index 95% rename from x/logic/fs/fs.go rename to x/logic/fs/virtual_fs.go index b7c50004..9529e6ab 100644 --- a/x/logic/fs/fs.go +++ b/x/logic/fs/virtual_fs.go @@ -5,10 +5,6 @@ import ( "io/fs" ) -type FS interface { - fs.FS -} - // VirtualFS is the custom virtual file system used into the blockchain. // It will hold a list of handler that can resolve file URI and return the corresponding binary file. type VirtualFS struct { @@ -16,7 +12,7 @@ type VirtualFS struct { router Router } -var _ FS = (*VirtualFS)(nil) +var _ fs.FS = (*VirtualFS)(nil) // NewVirtualFS return a new VirtualFS object that will handle all virtual file on the interpreter. // File can be provided from different sources like CosmWasm cw-storage smart contract. diff --git a/x/logic/keeper/keeper.go b/x/logic/keeper/keeper.go index 433af3e3..d8204651 100644 --- a/x/logic/keeper/keeper.go +++ b/x/logic/keeper/keeper.go @@ -3,12 +3,12 @@ package keeper import ( goctx "context" "fmt" + "io/fs" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/okp4/okp4d/x/logic/fs" "github.com/okp4/okp4d/x/logic/types" )