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
daaf6b9e
Unverified
Commit
daaf6b9e
authored
May 03, 2019
by
Tankred Hase
Committed by
GitHub
May 03, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1090 from lightninglabs/dev/fix-pending-commit-fee
Dev/fix pending commit fee
parents
a61d3c4b
134f0eb4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
15 deletions
+14
-15
channel.js
src/action/channel.js
+1
-1
index-mobile.js
src/action/index-mobile.js
+2
-0
channel.js
src/computed/channel.js
+2
-2
screen-story.js
stories/screen-story.js
+2
-0
channel.spec.js
test/unit/action/channel.spec.js
+3
-2
channel.spec.js
test/unit/computed/channel.spec.js
+4
-10
No files found.
src/action/channel.js
View file @
daaf6b9e
...
...
@@ -137,7 +137,6 @@ class ChannelAction {
capacity
:
channel
.
capacity
,
localBalance
:
channel
.
localBalance
,
remoteBalance
:
channel
.
remoteBalance
,
commitFee
:
channel
.
commitFee
||
0
,
channelPoint
:
channel
.
channelPoint
,
fundingTxId
:
this
.
_parseChannelPoint
(
channel
.
channelPoint
)
.
fundingTxidStr
,
...
...
@@ -146,6 +145,7 @@ class ChannelAction {
...
mapPendingAttributes
(
poc
.
channel
),
confirmationHeight
:
poc
.
confirmationHeight
,
blocksTillOpen
:
poc
.
blocksTillOpen
,
commitFee
:
poc
.
commitFee
,
feePerKw
:
poc
.
feePerKw
,
status
:
'pending-open'
,
}));
...
...
src/action/index-mobile.js
View file @
daaf6b9e
...
...
@@ -144,6 +144,7 @@ store.channels = [...Array(4)].map(() => ({
capacity
:
2005000
,
localBalance
:
1990000
,
remoteBalance
:
10000
,
commitFee
:
0
,
channelPoint
:
'3511ae8a52c97d957eaf65f828504e68d0991f0276adff94c6ba91c7f6cd4275'
,
active
:
true
,
...
...
@@ -157,6 +158,7 @@ store.pendingChannels = [...Array(6)].map((x, i) => ({
capacity
:
1005000
,
localBalance
:
600000
,
remoteBalance
:
400000
,
commitFee
:
0
,
channelPoint
:
'3511ae8a52c97d957eaf65f828504e68d0991f0276adff94c6ba91c7f6cd4275'
,
status
:
i
%
2
===
0
?
'pending-closing'
:
'pending-open'
,
...
...
src/computed/channel.js
View file @
daaf6b9e
...
...
@@ -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
()
{
...
...
stories/screen-story.js
View file @
daaf6b9e
...
...
@@ -350,6 +350,7 @@ store.channels = [...Array(4)].map((x, i) => ({
capacity
:
2005000
,
localBalance
:
1990000
,
remoteBalance
:
10000
,
commitFee
:
0
,
channelPoint
:
'3511ae8a52c97d957eaf65f828504e68d0991f0276adff94c6ba91c7f6cd4275'
,
active
:
i
%
2
===
0
?
true
:
false
,
...
...
@@ -363,6 +364,7 @@ store.pendingChannels = [...Array(6)].map((x, i) => ({
capacity
:
1005000
,
localBalance
:
600000
,
remoteBalance
:
400000
,
commitFee
:
0
,
channelPoint
:
'3511ae8a52c97d957eaf65f828504e68d0991f0276adff94c6ba91c7f6cd4275'
,
status
:
i
%
2
===
0
?
'pending-closing'
:
'pending-open'
,
...
...
test/unit/action/channel.spec.js
View file @
daaf6b9e
...
...
@@ -143,13 +143,14 @@ describe('Action Channels Unit Tests', () => {
capacity
:
100
,
localBalance
:
10
,
remoteBalance
:
90
,
commitFee
:
15
,
channelPoint
:
'FFFF:1'
,
};
it
(
'should list pending channels'
,
async
()
=>
{
grpc
.
sendCommand
.
withArgs
(
'pendingChannels'
).
resolves
({
pendingOpenChannels
:
[{
channel
:
{
...
pendingChannel
}
}],
pendingOpenChannels
:
[
{
channel
:
{
...
pendingChannel
},
commitFee
:
15
},
],
pendingClosingChannels
:
[{
channel
:
{
...
pendingChannel
}
}],
pendingForceClosingChannels
:
[
{
...
...
test/unit/computed/channel.spec.js
View file @
daaf6b9e
...
...
@@ -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