Skip to content

Commit

Permalink
build fix(7)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad committed Nov 21, 2024
1 parent 2e3d8b0 commit a5b590a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/secretd/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func EmergencyApproveUpgrade() *cobra.Command {
cmd := &cobra.Command{
Use: "emergency_approve_upgrade [mr_enclave]",
Short: "Emergency enclave upgade approval",
Long: "Approve enclave upgrade in an offline mode. Need to reach consensus amoung network validators",
Long: "Approve enclave upgrade in an offline mode. Need to reach consensus among network validators",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {

Check warning on line 314 in cmd/secretd/attestation.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
_, err := api.EmergencyApproveUpgrade(app.DefaultNodeHome, args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/secretd/cli_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func EmergencyApproveUpgrade() *cobra.Command {
cmd := &cobra.Command{
Use: "emergency_approve_upgrade",
Short: "Emergency enclave upgade approval",
Long: "Approve enclave upgrade in an offline mode. Need to reach consensus amoung network validators",
Long: "Approve enclave upgrade in an offline mode. Need to reach consensus among network validators",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
println("This is a secretd only function, yo")
Expand Down
4 changes: 2 additions & 2 deletions go-cosmwasm/api/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func InitEnclaveRuntime(moduleCacheSize uint16) error {
return nil
}

func OnUpgradeProposalPassed(MrEnclaveHash []byte) error {
msgBuf := sendSlice([]byte(MrEnclaveHash))
func OnUpgradeProposalPassed(mrEnclaveHash []byte) error {
msgBuf := sendSlice(mrEnclaveHash)
defer freeAfterSend(msgBuf)

ret, err := C.onchain_approve_upgrade(msgBuf)
Expand Down
2 changes: 1 addition & 1 deletion go-cosmwasm/api/lib_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,6 @@ func GetEncryptedGenesisSeed(cert []byte) ([]byte, error) {
// return fmt.Errorf("heelo")
//}

func OnUpgradeProposalPassed(MrEnclaveHash []byte) error {
func OnUpgradeProposalPassed(mrEnclaveHash []byte) error {
return nil
}
7 changes: 3 additions & 4 deletions x/compute/internal/keeper/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/scrtlabs/SecretNetwork/x/compute/internal/types"
)

Expand Down Expand Up @@ -126,13 +125,13 @@ func (a *CountTXDecorator) verifyUpgradeProposal(ctx sdk.Context, msgUpgrade *ty
return err
}

var latestProposal *v1.Proposal = nil
var latestProposal *govtypes.Proposal = nil

Check warning on line 128 in x/compute/internal/keeper/ante.go

View workflow job for this annotation

GitHub Actions / lint

var-declaration: should drop = nil from declaration of var latestProposal; it is the zero value (revive)
var latestMREnclaveHash []byte

// Iterate through the proposals
for _, proposal := range proposals {
// Check if the proposal has passed and is of type MsgSoftwareUpgrade
if proposal.Status == v1.ProposalStatus_PROPOSAL_STATUS_PASSED {
if proposal.Status == govtypes.ProposalStatus_PROPOSAL_STATUS_PASSED {
if len(proposal.GetMessages()) > 0 && proposal.Messages[0].GetTypeUrl() == msgSoftwareUpgradeTypeURL {
// Update latestProposal if this proposal is newer (has a higher ID)
if latestProposal == nil || proposal.Id > latestProposal.Id {
Expand All @@ -149,7 +148,7 @@ func (a *CountTXDecorator) verifyUpgradeProposal(ctx sdk.Context, msgUpgrade *ty
// If we found the MsgSoftwareUpgrade latest passed proposal, extract the MREnclaveHash from it
info, err := extractInfoFromProposalMessages(latestProposal.Messages[0], a.appcodec)
if err != nil {
return fmt.Errorf("Failed to extract info with MREnclave hash from Proposal, error: %w", err)
return fmt.Errorf("failed to extract info with MREnclave hash from proposal, error: %w", err)
}
latestMREnclaveHash, _ = findMREnclaveHash(info)
if latestMREnclaveHash == nil {
Expand Down

0 comments on commit a5b590a

Please sign in to comment.