Skip to content
Draft
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
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[workspace]
members = [
"fil_actor_decoder",
"fil_actor_json_derive",
"fil_actors_shared",
"fil_actors_test_utils",
"actors/account",
Expand Down Expand Up @@ -86,6 +88,7 @@ fil_actor_cron_state = { version = "24.1.3", path = "./actors/cron" }
fil_actor_datacap_state = { version = "24.1.3", path = "./actors/datacap" }
fil_actor_evm_state = { version = "24.1.3", path = "./actors/evm" }
fil_actor_init_state = { version = "24.1.3", path = "./actors/init" }
fil_actor_json_derive = { version = "0.1.0", path = "./fil_actor_json_derive" }
fil_actor_market_state = { version = "24.1.3", path = "./actors/market" }
fil_actor_miner_state = { version = "24.1.3", path = "./actors/miner" }
fil_actor_multisig_state = { version = "24.1.3", path = "./actors/multisig" }
Expand Down
11 changes: 11 additions & 0 deletions actors/datacap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ lazy_static = { workspace = true }
num-derive = { workspace = true }
num-traits = { workspace = true }
serde = { workspace = true }

# Optional: JSON value conversion
fil_actor_json_derive = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }

[dev-dependencies]
serde_json = { workspace = true }

[features]
default = []
json = ["dep:fil_actor_json_derive", "dep:serde_json", "fil_actors_shared/json"]
3 changes: 3 additions & 0 deletions actors/datacap/src/v10/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use fvm_ipld_encoding::tuple::*;
use fvm_shared3::address::Address;
use fvm_shared3::econ::TokenAmount;

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct MintParams {
// Recipient of the newly minted tokens.
Expand All @@ -15,12 +16,14 @@ pub struct MintParams {
pub operators: Vec<Address>,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct DestroyParams {
pub owner: Address,
pub amount: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct GranularityReturn {
Expand Down
13 changes: 13 additions & 0 deletions actors/datacap/src/v11/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,77 @@ use fvm_ipld_encoding::tuple::*;
use fvm_shared3::address::Address;
use fvm_shared3::econ::TokenAmount;

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct ConstructorParams {
pub governor: Address,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct NameReturn {
pub name: String,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct SymbolReturn {
pub symbol: String,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct TotalSupplyReturn {
pub supply: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct BalanceParams {
pub address: Address,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct BalanceReturn {
pub balance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct GetAllowanceReturn {
pub allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct IncreaseAllowanceReturn {
pub new_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct DecreaseAllowanceReturn {
pub new_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct RevokeAllowanceReturn {
pub old_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct MintParams {
// Recipient of the newly minted tokens.
Expand All @@ -75,12 +86,14 @@ pub struct MintParams {
pub operators: Vec<Address>,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct DestroyParams {
pub owner: Address,
pub amount: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct GranularityReturn {
Expand Down
13 changes: 13 additions & 0 deletions actors/datacap/src/v12/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,77 @@ use fvm_ipld_encoding::tuple::*;
use fvm_shared4::address::Address;
use fvm_shared4::econ::TokenAmount;

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct ConstructorParams {
pub governor: Address,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct NameReturn {
pub name: String,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct SymbolReturn {
pub symbol: String,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct TotalSupplyReturn {
pub supply: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct BalanceParams {
pub address: Address,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct BalanceReturn {
pub balance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct GetAllowanceReturn {
pub allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct IncreaseAllowanceReturn {
pub new_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct DecreaseAllowanceReturn {
pub new_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct RevokeAllowanceReturn {
pub old_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct MintParams {
// Recipient of the newly minted tokens.
Expand All @@ -75,12 +86,14 @@ pub struct MintParams {
pub operators: Vec<Address>,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct DestroyParams {
pub owner: Address,
pub amount: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct GranularityReturn {
Expand Down
13 changes: 13 additions & 0 deletions actors/datacap/src/v13/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,77 @@ use fvm_ipld_encoding::tuple::*;
use fvm_shared4::address::Address;
use fvm_shared4::econ::TokenAmount;

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct ConstructorParams {
pub governor: Address,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct NameReturn {
pub name: String,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct SymbolReturn {
pub symbol: String,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct TotalSupplyReturn {
pub supply: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct BalanceParams {
pub address: Address,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct BalanceReturn {
pub balance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct GetAllowanceReturn {
pub allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct IncreaseAllowanceReturn {
pub new_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct DecreaseAllowanceReturn {
pub new_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct RevokeAllowanceReturn {
pub old_allowance: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct MintParams {
// Recipient of the newly minted tokens.
Expand All @@ -72,12 +83,14 @@ pub struct MintParams {
pub operators: Vec<Address>,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
pub struct DestroyParams {
pub owner: Address,
pub amount: TokenAmount,
}

#[cfg_attr(feature = "json", derive(fil_actor_json_derive::IntoJsonValue))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
#[serde(transparent)]
pub struct GranularityReturn {
Expand Down
Loading
Loading