Skip to content

Commit

Permalink
Update RET from main -
Browse files Browse the repository at this point in the history
  • Loading branch information
runner authored and runner committed Apr 22, 2024
1 parent bc9a05d commit 1c605d2
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 61 deletions.
157 changes: 131 additions & 26 deletions Sources/EngineToolkit/radix_engine_toolkit_uniffi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8592,6 +8592,53 @@ public func FfiConverterTypeProtocolUpdateReadinessSignalEvent_lower(_ value: Pr
}


public struct PublicKeyFingerprint {
public var bytes: HashableBytes

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(bytes: HashableBytes) {
self.bytes = bytes
}
}


extension PublicKeyFingerprint: Equatable, Hashable {
public static func ==(lhs: PublicKeyFingerprint, rhs: PublicKeyFingerprint) -> Bool {
if lhs.bytes != rhs.bytes {
return false
}
return true
}

public func hash(into hasher: inout Hasher) {
hasher.combine(bytes)
}
}


public struct FfiConverterTypePublicKeyFingerprint: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PublicKeyFingerprint {
return try PublicKeyFingerprint(
bytes: FfiConverterTypeHashableBytes.read(from: &buf)
)
}

public static func write(_ value: PublicKeyFingerprint, into buf: inout [UInt8]) {
FfiConverterTypeHashableBytes.write(value.bytes, into: &buf)
}
}


public func FfiConverterTypePublicKeyFingerprint_lift(_ buf: RustBuffer) throws -> PublicKeyFingerprint {
return try FfiConverterTypePublicKeyFingerprint.lift(buf)
}

public func FfiConverterTypePublicKeyFingerprint_lower(_ value: PublicKeyFingerprint) -> RustBuffer {
return FfiConverterTypePublicKeyFingerprint.lower(value)
}


public struct RecoveryProposal {
public var ruleSet: RuleSet
public var timedRecoveryDelayInMinutes: UInt32?
Expand Down Expand Up @@ -10705,8 +10752,8 @@ extension CurveType: Equatable, Hashable {}
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
public enum DecryptorsByCurve {

case ed25519(dhEphemeralPublicKey: Ed25519PublicKey, decryptors: [Data: Data])
case secp256k1(dhEphemeralPublicKey: Secp256k1PublicKey, decryptors: [Data: Data])
case ed25519(dhEphemeralPublicKey: Ed25519PublicKey, decryptors: [PublicKeyFingerprint: Data])
case secp256k1(dhEphemeralPublicKey: Secp256k1PublicKey, decryptors: [PublicKeyFingerprint: Data])
}

public struct FfiConverterTypeDecryptorsByCurve: FfiConverterRustBuffer {
Expand All @@ -10718,12 +10765,12 @@ public struct FfiConverterTypeDecryptorsByCurve: FfiConverterRustBuffer {

case 1: return .ed25519(
dhEphemeralPublicKey: try FfiConverterTypeEd25519PublicKey.read(from: &buf),
decryptors: try FfiConverterDictionaryDataData.read(from: &buf)
decryptors: try FfiConverterDictionaryTypePublicKeyFingerprintData.read(from: &buf)
)

case 2: return .secp256k1(
dhEphemeralPublicKey: try FfiConverterTypeSecp256k1PublicKey.read(from: &buf),
decryptors: try FfiConverterDictionaryDataData.read(from: &buf)
decryptors: try FfiConverterDictionaryTypePublicKeyFingerprintData.read(from: &buf)
)

default: throw UniffiInternalError.unexpectedEnumCase
Expand All @@ -10737,13 +10784,13 @@ public struct FfiConverterTypeDecryptorsByCurve: FfiConverterRustBuffer {
case let .ed25519(dhEphemeralPublicKey,decryptors):
writeInt(&buf, Int32(1))
FfiConverterTypeEd25519PublicKey.write(dhEphemeralPublicKey, into: &buf)
FfiConverterDictionaryDataData.write(decryptors, into: &buf)
FfiConverterDictionaryTypePublicKeyFingerprintData.write(decryptors, into: &buf)


case let .secp256k1(dhEphemeralPublicKey,decryptors):
writeInt(&buf, Int32(2))
FfiConverterTypeSecp256k1PublicKey.write(dhEphemeralPublicKey, into: &buf)
FfiConverterDictionaryDataData.write(decryptors, into: &buf)
FfiConverterDictionaryTypePublicKeyFingerprintData.write(decryptors, into: &buf)

}
}
Expand Down Expand Up @@ -18453,22 +18500,22 @@ fileprivate struct FfiConverterDictionaryStringDictionaryStringOptionTypeMetadat
}
}

