Skip to content

Commit 46c5769

Browse files
authored
Merge pull request #869 from rsksmart/Stable-Test
v2.4.0 -> master
2 parents a5f1497 + 1924384 commit 46c5769

File tree

182 files changed

+12151
-34552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+12151
-34552
lines changed

.github/dependabot.yml

Lines changed: 114 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,128 @@
11
version: 2
2+
23
updates:
3-
- package-ecosystem: 'gomod'
4+
# Go modules - Minor and Patch updates
5+
- package-ecosystem: "gomod"
46
directory: "/"
7+
target-branch: QA-Test
8+
schedule:
9+
interval: "weekly"
10+
# Wait at least 10 days after a new version is released before opening a PR
11+
cooldown:
12+
default-days: 10
13+
labels:
14+
- "dependencies"
15+
- "go"
16+
# one PR per week that groups BOTH minor + patch updates
17+
groups:
18+
go-updates:
19+
applies-to: version-updates
20+
patterns:
21+
- "*"
22+
update-types:
23+
- minor
24+
- patch
25+
26+
# Go modules - Security updates
27+
- package-ecosystem: "gomod"
28+
directory: "/"
29+
target-branch: master
530
schedule:
631
interval: "daily"
32+
# Wait at least 1 day after a security update is released before opening a PR
33+
cooldown:
34+
default-days: 1
35+
labels:
36+
- "dependencies"
37+
- "go"
38+
- "security"
39+
# one PR that groups security updates
40+
groups:
41+
security:
42+
applies-to: security-updates
43+
patterns:
44+
- "*"
45+
46+
# GitHub Actions - Minor and Patch updates
47+
- package-ecosystem: "github-actions"
48+
directory: "/"
749
target-branch: QA-Test
8-
- package-ecosystem: github-actions
50+
schedule:
51+
interval: "weekly"
52+
# Wait at least 10 days after a new version is released before opening a PR
53+
cooldown:
54+
default-days: 10
55+
labels:
56+
- "dependencies"
57+
- "github_actions"
58+
# one PR per week that groups BOTH minor + patch updates
59+
groups:
60+
actions-updates:
61+
applies-to: version-updates
62+
patterns:
63+
- "*"
64+
update-types:
65+
- minor
66+
- patch
67+
68+
# GitHub Actions - Security updates
69+
- package-ecosystem: "github-actions"
970
directory: "/"
71+
target-branch: master
1072
schedule:
1173
interval: "daily"
74+
# Wait at least 1 day after a security update is released before opening a PR
75+
cooldown:
76+
default-days: 1
77+
labels:
78+
- "dependencies"
79+
- "github_actions"
80+
- "security"
81+
# one PR that groups security updates
82+
groups:
83+
security:
84+
applies-to: security-updates
85+
patterns:
86+
- "*"
87+
88+
# Docker - Minor and Patch updates
89+
- package-ecosystem: "docker"
90+
directory: "/"
1291
target-branch: QA-Test
92+
schedule:
93+
interval: "weekly"
94+
# Wait at least 10 days after a new version is released before opening a PR
95+
cooldown:
96+
default-days: 10
97+
labels:
98+
- "dependencies"
99+
- "docker"
100+
# one PR per week that groups BOTH minor + patch updates
13101
groups:
14-
dependencies:
15-
dependency-type: production
16-
dev-dependencies:
17-
dependency-type: development
18-
- package-ecosystem: docker
102+
docker-updates:
103+
applies-to: version-updates
104+
patterns:
105+
- "*"
106+
update-types:
107+
- minor
108+
- patch
109+
110+
# Docker - Security updates
111+
- package-ecosystem: "docker"
19112
directory: "/"
113+
target-branch: master
20114
schedule:
21115
interval: "daily"
22-
target-branch: QA-Test
116+
# Wait at least 1 day after a security update is released before opening a PR
117+
cooldown:
118+
default-days: 1
119+
labels:
120+
- "dependencies"
121+
- "docker"
122+
- "security"
123+
# one PR that groups security updates
124+
groups:
125+
security:
126+
applies-to: security-updates
127+
patterns:
128+
- "*"

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ build/
2727
!sample-config.env
2828
/**/*.env
2929
/**/.env*
30-
.cursorrules
30+
31+
/coverage/
32+
33+
/.cursor/

