Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ABI generation #146

Merged
merged 2 commits into from
Oct 2, 2024
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
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
Loading