Skip to content

Commit

Permalink
build fix WIP(5), gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
valdok committed Apr 2, 2024
1 parent ea39e3e commit b7c4b71
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/upgrades/v1.13/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
6 changes: 2 additions & 4 deletions cmd/secretd/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cmd/secretd/cli_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion cmd/secretd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func NewRootCmd() (*cobra.Command, app.EncodingConfig) {
return err
}
initClientCtx, err = clientconfig.ReadFromClientConfig(initClientCtx)

if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion go-cosmwasm/api/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions go-cosmwasm/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion x/compute/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion x/registration/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func AuthenticateNodeCmd() *cobra.Command {
Certificate: cert,
}
err = msg.ValidateBasic()

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion x/registration/internal/keeper/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7c4b71

Please sign in to comment.