Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded admins will fit every chain #1542

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions x/compute/internal/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error {
var contractInfo types.ContractInfo
m.keeper.cdc.MustUnmarshal(iter.Value(), &contractInfo)

if ctx.ChainID() == "secret-4" {
if hardcodedContractAdmins[contractAddress.String()] != "" {
contractInfo.Admin = hardcodedContractAdmins[contractAddress.String()]
// When the contract has a hardcoded admin via gov, adminProof is ignored inside the enclave.
// Otherwise and if valid, adminProof is a 32 bytes array (output of sha256).
// For future proofing and avoiding passing null pointers to the enclave, we'll set it to a 32 bytes array of 0.
contractInfo.AdminProof = make([]byte, 32)
}
if hardcodedContractAdmins[contractAddress.String()] != "" {
contractInfo.Admin = hardcodedContractAdmins[contractAddress.String()]
// When the contract has a hardcoded admin via gov, adminProof is ignored inside the enclave.
// Otherwise and if valid, adminProof is a 32 bytes array (output of sha256).
// For future proofing and avoiding passing null pointers to the enclave, we'll set it to a 32 bytes array of 0.
contractInfo.AdminProof = make([]byte, 32)
}

// get v1 contract key
Expand Down
Loading