Skip to content
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: log open/closed channels together with their locked AE #840

Merged
merged 3 commits into from
Aug 19, 2022

Conversation

sborrazas
Copy link
Contributor

@sborrazas sborrazas commented Aug 14, 2022

refs #748

@sborrazas sborrazas self-assigned this Aug 14, 2022
Copy link
Collaborator

@thepiwo thepiwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, does it need a resync as I don't see a migration. Let's wait until release with the merge

Copy link
Member

@jyeshe jyeshe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Would only add unit tests for the new mutations and refactor one minor point.

Comment on lines +23 to +33
@spec close_mutation(closing_type(), Node.aetx()) :: ChannelCloseMutation.t()
def close_mutation(tx_type, tx), do: ChannelCloseMutation.new(tx_type, tx)

@spec open_mutation(Node.aetx()) :: ChannelOpenMutation.t()
def open_mutation(tx), do: ChannelOpenMutation.new(tx)

@spec deposit_mutation(Node.aetx()) :: ChannelSpendMutation.t()
def deposit_mutation(tx), do: ChannelSpendMutation.new(:aesc_deposit_tx.amount(tx))

@spec withdraw_mutation(Node.aetx()) :: ChannelSpendMutation.t()
def withdraw_mutation(tx), do: ChannelSpendMutation.new(-:aesc_withdraw_tx.amount(tx))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's neat but personally I would call the new directly avoiding the indirection as they are used only once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this was to encapsulate the :aesc module inside the Channels module so that the Transaction module didn't have to deal with them directly

This migration will avoid requiring a full-sync, but it will take
~30mins to run.
@sborrazas
Copy link
Contributor Author

@thepiwo I've now added the migration which to me took ~30min to run. This migration will avoid having to perform a resync

@sborrazas sborrazas requested a review from thepiwo August 16, 2022 11:42
@sborrazas sborrazas merged commit d965275 into master Aug 19, 2022
@sborrazas sborrazas deleted the channels-stats branch August 19, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants