Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions crates/iota-sdk-ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

use std::fmt;

use uniffi::Error;

pub type Result<T, E = SdkFfiError> = std::result::Result<T, E>;

#[derive(Debug, Error)]
#[derive(Debug, uniffi::Error)]
#[uniffi(flat_error)]
pub enum SdkFfiError {
Generic(String),
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-sdk-ffi/src/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl FaucetClient {
}
}

#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct FaucetReceipt(pub iota_graphql_client::faucet::FaucetReceipt);

#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct BatchSendStatus(pub iota_graphql_client::faucet::BatchSendStatus);
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ use crate::error::Result;
/// ```text
/// address = 32OCTET
/// ```
#[derive(Copy, Clone, Debug, derive_more::From, derive_more::Deref, uniffi::Object)]
#[derive(derive_more::From, derive_more::Deref, uniffi::Object)]
pub struct Address(pub iota_types::Address);

#[uniffi::export]
Expand Down
6 changes: 3 additions & 3 deletions crates/iota-sdk-ffi/src/types/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub type ProtocolVersion = u64;
/// (option end-of-epoch-data) ; end_of_epoch_data
/// bytes ; version_specific_data
/// ```
#[derive(Clone, Debug, uniffi::Record)]
#[derive(uniffi::Record)]
pub struct CheckpointSummary {
/// Epoch that this checkpoint belongs to.
pub epoch: u64,
Expand Down Expand Up @@ -144,7 +144,7 @@ impl From<CheckpointSummary> for iota_types::CheckpointSummary {
/// checkpoint-commitment = ecmh-live-object-set
/// ecmh-live-object-set = %x00 digest
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct CheckpointCommitment(pub iota_types::CheckpointCommitment);

#[uniffi::export]
Expand All @@ -158,7 +158,7 @@ impl CheckpointCommitment {
}
}

#[derive(Clone, Debug, uniffi::Record)]
#[derive(uniffi::Record)]
pub struct EndOfEpochData {
pub next_epoch_committee: Vec<ValidatorCommitteeMember>,
pub next_epoch_protocol_version: u64,
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
},
};

#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct Coin(pub iota_types::framework::Coin);

