refactor: use RawPublicKey instead of PublicKey in macaroon issuer

This commit is contained in:
Prad Nukala
2024-10-18 14:09:16 -04:00
parent 6da6f2b97b
commit a0a5f0c7e0
5 changed files with 19 additions and 17 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ var fourYears = time.Hour * 24 * 365 * 4
// IssueAdminMacaroon creates a macaroon with the specified parameters.
func (k Keeper) IssueAdminMacaroon(sdkctx sdk.Context, controller didtypes.ControllerI) (*macaroon.Macaroon, error) {
// Derive the root key by hashing the shared MPC public key
rootKey := sha256.Sum256([]byte(controller.PublicKey()))
rootKey := sha256.Sum256([]byte(controller.RawPublicKey()))
// Create the macaroon
m, err := macaroon.New(rootKey[:], []byte(controller.SonrAddress()), controller.ChainID(), macaroon.LatestVersion)
if err != nil {