Skip to content

Instantly share code, notes, and snippets.

@CyonAlexRDX
Last active January 17, 2025 11:54
Show Gist options
  • Select an option

  • Save CyonAlexRDX/72d0f55a302753196cc294ad8b33558b to your computer and use it in GitHub Desktop.

Select an option

Save CyonAlexRDX/72d0f55a302753196cc294ad8b33558b to your computer and use it in GitHub Desktop.
apply_shield_manifests.rs
struct ApplyShieldManifests {
/// Manifests which does not include the primary role, so these
/// can be signed even if user is unable to exercise the Primary
/// role, we group them into this struct so that we know that
/// we cannot set ROLA keys for these entities and must have
/// XRD in AccessControllers vault (since we cannot withdraw XRD
/// from any account which would require Primary).
excluding_primary: ApplyShieldManifestsExcludingPrimary,
/// Manifests grouped toghether which all require Primary.
///
/// N.B. mostly grouped into this type for "symmetry" with
/// `excluding_primary`, can be "flattened" and moved into
/// this type directly.
including_primary: ApplyShieldManifestsIncludingPrimary,
}
struct ApplyShieldManifestsIncludingPrimary {
// ====================================
// (Primary + Recovery + Confirmation)
// ====================================
all_roles: TransactionManifest, // explicitly exercises Confirmation role
// ====================================
// (Primary + Recovery + Time)
// ====================================
primary_and_recovery_with_timed_auto_confirm: TransactionManifest,
// ====================================
// (Primary + Confirmation)
// ====================================
primary_and_explicit_confirmation: TransactionManifest,
// ====================================
// (Primary + Time) ‼️ REQUIRES "Dugong" ‼️
// ====================================
primary_with_timed_auto_confirm: TransactionManifest,
}
/// N.B. request to apply a shield to entities cannot include
/// setting of a new ROLA key, which REQUIRES Primary, also
/// the XRD vault of the AccessController of these entities
/// MUST contain enough XRD since we cannot withdraw XRD from ANY
/// account since we are not allowed to use any Primary role.
///
/// MAYBE we should rethink these as manifests which does not
/// required Primary role for the entities getting their shield
/// updated, but allow Primary for another TX Fee paying account..?
struct ApplyShieldManifestsExcludingPrimary {
// ====================================
// (Recovery + Confirmation)
// ====================================
recovery_and_explicit_confirmation: TransactionManifest,
// ====================================
// (Recovery + Time)
// ====================================
recovery_with_timed_auto_confirm: TransactionManifest,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment