Skip to content

Commit

Permalink
fix: ABI generation (#146)
Browse files Browse the repository at this point in the history
* Update access_controllable.rs

* fix: use #[near(serializers = [json])] to derive serde
  • Loading branch information
mitinarseny authored Oct 2, 2024
1 parent 3328165 commit e6e4b07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions near-plugins/src/access_controllable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<AccountId>,
Expand All @@ -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<AccountId>,
Expand Down
8 changes: 4 additions & 4 deletions near-plugins/src/upgradable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<near_sdk::Duration>,
pub staging_timestamp: Option<near_sdk::Timestamp>,
Expand All @@ -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,
Expand Down

0 comments on commit e6e4b07

Please sign in to comment.