From d1556f089f9d65cf2da055f2d22f6e24520b4ea6 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Wed, 6 Nov 2024 10:23:19 -0600 Subject: [PATCH] remove set paramset function from sharedlib (removed from sdk) --- .../libprovwasmtesttube/main.go | 69 ------------------- 1 file changed, 69 deletions(-) diff --git a/packages/provwasm-test-tube/libprovwasmtesttube/main.go b/packages/provwasm-test-tube/libprovwasmtesttube/main.go index 5e0e960..1bf5cc8 100644 --- a/packages/provwasm-test-tube/libprovwasmtesttube/main.go +++ b/packages/provwasm-test-tube/libprovwasmtesttube/main.go @@ -20,7 +20,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" // cosmos sdk - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -268,74 +267,6 @@ func Simulate(envId uint64, base64TxBytes string) *C.char { // => base64GasInfo return encodeBytesResultBytes(bz) } -//export SetParamSet -func SetParamSet(envId uint64, subspaceName, base64ParamSetBytes string) *C.char { - env := loadEnv(envId) - - // Temp fix for concurrency issue - mu.Lock() - defer mu.Unlock() - - paramSetBytes, err := base64.StdEncoding.DecodeString(base64ParamSetBytes) - if err != nil { - panic(err) - } - - subspace, ok := env.App.ParamsKeeper.GetSubspace(subspaceName) - if !ok { - err := errors.New("No subspace found for `" + subspaceName + "`") - return encodeErrToResultBytes(result.ExecuteError, err) - } - - pReg := env.ParamTypesRegistry - - any := codectypes.Any{} - err = proto.Unmarshal(paramSetBytes, &any) - - if err != nil { - return encodeErrToResultBytes(result.ExecuteError, err) - } - - pset, err := pReg.UnpackAny(&any) - - if err != nil { - return encodeErrToResultBytes(result.ExecuteError, err) - } - - subspace.SetParamSet(env.Ctx, pset) - - // return empty bytes if no error - return encodeBytesResultBytes([]byte{}) -} - -//export GetParamSet -func GetParamSet(envId uint64, subspaceName, typeUrl string) *C.char { - env := loadEnv(envId) - - subspace, ok := env.App.ParamsKeeper.GetSubspace(subspaceName) - if !ok { - err := errors.New("No subspace found for `" + subspaceName + "`") - return encodeErrToResultBytes(result.ExecuteError, err) - } - - pReg := env.ParamTypesRegistry - pset, ok := pReg.GetEmptyParamsSet(typeUrl) - - if !ok { - err := errors.New("No param set found for `" + typeUrl + "`") - return encodeErrToResultBytes(result.ExecuteError, err) - } - subspace.GetParamSet(env.Ctx, pset) - - bz, err := proto.Marshal(pset) - - if err != nil { - panic(err) - } - - return encodeBytesResultBytes(bz) -} - //export GetValidatorAddress func GetValidatorAddress(envId uint64, n int32) *C.char { env := loadEnv(envId)