pub type AccountCurrencyTransferCountDelay<T: Config> = StorageDoubleMap<_GeneratedPrefixForStorageAccountCurrencyTransferCountDelay<T>, Twox64Concat, T::AccountId, Twox64Concat, T::CurrencyId, AllowanceMetadata<BlockNumberFor<T>>, OptionQuery>;
Expand description

Storage item containing number of allowances set, delay for sending account/currency, and block number delay is modifiable at. Contains an instance of AllowanceMetadata with allowance count as u64, current_delay as Option<BlockNumberFor<T>>, and modifiable_at as Option<BlockNumberFor<T>>. If a delay is set, but no allowances have been created, allowance_count will be set to 0. A double map is used here as we need to know whether there is a restriction set for the account and currency in the case where there is no allowance for destination location. Using an StorageNMap would not allow us to look up whether there was a restriction for the sending account and currency, given that:

  • we’re checking whether there’s an allowance specified for the receiver location
    • we would only find whether a restriction was set for the account in this case if:
      • an allowance was specified for the receiving location, which would render blocked restrictions useless
  • we would otherwise need to store a vec of locations, which is problematic given that there isn’t a set limit on receivers If a transfer restriction is in place, then a second lookup is done on AccountCurrencyAllowances to see if there is an allowance for the receiver This allows us to keep storage map vals to known/bounded sizes.

Storage type is [StorageDoubleMap] with key1 type T :: AccountId, key2 type T :: CurrencyId and value type AllowanceMetadata < BlockNumberFor < T > >.

Aliased Type§

struct AccountCurrencyTransferCountDelay<T: Config>(/* private fields */);