diff --git a/near-plugins/src/access_controllable.rs b/near-plugins/src/access_controllable.rs index c1da319..99ff67c 100644 --- a/near-plugins/src/access_controllable.rs +++ b/near-plugins/src/access_controllable.rs @@ -35,8 +35,7 @@ //! Inspired by OpenZeppelin's //! [AccessControl](https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl) module. -use near_sdk::serde::{Deserialize, Serialize}; -use near_sdk::AccountId; +use near_sdk::{near, AccountId}; use std::collections::HashMap; /// # Representation of roles @@ -399,7 +398,8 @@ pub trait AccessControllable { /// # Uniqueness and ordering /// /// Account ids returned in vectors are unique but not ordered. -#[derive(Deserialize, Serialize, Debug)] +#[near(serializers = [json])] +#[derive(Debug)] pub struct PermissionedAccounts { /// The accounts that have super admin permissions. pub super_admins: Vec, @@ -412,7 +412,8 @@ pub struct PermissionedAccounts { /// # Uniqueness and ordering /// /// Account ids returned in vectors are unique but not ordered. -#[derive(Deserialize, Serialize, Debug)] +#[near(serializers = [json])] +#[derive(Debug)] pub struct PermissionedAccountsPerRole { /// The accounts that have admin permissions for the role. pub admins: Vec, diff --git a/near-plugins/src/upgradable.rs b/near-plugins/src/upgradable.rs index a32b020..b67fa5e 100644 --- a/near-plugins/src/upgradable.rs +++ b/near-plugins/src/upgradable.rs @@ -60,8 +60,7 @@ //! [batch transaction]: https://docs.near.org/concepts/basics/transactions/overview //! [time between scheduling and execution]: https://docs.near.org/sdk/rust/promises/intro use crate::events::{AsEvent, EventMetadata}; -use near_sdk::serde::{Deserialize, Serialize}; -use near_sdk::{AccountId, CryptoHash, Gas, NearToken, Promise}; +use near_sdk::{near, serde::Serialize, AccountId, CryptoHash, Gas, NearToken, Promise}; /// Trait describing the functionality of the _Upgradable_ plugin. pub trait Upgradable { @@ -197,7 +196,7 @@ pub trait Upgradable { fn up_apply_update_staging_duration(&mut self); } -#[derive(Deserialize, Serialize)] +#[near(serializers = [json])] pub struct UpgradableDurationStatus { pub staging_duration: Option, pub staging_timestamp: Option, @@ -207,7 +206,8 @@ pub struct UpgradableDurationStatus { /// Specifies a function call to be appended to the actions of a promise via /// [`near_sdk::Promise::function_call`]). -#[derive(Deserialize, Serialize, Debug)] +#[near(serializers = [json])] +#[derive(Debug)] pub struct FunctionCallArgs { /// The name of the function to call. pub function_name: String,