Skip to content

Commit

Permalink
refactor: custom types for blockchain
Browse files Browse the repository at this point in the history
  • Loading branch information
xilosada committed Nov 3, 2024
1 parent 3f731d1 commit a2e56f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion contracts/proxy-lib/src/mutate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use std::collections::HashSet;
use std::str::FromStr;

Expand Down
4 changes: 1 addition & 3 deletions contracts/proxy-lib/tests/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ use common::create_account_with_balance;
use common::proxy_lib_helper::ProxyContractHelper;
use ed25519_dalek::SigningKey;
use eyre::Result;
use near_sdk::json_types::Base64VecU8;
use near_sdk::{Gas, NearToken};
use near_sdk::NearToken;
use near_workspaces::network::Sandbox;
use near_workspaces::{Account, Worker};
use serde_json::json;

mod common;

Expand Down
11 changes: 8 additions & 3 deletions crates/context/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ pub enum ContextRequestKind<'a> {
},
}


/// Proxy contract
/// todo: refactor
pub type ProposalId = u32;
pub type Gas = u64;
pub type NativeToken = u128;

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, BorshDeserialize, BorshSerialize)]
#[serde(tag = "scope", content = "params")]
Expand All @@ -113,12 +118,12 @@ pub enum ProposalAction {
receiver_id: String,
method_name: String,
args: String,
deposit: u128,
gas: u64,
deposit: NativeToken,
gas: Gas,
},
Transfer {
receiver_id: String,
amount: u128,
amount: NativeToken,
},
SetNumApprovals {
num_approvals: u32,
Expand Down

0 comments on commit a2e56f2

Please sign in to comment.