From b7c4b714f4a8f187239b48cf0c36ba6cd4058158 Mon Sep 17 00:00:00 2001 From: valdok Date: Tue, 2 Apr 2024 16:24:33 +0000 Subject: [PATCH] build fix WIP(5), gofumpt --- app/upgrades/v1.13/upgrade.go | 4 ++-- cmd/secretd/attestation.go | 6 ++---- cmd/secretd/cli_attestation.go | 4 ++-- cmd/secretd/root.go | 1 - go-cosmwasm/api/lib.go | 2 +- go-cosmwasm/lib.go | 3 --- x/compute/client/cli/tx.go | 1 - x/registration/client/cli/tx.go | 1 - x/registration/internal/keeper/registration.go | 1 - 9 files changed, 7 insertions(+), 16 deletions(-) diff --git a/app/upgrades/v1.13/upgrade.go b/app/upgrades/v1.13/upgrade.go index 597699614..80255cf2e 100644 --- a/app/upgrades/v1.13/upgrade.go +++ b/app/upgrades/v1.13/upgrade.go @@ -35,11 +35,11 @@ func createUpgradeHandler(mm *module.Manager, _ *keepers.SecretAppKeepers, confi ctx.Logger().Info(fmt.Sprintf("Running module migrations for %s...", upgradeName)) - _, err := api.MigrateSealing(); + _, err := api.MigrateSealing() if err != nil { return nil, err } - return mm.RunMigrations(ctx, configurator, vm) + return mm.RunMigrations(ctx, configurator, vm) } } diff --git a/cmd/secretd/attestation.go b/cmd/secretd/attestation.go index 9c8d98903..3be37cba1 100644 --- a/cmd/secretd/attestation.go +++ b/cmd/secretd/attestation.go @@ -262,7 +262,6 @@ func DumpBin() *cobra.Command { "register the node, during node initialization", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - data, err := os.ReadFile(args[0]) if err != nil { return err @@ -280,10 +279,9 @@ func MigrateSealings() *cobra.Command { cmd := &cobra.Command{ Use: "migrate_sealing", Short: "Migrate sealed files to the current format", - Long: "Re-create SGX-sealed files according to the current format", - Args: cobra.ExactArgs(0), + Long: "Re-create SGX-sealed files according to the current format", + Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) error { - _, err := api.MigrateSealing() if err != nil { return fmt.Errorf("failed to start enclave. Enclave returned: %s", err) diff --git a/cmd/secretd/cli_attestation.go b/cmd/secretd/cli_attestation.go index bc21b3cf2..e4c77bd40 100644 --- a/cmd/secretd/cli_attestation.go +++ b/cmd/secretd/cli_attestation.go @@ -82,8 +82,8 @@ func MigrateSealings() *cobra.Command { cmd := &cobra.Command{ Use: "migrate_sealing", Short: "Migrate sealed files to the current format", - Long: "Re-create SGX-sealed files according to the current format", - Args: cobra.ExactArgs(0), + Long: "Re-create SGX-sealed files according to the current format", + Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) error { println("This is a secretd only function, yo") return nil diff --git a/cmd/secretd/root.go b/cmd/secretd/root.go index 8bd8d239c..168f79445 100644 --- a/cmd/secretd/root.go +++ b/cmd/secretd/root.go @@ -109,7 +109,6 @@ func NewRootCmd() (*cobra.Command, app.EncodingConfig) { return err } initClientCtx, err = clientconfig.ReadFromClientConfig(initClientCtx) - if err != nil { return err } diff --git a/go-cosmwasm/api/lib.go b/go-cosmwasm/api/lib.go index 6e8e7ac4e..9d3662434 100644 --- a/go-cosmwasm/api/lib.go +++ b/go-cosmwasm/api/lib.go @@ -441,7 +441,7 @@ func CreateAttestationReport(apiKey []byte, no_epid bool, no_dcap bool) (bool, e flags |= u32(1) } if no_dcap { - flags |= u32(2); + flags |= u32(2) } _, err := C.create_attestation_report(apiKeySlice, flags, &errmsg) diff --git a/go-cosmwasm/lib.go b/go-cosmwasm/lib.go index 6204250a7..9b687fea9 100644 --- a/go-cosmwasm/lib.go +++ b/go-cosmwasm/lib.go @@ -163,7 +163,6 @@ func (w *Wasmer) Instantiate( var respV010orV1 V010orV1ContractInitResponse err = json.Unmarshal(data, &respV010orV1) - if err != nil { // unidentified response 🤷 return nil, nil, nil, gasUsed, fmt.Errorf("instantiate: cannot parse response from json: %w", err) @@ -262,7 +261,6 @@ func (w *Wasmer) Execute( var resp ContractExecResponse err = json.Unmarshal(data, &resp) - if err != nil { // unidentified response 🤷 return nil, gasUsed, fmt.Errorf("handle: cannot parse response from json: %w", err) @@ -439,7 +437,6 @@ func (w *Wasmer) Migrate( var respV010orV1 ContractExecResponse err = json.Unmarshal(data, &respV010orV1) - if err != nil { // unidentified response 🤷 return nil, nil, nil, gasUsed, fmt.Errorf("migrate: cannot parse response from json: %w", err) diff --git a/x/compute/client/cli/tx.go b/x/compute/client/cli/tx.go index b231ba6ad..f59d625e3 100644 --- a/x/compute/client/cli/tx.go +++ b/x/compute/client/cli/tx.go @@ -98,7 +98,6 @@ func parseStoreCodeArgs(args []string, cliCtx client.Context, flags *flag.FlagSe // gzip the wasm file if wasmUtils.IsWasm(wasm) { wasm, err = wasmUtils.GzipIt(wasm) - if err != nil { return types.MsgStoreCode{}, err } diff --git a/x/registration/client/cli/tx.go b/x/registration/client/cli/tx.go index e101d53ad..5605add82 100644 --- a/x/registration/client/cli/tx.go +++ b/x/registration/client/cli/tx.go @@ -49,7 +49,6 @@ func AuthenticateNodeCmd() *cobra.Command { Certificate: cert, } err = msg.ValidateBasic() - if err != nil { return err } diff --git a/x/registration/internal/keeper/registration.go b/x/registration/internal/keeper/registration.go index 94a7dd5bb..a69eaa0a4 100644 --- a/x/registration/internal/keeper/registration.go +++ b/x/registration/internal/keeper/registration.go @@ -58,7 +58,6 @@ func (k Keeper) ListRegistrationInfo(ctx sdk.Context, cb func([]byte, types.Regi } func (k Keeper) SetRegistrationInfo(ctx sdk.Context, certificate types.RegistrationNodeInfo) { - publicKey, err := ra.VerifyRaCert(certificate.Certificate) if err != nil { return