#[uniffi::export]
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{error::Result, types::signature::SimpleSignature};
macro_rules! impl_crypto_object {
($(#[$meta:meta])* $t:ident) => {
$(#[$meta])*
#[derive(Copy, Clone, Debug, derive_more::From, derive_more::Deref, uniffi::Object)]
#[derive(derive_more::From, derive_more::Deref, uniffi::Object)]
pub struct $t(pub iota_types::$t);

#[uniffi::export]
Expand Down
10 changes: 5 additions & 5 deletions crates/iota-sdk-ffi/src/types/crypto/multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::types::crypto::{
/// secp256r1-multisig-member-signature = %x02 secp256r1-signature
/// zklogin-multisig-member-signature = %x03 zklogin-authenticator
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct MultisigMemberSignature(pub iota_types::MultisigMemberSignature);

#[uniffi::export]
Expand Down Expand Up @@ -126,7 +126,7 @@ impl MultisigMemberSignature {
/// (secp256k1-flag secp256k1-public-key) /
/// (secp256r1-flag secp256r1-public-key)
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct MultisigMemberPublicKey(pub iota_types::MultisigMemberPublicKey);

#[uniffi::export]
Expand Down Expand Up @@ -221,7 +221,7 @@ impl MultisigMemberPublicKey {
///
/// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the
/// serialized format of RoaringBitmaps.
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct MultisigAggregatedSignature(pub iota_types::MultisigAggregatedSignature);

#[uniffi::export]
Expand Down Expand Up @@ -290,7 +290,7 @@ impl MultisigAggregatedSignature {
/// legacy-multisig-committee = (vector legacy-multisig-member)
/// u16 ; threshold
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct MultisigCommittee(pub iota_types::MultisigCommittee);

#[uniffi::export]
Expand Down Expand Up @@ -362,7 +362,7 @@ impl MultisigCommittee {
/// legacy-multisig-member = legacy-multisig-member-public-key
/// u8 ; weight
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct MultisigMember(pub iota_types::MultisigMember);

#[uniffi::export]
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/crypto/passkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::{error::Result, types::signature::SimpleSignature};
/// signature is ever embedded in another structure it generally is serialized
/// as `bytes` meaning it has a length prefix that defines the length of
/// the completely serialized signature.
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct PasskeyAuthenticator(pub iota_types::PasskeyAuthenticator);

#[uniffi::export]
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/crypto/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::types::crypto::Bls12381PublicKey;
/// validator-committee-member = bls-public-key
/// u64 ; stake
/// ```
#[derive(Clone, Debug, uniffi::Record)]
#[derive(uniffi::Record)]
pub struct ValidatorCommitteeMember {
pub public_key: Arc<Bls12381PublicKey>,
pub stake: u64,
Expand Down
14 changes: 7 additions & 7 deletions crates/iota-sdk-ffi/src/types/crypto/zklogin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::{
/// signature is ever embedded in another structure it generally is serialized
/// as `bytes` meaning it has a length prefix that defines the length of
/// the completely serialized signature.
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct ZkLoginAuthenticator(pub iota_types::ZkLoginAuthenticator);

#[uniffi::export]
Expand Down Expand Up @@ -108,7 +108,7 @@ impl ZkLoginAuthenticator {
/// ```
///
/// [`Address`]: crate::Address
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct ZkLoginPublicIdentifier(pub iota_types::ZkLoginPublicIdentifier);

#[uniffi::export]
Expand Down Expand Up @@ -142,7 +142,7 @@ impl ZkLoginPublicIdentifier {
/// string ; base64url-unpadded encoded JwtHeader
/// bn254-field-element ; address_seed
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct ZkLoginInputs(pub iota_types::ZkLoginInputs);

#[uniffi::export]
Expand Down Expand Up @@ -188,7 +188,7 @@ impl ZkLoginInputs {
/// ```text
/// zklogin-proof = circom-g1 circom-g2 circom-g1
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct ZkLoginProof(pub iota_types::ZkLoginProof);

#[uniffi::export]
Expand Down Expand Up @@ -242,7 +242,7 @@ pub struct ZkLoginClaim {
/// ```text
/// circom-g1 = %x03 3(bn254-field-element)
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct CircomG1(pub iota_types::CircomG1);

#[uniffi::export]
Expand Down Expand Up @@ -273,7 +273,7 @@ impl CircomG1 {
/// ```text
/// circom-g2 = %x03 3(%x02 2(bn254-field-element))
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct CircomG2(pub iota_types::CircomG2);

#[uniffi::export]
Expand Down Expand Up @@ -308,7 +308,7 @@ impl CircomG2 {
/// ```text
/// bn254-field-element = *DIGIT ; which is then interpreted as a radix10 encoded 32-byte value
/// ```
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
#[derive(derive_more::From, uniffi::Object)]
pub struct Bn254FieldElement(pub iota_types::Bn254FieldElement);

#[uniffi::export]
Expand Down
9 changes: 0 additions & 9 deletions crates/iota-sdk-ffi/src/types/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ macro_rules! impl_digest_wrapper {
($(#[$meta:meta])* $t:ident) => {
$(#[$meta])*
#[derive(
Copy,
Clone,
Debug,
Default,
Hash,
PartialEq,
Eq,
PartialOrd,
Ord,
derive_more::From,
derive_more::Deref,
uniffi::Object,
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk-ffi/src/types/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::types::{address::Address, object::ObjectId};
/// ```text
/// event = object-id identifier address struct-tag bytes
/// ```
#[derive(Clone, Debug, uniffi::Record)]
#[derive(uniffi::Record)]
pub struct Event {
/// Package id of the top-level function invoked by a MoveCall command which
/// triggered this event to be emitted.
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-sdk-ffi/src/types/execution_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::types::{address::Address, digest::Digest, object::ObjectId};
/// success = %x00
/// failure = %x01 execution-error (option u64)
/// ```xx
#[derive(Debug, Clone, uniffi::Enum)]
#[derive(uniffi::Enum)]
pub enum ExecutionStatus {
/// The Transaction successfully executed.
Success,
Expand Down Expand Up @@ -144,7 +144,7 @@ impl From<ExecutionStatus> for iota_types::ExecutionStatus {
/// coin-type-global-pause = %x23 string
/// execution-cancelled-due-to-randomness-unavailable = %x24
/// ```
#[derive(Debug, Clone, uniffi::Enum)]
#[derive(uniffi::Enum)]
pub enum ExecutionError {
// General transaction errors
/// Insufficient Gas
Expand Down Expand Up @@ -530,7 +530,7 @@ impl From<ExecutionError> for iota_types::ExecutionError {
/// ```text
/// move-location = object-id identifier u16 u16 (option identifier)
/// ```
#[derive(Clone, Debug, uniffi::Record)]
#[derive(uniffi::Record)]
pub struct MoveLocation {
/// The package id
pub package: Arc<ObjectId>,
Expand Down Expand Up @@ -662,7 +662,7 @@ pub enum CommandArgumentError {
/// unknown-upgrade-policy = %x04 u8
/// package-id-does-not-match = %x05 object-id object-id
/// ```
#[derive(Debug, Clone, uniffi::Enum)]
#[derive(uniffi::Enum)]
pub enum PackageUpgradeError {
/// Unable to fetch package
UnableToFetchPackage { package_id: Arc<ObjectId> },
Expand Down
Loading