-
Notifications
You must be signed in to change notification settings - Fork 59
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
[apps] Pretty print the fidelity bonds #389
Comments
I was wondering if a custom |
It will be a good fit here. ACK. You want a custom |
@mojoX911 for calculating bond-value we need to do some rpc calls (see the method calculate_bond_value for Wallet), for using that method we need to load or initialize a wallet in a "path" and provide a RPCCConfig, what makes impossible IMO the implementation of the Display trait for obtaining the desired output, since we dont have a wallet instance in the FidelityBond struct or at least rpc. We can create a cutom print method that takes a &Wallet as a parameter, or add rpc capabilities to the FidelityBond, or maybe I am missing something, Am I right? |
Yes, you are right. Bond value calculation requires RPC. We can have a workaround than Display trait. We can have a function in the wallet called We have access to the wallet at the maker app, so we can directly call that function to print the bonds. |
|
I made a pull request, if something is not ok, give me a feedback please. |
You are right, I was wrong. |
I think I did all the requested changes, take a look please when you are available. |
It's ready to go once CI passes. |
I think I did all the requested changes, take a look please when you are available. |
Currently we are debug displaying the
FidelityBond
struct. Which is too verbose. Instead, we should pretty print the following json.where
bond-value =
wallet.calculate_bond_value()
expires-in =
lock_time - conf_height
The text was updated successfully, but these errors were encountered: