Skip to content

Commit

Permalink
fastbreak(cadence): upgrade
Browse files Browse the repository at this point in the history
* Upgrade cadence contract for private path to storage.
  • Loading branch information
chumeston committed Dec 4, 2024
1 parent 066c364 commit a939dbf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contracts/FastBreakV1.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,18 @@ access(all) contract FastBreakV1: NonFungibleToken {

}
}

/// Convert a private path to a storage path using a "_PrivateCap" suffix convention, used for saving Aggregator and Supplier resources
///
access(all) view fun convertPrivateToStoragePath(_ privatePath : PrivatePath) : StoragePath {
return StoragePath(identifier: privatePath.toString().replaceAll(of: "private/", with: "").concat("_PrivateCap"))!
}

/// Convert a private path to a storage path using a "_PrivateCap" suffix convention, used for saving Aggregator and Supplier resources
///
access(all) view fun getPrivateCapPathFromStoragePath(_ storagePath : StoragePath) : StoragePath {
return StoragePath(identifier: storagePath.toString().replaceAll(of: "storage/", with: "").concat("_PrivateCap"))!
}
}

init() {
Expand Down

0 comments on commit a939dbf

Please sign in to comment.