-
Notifications
You must be signed in to change notification settings - Fork 53
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
Draft: Subledgers implementation #285
base: main
Are you sure you want to change the base?
Conversation
Blueprint/subledgers fixes
Also wanted to mention some changes we did to the token initialisation, open to discussing this of course, particularly the spawn tag names :) Changes to the token state initialisationWe have also updated the way to initialise tokens to more closely follow the specification which states
This change also removes the default values of "Points Coin" and "PNTS" which are most likely not what you want, forcing users to choose, either with spawn tags or by manually updating after loading the blueprint, the token info. We've also added an extra spawn tag |
This draft implements subledgers as specified in the specification by @samcamwilliams and @twilson63.
Added Handlers for Spawning Processes:
Spawn-Subledger
: Handles the spawning of subledger processes with appropriate tags.NotifySpawn
: Collects and prepares subledger initialization data.Init-Subledgers
: Initializes subledgers and notifies the deployer.Note: These handlers could potentially be merged into a single handler when fix on spawn and #840 are in production.
Added Handlers for Subledger-Specific Operations:
Credit-Notice
: Handles crediting tokens to subledgers.Withdraw
: Manages the withdrawal of tokens from subledgers.Improvements Needed:
Code Duplication in
subledger_code.lua
: Currently, the code insubledger_code.lua
is duplicated to assign it to the spawned process. Does anyone know a better way to handle this to avoid redundancy?Stack Issues with Init-Subledgers: Due to code duplication, adding the Init-Subledgers code in subledger_code.lua results in a recursive loading problem. This prevents the creation of sub-subledgers and needs to be addressed.