fileprivate struct FfiConverterDictionaryDataData: FfiConverterRustBuffer {
public static func write(_ value: [Data: Data], into buf: inout [UInt8]) {
fileprivate struct FfiConverterDictionaryTypePublicKeyFingerprintData: FfiConverterRustBuffer {
public static func write(_ value: [PublicKeyFingerprint: Data], into buf: inout [UInt8]) {
let len = Int32(value.count)
writeInt(&buf, len)
for (key, value) in value {
FfiConverterData.write(key, into: &buf)
FfiConverterTypePublicKeyFingerprint.write(key, into: &buf)
FfiConverterData.write(value, into: &buf)
}
}

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Data: Data] {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [PublicKeyFingerprint: Data] {
let len: Int32 = try readInt(&buf)
var dict = [Data: Data]()
var dict = [PublicKeyFingerprint: Data]()
dict.reserveCapacity(Int(len))
for _ in 0..<len {
let key = try FfiConverterData.read(from: &buf)
let key = try FfiConverterTypePublicKeyFingerprint.read(from: &buf)
let value = try FfiConverterData.read(from: &buf)
dict[key] = value
}
Expand Down Expand Up @@ -18522,14 +18569,40 @@ fileprivate struct FfiConverterDictionaryTypeEntityTypeSequenceTypeAddress: FfiC
}
}

public func buildInformation() -> BuildInformation {
return try! FfiConverterTypeBuildInformation.lift(
try! rustCall() {
uniffi_radix_engine_toolkit_uniffi_fn_func_build_information($0)

/**
* Typealias from the type name used in the UDL file to the builtin type. This
* is needed because the UDL type name is used in function/method signatures.
*/
public typealias HashableBytes = Data
public struct FfiConverterTypeHashableBytes: FfiConverter {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> HashableBytes {
return try FfiConverterData.read(from: &buf)
}

public static func write(_ value: HashableBytes, into buf: inout [UInt8]) {
return FfiConverterData.write(value, into: &buf)
}

public static func lift(_ value: RustBuffer) throws -> HashableBytes {
return try FfiConverterData.lift(value)
}

public static func lower(_ value: HashableBytes) -> RustBuffer {
return FfiConverterData.lower(value)
}
}
)


public func FfiConverterTypeHashableBytes_lift(_ value: RustBuffer) throws -> HashableBytes {
return try FfiConverterTypeHashableBytes.lift(value)
}

public func FfiConverterTypeHashableBytes_lower(_ value: HashableBytes) -> RustBuffer {
return FfiConverterTypeHashableBytes.lower(value)
}


public func deriveOlympiaAccountAddressFromPublicKey(publicKey: PublicKey, olympiaNetwork: OlympiaNetwork) throws -> OlympiaAddress {
return try FfiConverterTypeOlympiaAddress.lift(
try rustCallWithError(FfiConverterTypeRadixEngineToolkitError.lift) {
Expand Down Expand Up @@ -18599,19 +18672,27 @@ public func deriveVirtualSignatureNonFungibleGlobalIdFromPublicKey(publicKey: Pu
)
}

public func hash(data: Data) -> Hash {
public func getBuildInformation() -> BuildInformation {
return try! FfiConverterTypeBuildInformation.lift(
try! rustCall() {
uniffi_radix_engine_toolkit_uniffi_fn_func_get_build_information($0)
}
)
}

public func getHash(data: Data) -> Hash {
return try! FfiConverterTypeHash.lift(
try! rustCall() {
uniffi_radix_engine_toolkit_uniffi_fn_func_hash(
uniffi_radix_engine_toolkit_uniffi_fn_func_get_hash(
FfiConverterData.lower(data),$0)
}
)
}

public func knownAddresses(networkId: UInt8) -> KnownAddresses {
public func getKnownAddresses(networkId: UInt8) -> KnownAddresses {
return try! FfiConverterTypeKnownAddresses.lift(
try! rustCall() {
uniffi_radix_engine_toolkit_uniffi_fn_func_known_addresses(
uniffi_radix_engine_toolkit_uniffi_fn_func_get_known_addresses(
FfiConverterUInt8.lower(networkId),$0)
}
)
Expand Down Expand Up @@ -18684,6 +18765,24 @@ public func nonFungibleLocalIdSborEncode(value: NonFungibleLocalId) throws -> Da
)
}

public func publicKeyFingerprintFromVec(bytes: Data) -> PublicKeyFingerprint {
return try! FfiConverterTypePublicKeyFingerprint.lift(
try! rustCall() {
uniffi_radix_engine_toolkit_uniffi_fn_func_public_key_fingerprint_from_vec(
FfiConverterData.lower(bytes),$0)
}
)
}

public func publicKeyFingerprintToVec(value: PublicKeyFingerprint) -> Data {
return try! FfiConverterData.lift(
try! rustCall() {
uniffi_radix_engine_toolkit_uniffi_fn_func_public_key_fingerprint_to_vec(
FfiConverterTypePublicKeyFingerprint.lower(value),$0)
}
)
}

public func sborDecodeToStringRepresentation(bytes: Data, representation: SerializationMode, networkId: UInt8, schema: Schema?) throws -> String {
return try FfiConverterString.lift(
try rustCallWithError(FfiConverterTypeRadixEngineToolkitError.lift) {
Expand Down Expand Up @@ -18752,9 +18851,6 @@ private var initializationResult: InitializationResult {
if bindings_contract_version != scaffolding_contract_version {
return InitializationResult.contractVersionMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_build_information() != 17662) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_derive_olympia_account_address_from_public_key() != 19647) {
return InitializationResult.apiChecksumMismatch
}
Expand All @@ -18776,10 +18872,13 @@ private var initializationResult: InitializationResult {
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_derive_virtual_signature_non_fungible_global_id_from_public_key() != 61146) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_hash() != 16303) {
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_get_build_information() != 61037) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_get_hash() != 23353) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_known_addresses() != 16813) {
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_get_known_addresses() != 16556) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_manifest_sbor_decode_to_string_representation() != 19578) {
Expand All @@ -18803,6 +18902,12 @@ private var initializationResult: InitializationResult {
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_non_fungible_local_id_sbor_encode() != 44017) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_public_key_fingerprint_from_vec() != 41521) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_public_key_fingerprint_to_vec() != 4950) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_radix_engine_toolkit_uniffi_checksum_func_sbor_decode_to_string_representation() != 11831) {
return InitializationResult.apiChecksumMismatch
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>RadixEngineToolkit.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>RadixEngineToolkit.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,6 @@ uint16_t uniffi_radix_engine_toolkit_uniffi_fn_method_validationconfig_min_tip_p
uint8_t uniffi_radix_engine_toolkit_uniffi_fn_method_validationconfig_network_id(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
);
void uniffi_radix_engine_toolkit_uniffi_fn_init_callback_signer(ForeignCallback _Nonnull callback_stub, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_build_information(RustCallStatus *_Nonnull out_status

);
void*_Nonnull uniffi_radix_engine_toolkit_uniffi_fn_func_derive_olympia_account_address_from_public_key(RustBuffer public_key, RustBuffer olympia_network, RustCallStatus *_Nonnull out_status
);
Expand All @@ -791,9 +788,12 @@ void*_Nonnull uniffi_radix_engine_toolkit_uniffi_fn_func_derive_virtual_identity
);
void*_Nonnull uniffi_radix_engine_toolkit_uniffi_fn_func_derive_virtual_signature_non_fungible_global_id_from_public_key(RustBuffer public_key, uint8_t network_id, RustCallStatus *_Nonnull out_status
);
void*_Nonnull uniffi_radix_engine_toolkit_uniffi_fn_func_hash(RustBuffer data, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_get_build_information(RustCallStatus *_Nonnull out_status

);
void*_Nonnull uniffi_radix_engine_toolkit_uniffi_fn_func_get_hash(RustBuffer data, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_known_addresses(uint8_t network_id, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_get_known_addresses(uint8_t network_id, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_manifest_sbor_decode_to_string_representation(RustBuffer bytes, RustBuffer representation, uint8_t network_id, RustBuffer schema, RustCallStatus *_Nonnull out_status
);
Expand All @@ -809,6 +809,10 @@ RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_non_fungible_local_id_sbor
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_non_fungible_local_id_sbor_encode(RustBuffer value, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_public_key_fingerprint_from_vec(RustBuffer bytes, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_public_key_fingerprint_to_vec(RustBuffer value, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_sbor_decode_to_string_representation(RustBuffer bytes, RustBuffer representation, uint8_t network_id, RustBuffer schema, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_radix_engine_toolkit_uniffi_fn_func_sbor_decode_to_typed_native_event(RustBuffer event_type_identifier, RustBuffer event_data, uint8_t network_id, RustCallStatus *_Nonnull out_status
Expand Down Expand Up @@ -932,9 +936,6 @@ void ffi_radix_engine_toolkit_uniffi_rust_future_cancel_void(void* _Nonnull hand
void ffi_radix_engine_toolkit_uniffi_rust_future_free_void(void* _Nonnull handle
);
void ffi_radix_engine_toolkit_uniffi_rust_future_complete_void(void* _Nonnull handle, RustCallStatus *_Nonnull out_status
);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_build_information(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_derive_olympia_account_address_from_public_key(void

Expand All @@ -957,10 +958,13 @@ uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_derive_virtual_identit
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_derive_virtual_signature_non_fungible_global_id_from_public_key(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_hash(void
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_get_build_information(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_get_hash(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_known_addresses(void
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_get_known_addresses(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_manifest_sbor_decode_to_string_representation(void
Expand All @@ -983,6 +987,12 @@ uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_non_fungible_local_id_
);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_non_fungible_local_id_sbor_encode(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_public_key_fingerprint_from_vec(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_public_key_fingerprint_to_vec(void

);
uint16_t uniffi_radix_engine_toolkit_uniffi_checksum_func_sbor_decode_to_string_representation(void

Expand Down
Binary file not shown.
Loading

0 comments on commit 1c605d2

Please sign in to comment.