This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from dj8yfo/extract_constants
chore: Extract constants
- Loading branch information
Showing
32 changed files
with
365 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
use fmt_buffer::Buffer; | ||
|
||
use crate::utils::types::{capped_string::CappedString, hex_display::HexDisplay}; | ||
|
||
/// A capped string for storing | ||
/// https://docs.rs/near-account-id/1.0.0/near_account_id/struct.AccountId.html | ||
/// where all bytes after 64-byte prefix are truncated and displayed as `... N bytes` ellipsis | ||
/// | ||
/// 64 is enough to show implicit account ID-s and most of | ||
/// practical named account ID-s | ||
pub type CappedAccountId = CappedString<64>; | ||
|
||
/// A buffer, large enough to contain string representation | ||
/// of u64 | ||
pub type U64Buffer = [u8; 20]; | ||
/// A buffer, large enough to contain string representation | ||
/// of u32 | ||
pub type U32Buffer = [u8; 10]; | ||
|
||
/// Type, which is used for displaying full `args` field of | ||
/// https://docs.rs/near-primitives/0.21.2/near_primitives/action/struct.FunctionCallAction.html | ||
/// or prefix of `args` with suffix truncated and displayed as `... N bytes` ellipsis, | ||
/// displayed in hexadecimal form, when `args` are considered just arbitrary bytes. | ||
/// | ||
/// Current parameter value is limited by `nanos` capabilities. | ||
/// The parameter value can be made larger with `#[cfg(target_os = "...")]` | ||
/// for other platforms | ||
/// see https://github.com/dj8yfo/app-near-rs/pull/45/files | ||
pub type FnCallHexDisplay = HexDisplay<200>; | ||
|
||
/// Type, which is used for displaying full `args` field of | ||
/// https://docs.rs/near-primitives/0.21.2/near_primitives/action/struct.FunctionCallAction.html | ||
/// or prefix of `args` with suffix truncated and displayed as `... N bytes` ellipsis, | ||
/// displayed as string, when `args` is considered to be a valid utf-8 string | ||
/// | ||
/// Current parameter value is limited by `nanos` capabilities. | ||
/// The parameter value can be made larger with `#[cfg(target_os = "...")]` | ||
/// for other platforms | ||
/// see https://github.com/dj8yfo/app-near-rs/pull/45/files | ||
pub type FnCallCappedString = CappedString<200>; | ||
|
||
/// Type, which is used for displaying full `method_names` field of | ||
/// https://docs.rs/near-primitives/0.21.2/near_primitives/account/struct.FunctionCallPermission.html | ||
/// or prefix of `method_names` with suffix truncated and displayed as `... N bytes` ellipsis | ||
/// | ||
/// Current parameter value is limited by `nanos` capabilities. | ||
/// The parameter value can be made larger with `#[cfg(target_os = "...")]` | ||
/// for other platforms | ||
/// see https://github.com/dj8yfo/app-near-rs/pull/45/files | ||
pub type MethodNamesBuffer = Buffer<210>; | ||
|
||
/// Type, which is used for displaying full `message` field of | ||
/// https://docs.rs/near-ledger/0.5.0/near_ledger/struct.NEP413Payload.html | ||
/// or prefix of `message` with suffix truncated and displayed as `... N bytes` ellipsis | ||
/// | ||
/// Current parameter value is limited by `nanos` capabilities. | ||
/// The parameter value can be made larger with `#[cfg(target_os = "...")]` | ||
/// for other platforms | ||
/// see https://github.com/dj8yfo/app-near-rs/pull/45/files | ||
pub type NEP413CappedString = CappedString<400>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.