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

refactor: Reintroduce strictly typed AccountId #4621

Merged
merged 3 commits into from
Aug 5, 2021

Commits on Aug 2, 2021

  1. refactor: Introduce strictly typed and assuredly validated AccountId (n…

    …ear#4440)
    
    This PR introduces a strictly typed structure - `AccountId` that enforces account ID validation.
    This way, we can ensure validity and thereby fail fast before an invalid account name is used.
    
    This also, optionally, ensures validation on {,de}serialization so, yeah..
    
    The structure is defined within its own self-contained crate `near-account-id` to allow for easy publishing.
    The extra dependencies - `borsh`, `serde` are made optional to allow the crate to be lightweight enough to be depended upon.
    
    Within `nearcore`, the structure is reexported via `near_primitives::AccountId` and the crate via `near_primitives{,_core}::account::id` with default features (`borsh`, `serde`) but you can opt-out of those by depending on it directly.
    
    Resolves near#2074, supersedes near#2831.
    
    * [x] Existing unit tests pass with minor updates
    * [x] Nayduck tests pass without modifications
    * [x] Manually ensured that the protocol is not changed
    miraclx committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    0f97949 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    752e07e View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2021

  1. Configuration menu
    Copy the full SHA
    aef2e63 View commit details
    Browse the repository at this point in the history