.mockery.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ packages:
4444
SetGeneralConfigUseCase:
4545
GetPegoutReportUseCase:
4646
GetPeginReportUseCase:
47+
RecommendedPegoutUseCase:
48+
RecommendedPeginUseCase:
49+
GetRevenueReportUseCase:
50+
GetSummariesReportUseCase:
4751
github.com/rsksmart/liquidity-provider-server/internal/entities/liquidity_provider:
4852
interfaces:
4953
LiquidityProviderRepository:
@@ -60,6 +64,7 @@ packages:
6064
interfaces:
6165
BitcoinWallet:
6266
RootstockRpcServer:
67+
LiquidityBridgeContract:
6368
github.com/rsksmart/liquidity-provider-server/internal/entities/rootstock:
6469
interfaces:
6570
BatchPegOutRepository:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tools: download
1717
go install golang.org/x/vuln/cmd/govulncheck@latest
1818
pip3 install pre-commit && pre-commit install
1919
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.63.4
20-
go install github.com/vektra/mockery/v2@v2.53.1 # ensures mockery version 2.53.1 is installed
20+
go install github.com/vektra/mockery/v2@v2.53.0 # ensures mockery version 2.53.0 is installed
2121

2222
download:
2323
go mod download

OpenApi.yml

Lines changed: 124 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ components:
159159
GetTransactionsItem:
160160
properties:
161161
amount:
162-
$ref: '#/components/schemas/Wei'
162+
$ref: '#/components/schemas/'
163163
callFee:
164-
$ref: '#/components/schemas/Wei'
164+
$ref: '#/components/schemas/'
165165
gasFee:
166-
$ref: '#/components/schemas/Wei'
166+
$ref: '#/components/schemas/'
167167
quoteHash:
168168
type: string
169169
status:
@@ -175,11 +175,11 @@ components:
175175
items:
176176
properties:
177177
amount:
178-
$ref: '#/components/schemas/Wei'
178+
$ref: '#/components/schemas/'
179179
callFee:
180-
$ref: '#/components/schemas/Wei'
180+
$ref: '#/components/schemas/'
181181
gasFee:
182-
$ref: '#/components/schemas/Wei'
182+
$ref: '#/components/schemas/'
183183
quoteHash:
184184
type: string
185185
status:
@@ -574,8 +574,8 @@ components:
574574
ProviderDetail:
575575
properties:
576576
fee:
577-
$ref: '#/components/schemas/'
578577
deprecated: true
578+
$ref: '#/components/schemas/'
579579
feePercentage:
580580
type: number
581581
fixedFee:
@@ -612,6 +612,29 @@ components:
612612
- pegin
613613
- pegout
614614
type: object
615+
RecommendedOperationDTO:
616+
properties:
617+
estimatedCallFee:
618+
description: Estimated call fee if a quote is created with the recommended
619+
amount
620+
example: "100000"
621+
estimatedGasFee:
622+
description: Estimated gas fee if a quote is created with the recommended
623+
amount
624+
example: "100000"
625+
estimatedProductFee:
626+
description: Estimated product fee if a quote is created with the recommended
627+
amount
628+
example: "100000"
629+
recommendedQuoteValue:
630+
description: Recommended quote value for the input amount
631+
example: "100000"
632+
required:
633+
- recommendedQuoteValue
634+
- estimatedCallFee
635+
- estimatedGasFee
636+
- estimatedProductFee
637+
type: object
615638
RetainedPeginQuoteDTO:
616639
properties:
617640
callForUserTxHash:
@@ -779,8 +802,6 @@ components:
779802
rbtcLockingCap:
780803
$ref: '#/components/schemas/'
781804
type: object
782-
Wei: {}
783-
entities.Wei: {}
784805
pkg.AcceptAuthenticatedQuoteRequest:
785806
properties:
786807
quoteHash:
@@ -853,6 +874,29 @@ components:
853874
required:
854875
- collateral
855876
type: object
877+
pkg.RecommendedOperationDTO:
878+
properties:
879+
estimatedCallFee:
880+
description: Estimated call fee if a quote is created with the recommended
881+
amount
882+
example: "100000"
883+
estimatedGasFee:
884+
description: Estimated gas fee if a quote is created with the recommended
885+
amount
886+
example: "100000"
887+
estimatedProductFee:
888+
description: Estimated product fee if a quote is created with the recommended
889+
amount
890+
example: "100000"
891+
recommendedQuoteValue:
892+
description: Recommended quote value for the input amount
893+
example: "100000"
894+
required:
895+
- recommendedQuoteValue
896+
- estimatedCallFee
897+
- estimatedGasFee
898+
- estimatedProductFee
899+
type: object
856900
pkg.TrustedAccountRequest:
857901
properties:
858902
address:
@@ -1079,6 +1123,45 @@ paths:
10791123
$ref: '#/components/schemas/GetPeginQuoteResponse'
10801124
description: ""
10811125
summary: Pegin GetQuote
1126+
/pegin/recommended:
1127+
get:
1128+
description: ' Returns the recommended quote value to create a quote whose total
1129+
payment is the input amount'
1130+
parameters:
1131+
- description: Amount in wei expected to use as total payment for the quote
1132+
in: query
1133+
name: amount
1134+
required: true
1135+
schema:
1136+
description: Amount in wei expected to use as total payment for the quote
1137+
format: string
1138+
type: string
1139+
- description: Destination address for the pegin. Is optional, but if provided,
1140+
it will increase the estimation accuracy.
1141+
in: query
1142+
name: destination_address
1143+
schema:
1144+
description: Destination address for the pegin. Is optional, but if provided,
1145+
it will increase the estimation accuracy.
1146+
format: string
1147+
type: string
1148+
- description: Hex-encoded data payload to include in the pegin transaction.
1149+
Is optional, but if provided, it will increase the estimation accuracy.
1150+
in: query
1151+
name: data
1152+
schema:
1153+
description: Hex-encoded data payload to include in the pegin transaction.
1154+
Is optional, but if provided, it will increase the estimation accuracy.
1155+
format: string
1156+
type: string
1157+
responses:
1158+
"200":
1159+
content:
1160+
application/json:
1161+
schema:
1162+
$ref: '#/components/schemas/RecommendedOperationDTO'
1163+
description: Recommended operation object
1164+
summary: Recommended pegin
10821165
/pegin/status:
10831166
get:
10841167
description: ' Returns the status of an accepted pegin quote'
@@ -1192,6 +1275,38 @@ paths:
11921275
$ref: '#/components/schemas/GetPegoutQuoteResponse'
11931276
description: ""
11941277
summary: Pegout GetQuote
1278+
/pegout/recommended:
1279+
get:
1280+
description: ' Returns the recommended quote value to create a quote whose total
1281+
payment is the input amount'
1282+
parameters:
1283+
- description: Amount in wei expected to use as total payment for the quote
1284+
in: query
1285+
name: amount
1286+
required: true
1287+
schema:
1288+
description: Amount in wei expected to use as total payment for the quote
1289+
format: string
1290+
type: string
1291+
- description: 'Destination address type for the pegout. Is optional, but if
1292+
provided, it will increase the estimation accuracy. Must be one of: p2pkh,
1293+
p2sh, p2wpkh, p2wsh, p2tr'
1294+
in: query
1295+
name: destination_type
1296+
schema:
1297+
description: 'Destination address type for the pegout. Is optional, but
1298+
if provided, it will increase the estimation accuracy. Must be one of:
1299+
p2pkh, p2sh, p2wpkh, p2wsh, p2tr'
1300+
format: string
1301+
type: string
1302+
responses:
1303+
"200":
1304+
content:
1305+
application/json:
1306+
schema:
1307+
$ref: '#/components/schemas/RecommendedOperationDTO'
1308+
description: Recommended operation object
1309+
summary: Recommended pegout
11951310
/pegout/status:
11961311
get:
11971312
description: ' Returns the status of an accepted pegout quote'

cmd/utils/refund_user_pegout/refund_user_pegout_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func TestParseRefundUserPegOutScriptInput(t *testing.T) {
9292

9393
func TestRefundUserPegOut(t *testing.T) {
9494
t.Run("should execute refund user peg out successfully", func(t *testing.T) {
95-
lbc := &mocks.LbcMock{}
95+
lbc := &mocks.LiquidityBridgeContractMock{}
9696
expectedTxHash := test.AnyHash
9797

9898
// Setup mock expectations

0 commit comments

Comments
 (0)