Questions tagged [lockable-currency]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
37 views

How to get Locked Balance of a particular account with a particular LockIdentifier in a pallet?

In a pallet I have used set_lock() with a own LockIdentifier for that pallet. Now I need to check the locked balance of an account with that LockIdentifier and not the global locked amount. how to do ...
Immanuel John's user avatar
0 votes
1 answer
26 views

After using set_lock() should we manually subtract free_balance()?

In a custom pallet, I have been using set_lock() for a staking purpose. But once the lock is done I thought the free_balance() will reduce in the account's balance but it stays the same and only the ...
Immanuel John's user avatar
4 votes
1 answer
48 views

What's the difference between calling T::Currency::transfer() and T::Currency::withdraw()

In the crowdfund pallet linked here: https://github.com/substrate-developer-hub/substrate-how-to-guides/blob/main/example-code/template-node/pallets/simple-crowdfund/src/lib.rs the withdraw function ...
Muhammed Rasheed's user avatar
0 votes
1 answer
56 views

Check if the funds are locked for LockableCurrency

I'm using fn set_lock inside LockableCurrency trait. It's possible to extend or remove lock, but no way to check if funds are in fact locked. Is this by design? and if so what is a good way to check ...
S. Iakovlev's user avatar
0 votes
1 answer
93 views

freeze(account, balance) for pallet-assets, how do I freeze X amount of a certain asset?

Does anyone know if there is a way to freeze (pallet-)asset's similar to how you can "lock"/freeze regular balance with T::Currency::freeze(AccountId, Balance)? seems like there is no easy ...
flipchan's user avatar
  • 309
4 votes
1 answer
48 views

extend_lock vs set_lock

Can someone explain the difference between set_lock and extend_lock? From my reading of the documentation on both, I figure that extend_lock should be called when we want to impose more locks on an ...
Purple_Turtle's user avatar
4 votes
1 answer
43 views

Should pallets that lock currency check for MaxLocks?

In the trait config for LockableCurrency there's a type MaxLocks. I am writing a pallet that uses set_lock and remove_lock from this trait. Should I implement checks to see if I am not exceeding ...
Purple_Turtle's user avatar
4 votes
1 answer
46 views

How to choose a Lock Identifier?

In my pallet, I am writing a function that checks if a user has some minimum amount of free balance, and if they do, proceed with the transaction by locking a DepositFee amount. I found that set_lock ...
Purple_Turtle's user avatar