Skip to content

Commit

Permalink
chore(near-primitives): document why FunctionCallPermission::receiver…
Browse files Browse the repository at this point in the history
…_id != AccountId (#4773)

Resolves #4739: documents why the `receiver_id` field in `FunctionCallPermission` isn't an `AccountId` despite recently refactoring the whole workspace to using strict `AccountId`-s.

See #4621 (comment) for more context
  • Loading branch information
miraclx committed Sep 6, 2021
1 parent 2309cdb commit 9abfeed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/primitives-core/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ pub struct FunctionCallPermission {
#[serde(with = "option_u128_dec_format")]
pub allowance: Option<Balance>,

// This isn't an AccountId because already existing records in testnet genesis have invalid
// values for this field (see: https://github.com/near/nearcore/pull/4621#issuecomment-892099860)
// we accomodate those by using a string, allowing us to read and parse genesis.
/// The access key only allows transactions with the given receiver's account id.
pub receiver_id: String,

Expand Down

0 comments on commit 9abfeed

Please sign in to comment.