-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feat/balance manipuration #67
Conversation
I couldn't build on mac.
|
Some Substrate's current prerequisites seem not to be installed. You need to install them. I think |
Resolve #65
User's free balance manipuration.
Because
Solution here is creating unsigned extrinsic and put it in transaction pool when RPC method is called.
Custom logic added to balances_pallet
For balance manipulation, some custom logic are added to the original pallet_balances (polkadot-v0.9.39).
※ Comment out
[swanky node specific]
is added to those custom implementations. source code underframe/balances/src
other than[swanky node specific]
is copied from Substrate.set_free_balance
callThis is almost same as
set_balance
. Whileset_balance
altersfree_balance
andreserved_balance
only allowed byRootOrigin
,set_free_balance
altersfree_balance
only unless account itself is removed due to Existential Deposit and operation is only allowed byNoneOrigin
so that it can accept UnsignedExtrinsic.validate_unsigned
Because
set_free_balance
uses Unsigned Extrinsic, we needvalidate_unsigned
implementation in balances pallet to check validity of them.How to set free balance
Example Request
Example Response
How to get account info via custom RPC
Example Request
Example Response