Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
lightning-bits
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
lightning-bits
Commits
247853e0
Unverified
Commit
247853e0
authored
Apr 29, 2019
by
Tankred Hase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove commitFee from closing/force-closing computed channel balances
parent
4e067572
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
12 deletions
+6
-12
channel.js
src/computed/channel.js
+2
-2
channel.spec.js
test/unit/computed/channel.spec.js
+4
-10
No files found.
src/computed/channel.js
View file @
247853e0
...
...
@@ -68,7 +68,7 @@ const ComputedChannel = store => {
get
channelBalanceClosingSatoshis
()
{
return
(
store
.
pendingChannels
||
[])
.
filter
(
c
=>
!
c
.
status
.
includes
(
'open'
))
.
map
(
c
=>
c
.
localBalance
+
c
.
commitFee
)
.
map
(
c
=>
c
.
localBalance
)
.
reduce
((
a
,
b
)
=>
a
+
b
,
0
);
},
get
channelBalanceClosingLabel
()
{
...
...
@@ -78,7 +78,7 @@ const ComputedChannel = store => {
get
channelBalanceForceClosingSatoshis
()
{
return
(
store
.
pendingChannels
||
[])
.
filter
(
c
=>
c
.
status
===
'pending-force-closing'
)
.
map
(
c
=>
c
.
localBalance
+
c
.
commitFee
)
.
map
(
c
=>
c
.
localBalance
)
.
reduce
((
a
,
b
)
=>
a
+
b
,
0
);
},
get
channelBalanceForceClosingLabel
()
{
...
...
test/unit/computed/channel.spec.js
View file @
247853e0
...
...
@@ -46,7 +46,6 @@ describe('Computed Channels Unit Tests', () => {
capacity
:
805000
,
localBalance
:
500000
,
remoteBalance
:
300000
,
commitFee
:
200
,
channelPoint
:
'some-channel-point'
,
status
:
'pending-closing'
,
});
...
...
@@ -56,7 +55,6 @@ describe('Computed Channels Unit Tests', () => {
capacity
:
705000
,
localBalance
:
400000
,
remoteBalance
:
300000
,
commitFee
:
100
,
channelPoint
:
'some-channel-point'
,
status
:
'pending-force-closing'
,
});
...
...
@@ -102,12 +100,8 @@ describe('Computed Channels Unit Tests', () => {
expect
(
store
.
channelBalanceOpenLabel
,
'to match'
,
/^0
[
,.
]
019905$/
);
expect
(
store
.
channelBalanceInactiveLabel
,
'to match'
,
/^0
[
,.
]
019904$/
);
expect
(
store
.
channelBalancePendingLabel
,
'to match'
,
/^0
[
,.
]
006003$/
);
expect
(
store
.
channelBalanceClosingLabel
,
'to match'
,
/^0
[
,.
]
009003$/
);
expect
(
store
.
channelBalanceForceClosingLabel
,
'to match'
,
/^0
[
,.
]
004001$/
);
expect
(
store
.
channelBalanceClosingLabel
,
'to match'
,
/^0
[
,.
]
009$/
);
expect
(
store
.
channelBalanceForceClosingLabel
,
'to match'
,
/^0
[
,.
]
004$/
);
expect
(
store
.
channelStatus
,
'to equal'
,
'success'
);
});
...
...
@@ -123,8 +117,8 @@ describe('Computed Channels Unit Tests', () => {
expect
(
store
.
channelBalanceOpenLabel
,
'to match'
,
/137
[
,.
]
25/
);
expect
(
store
.
channelBalanceInactiveLabel
,
'to match'
,
/137
[
,.
]
24/
);
expect
(
store
.
channelBalancePendingLabel
,
'to match'
,
/41
[
,.
]
39/
);
expect
(
store
.
channelBalanceClosingLabel
,
'to match'
,
/62
[
,.
]
0
8
/
);
expect
(
store
.
channelBalanceForceClosingLabel
,
'to match'
,
/27
[
,.
]
5
9
/
);
expect
(
store
.
channelBalanceClosingLabel
,
'to match'
,
/62
[
,.
]
0
6
/
);
expect
(
store
.
channelBalanceForceClosingLabel
,
'to match'
,
/27
[
,.
]
5
8
/
);
});
it
(
'should display pending status'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment