Skip to content

Commit 145958d

Browse files
fix!: remove rhinestone and mayan (#167)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> - removed rhinestone protocol - removed mayan protocol ## Related Issue Or Context <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Otherwise, describe context and motivation for change herre --> Closes: #147 ## How Has This Been Tested? Testing details. <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have ensured that all acceptance criteria (or expected behavior) from issue are met - [ ] I have updated the documentation locally and in docs. - [ ] I have added tests to cover my changes. - [ ] I have ensured that all the checks are passing and green, I've signed the CLA bot
1 parent 03a8d0d commit 145958d

28 files changed

Lines changed: 1 addition & 4237 deletions

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ genmocks:
3636
mockgen -destination=./comm/p2p/mock/conn/conn.go github.com/libp2p/go-libp2p/core/network Conn
3737
mockgen -destination=./comm/p2p/mock/stream/stream.go github.com/libp2p/go-libp2p/core/network Stream,Conn
3838
mockgen -source=./chains/evm/message/across.go -destination=./chains/evm/message/mock/across.go
39-
mockgen -source=./chains/evm/message/rhinestone.go -destination=./chains/evm/message/mock/rhinestone.go
4039
mockgen -source=./chains/evm/message/lifiEscrow.go -destination=./chains/evm/message/mock/lifiEscrow.go
41-
mockgen -source=./chains/evm/message/mayan.go -destination=./chains/evm/message/mock/mayan.go
4240
mockgen -source=./chains/evm/message/confirmations.go -destination=./chains/evm/message/mock/confirmations.go
4341
mockgen -source=./api/handlers/signing.go -destination=./api/handlers/mock/signing.go
4442
mockgen -package mock_message -destination=./chains/evm/message/mock/pricing.go github.com/sprintertech/lifi-solver/pkg/pricing OrderPricer

api/handlers/signing.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ type ProtocolType string
1919

2020
const (
2121
AcrossProtocol ProtocolType = "across"
22-
MayanProtocol ProtocolType = "mayan"
23-
RhinestoneProtocol ProtocolType = "rhinestone"
2422
LifiEscrowProtocol ProtocolType = "lifi-escrow"
2523
LighterProtocol ProtocolType = "lighter"
2624
SprinterCreditProtocol ProtocolType = "sprinter-credit"
@@ -91,36 +89,6 @@ func (h *SigningHandler) HandleSigning(w http.ResponseWriter, r *http.Request) {
9189
RepaymentChainID: b.RepaymentChainId,
9290
})
9391
}
94-
case MayanProtocol:
95-
{
96-
m = evmMessage.NewMayanMessage(0, b.ChainId, &evmMessage.MayanData{
97-
OrderHash: b.DepositId,
98-
Nonce: b.Nonce.Int,
99-
LiquidityPool: common.HexToAddress(b.LiquidityPool),
100-
Caller: common.HexToAddress(b.Caller),
101-
ErrChn: errChn,
102-
Calldata: b.Calldata,
103-
DepositTxHash: b.DepositTxHash,
104-
Source: 0,
105-
Destination: b.ChainId,
106-
Deadline: b.Deadline,
107-
BorrowAmount: b.BorrowAmount.Int,
108-
})
109-
}
110-
case RhinestoneProtocol:
111-
{
112-
m = evmMessage.NewRhinestoneMessage(0, b.ChainId, &evmMessage.RhinestoneData{
113-
BundleID: b.DepositId,
114-
Nonce: b.Nonce.Int,
115-
LiquidityPool: common.HexToAddress(b.LiquidityPool),
116-
Caller: common.HexToAddress(b.Caller),
117-
ErrChn: errChn,
118-
Source: 0,
119-
Destination: b.ChainId,
120-
Deadline: b.Deadline,
121-
BorrowAmount: b.BorrowAmount.Int,
122-
})
123-
}
12492
case LifiEscrowProtocol:
12593
{
12694
m = evmMessage.NewLifiEscrowMessage(0, b.ChainId, &evmMessage.LifiEscrowData{

api/handlers/signing_test.go

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -299,78 +299,6 @@ func (s *SigningHandlerTestSuite) Test_HandleSigning_AcrossSuccess() {
299299
s.Equal(http.StatusAccepted, recorder.Code)
300300
}
301301

302-
func (s *SigningHandlerTestSuite) Test_HandleSigning_MayanSuccess() {
303-
msgChn := make(chan []*message.Message)
304-
handler := handlers.NewSigningHandler(msgChn, s.chains)
305-
306-
input := handlers.SigningBody{
307-
DepositId: "1000",
308-
Protocol: "mayan",
309-
LiquidityPool: "0xbe526bA5d1ad94cC59D7A79d99A59F607d31A657",
310-
Caller: "0xbe526bA5d1ad94cC59D7A79d99A59F607d31A657",
311-
Calldata: "0xbe5",
312-
Nonce: &handlers.BigInt{big.NewInt(1001)},
313-
BorrowAmount: &handlers.BigInt{big.NewInt(1000)},
314-
//nolint:gosec
315-
Deadline: uint64(time.Now().Unix()),
316-
}
317-
body, _ := json.Marshal(input)
318-
319-
req := httptest.NewRequest(http.MethodPost, "/v1/chains/1/signatures", bytes.NewReader(body))
320-
req = mux.SetURLVars(req, map[string]string{
321-
"chainId": "1",
322-
})
323-
req.Header.Set("Content-Type", "application/json")
324-
325-
recorder := httptest.NewRecorder()
326-
327-
go func() {
328-
msg := <-msgChn
329-
ad := msg[0].Data.(*across.MayanData)
330-
ad.ErrChn <- nil
331-
}()
332-
333-
handler.HandleSigning(recorder, req)
334-
335-
s.Equal(http.StatusAccepted, recorder.Code)
336-
}
337-
338-
func (s *SigningHandlerTestSuite) Test_HandleSigning_RhinestoneSuccess() {
339-
msgChn := make(chan []*message.Message)
340-
handler := handlers.NewSigningHandler(msgChn, s.chains)
341-
342-
input := handlers.SigningBody{
343-
DepositId: "depositID",
344-
Protocol: "rhinestone",
345-
LiquidityPool: "0xbe526bA5d1ad94cC59D7A79d99A59F607d31A657",
346-
Caller: "0xbe526bA5d1ad94cC59D7A79d99A59F607d31A657",
347-
Calldata: "0xbe5",
348-
Nonce: &handlers.BigInt{big.NewInt(1001)},
349-
BorrowAmount: &handlers.BigInt{big.NewInt(1000)},
350-
//nolint:gosec
351-
Deadline: uint64(time.Now().Unix()),
352-
}
353-
body, _ := json.Marshal(input)
354-
355-
req := httptest.NewRequest(http.MethodPost, "/v1/chains/1/signatures", bytes.NewReader(body))
356-
req = mux.SetURLVars(req, map[string]string{
357-
"chainId": "1",
358-
})
359-
req.Header.Set("Content-Type", "application/json")
360-
361-
recorder := httptest.NewRecorder()
362-
363-
go func() {
364-
msg := <-msgChn
365-
ad := msg[0].Data.(*across.RhinestoneData)
366-
ad.ErrChn <- nil
367-
}()
368-
369-
handler.HandleSigning(recorder, req)
370-
371-
s.Equal(http.StatusAccepted, recorder.Code)
372-
}
373-
374302
func (s *SigningHandlerTestSuite) Test_HandleSigning_LifiSuccess() {
375303
msgChn := make(chan []*message.Message)
376304
handler := handlers.NewSigningHandler(msgChn, s.chains)

app/app.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import (
4949
"github.com/sprintertech/sprinter-signing/protocol/across"
5050
"github.com/sprintertech/sprinter-signing/protocol/lifi"
5151
lighterAPI "github.com/sprintertech/sprinter-signing/protocol/lighter"
52-
"github.com/sprintertech/sprinter-signing/protocol/mayan"
5352
"github.com/sprintertech/sprinter-signing/topology"
5453
"github.com/sprintertech/sprinter-signing/tss"
5554
coreEvm "github.com/sygmaprotocol/sygma-core/chains/evm"
@@ -170,7 +169,6 @@ func Run() error {
170169

171170
var hubPoolContract across.TokenMatcher
172171
acrossPools := make(map[uint64]common.Address)
173-
mayanPools := make(map[uint64]common.Address)
174172
lifiOutputSettlers := make(map[uint64]common.Address)
175173
repayerAddresses := make(map[uint64]common.Address)
176174
tokens := make(map[uint64]map[string]config.TokenConfig)
@@ -189,11 +187,6 @@ func Run() error {
189187
acrossPools[*c.GeneralChainConfig.Id] = poolAddress
190188
}
191189

192-
if c.MayanSwift != "" {
193-
poolAddress := common.HexToAddress(c.MayanSwift)
194-
mayanPools[*c.GeneralChainConfig.Id] = poolAddress
195-
}
196-
197190
if c.LifiOutputSettler != "" {
198191
settlerAddress := common.HexToAddress(c.LifiOutputSettler)
199192
lifiOutputSettlers[*c.GeneralChainConfig.Id] = settlerAddress
@@ -273,30 +266,6 @@ func Run() error {
273266
confirmationsPerChain[*c.GeneralChainConfig.Id] = c.ConfirmationsByValue
274267
}
275268

276-
if c.MayanSwift != "" {
277-
mayanSwiftContract := contracts.NewMayanSwiftContract(client, common.HexToAddress(c.MayanSwift))
278-
mayanApi := mayan.NewMayanExplorer()
279-
mayanMh := evmMessage.NewMayanMessageHandler(
280-
*c.GeneralChainConfig.Id,
281-
client,
282-
repayerAddresses,
283-
mayanPools,
284-
coordinator,
285-
host,
286-
communication,
287-
keyshareStore,
288-
watcher,
289-
tokenStore,
290-
mayanSwiftContract,
291-
mayanApi,
292-
sigChn)
293-
go mayanMh.Listen(ctx)
294-
295-
mh.RegisterMessageHandler(message.MessageType(comm.MayanMsg.String()), mayanMh)
296-
supportedChains[*c.GeneralChainConfig.Id] = struct{}{}
297-
confirmationsPerChain[*c.GeneralChainConfig.Id] = c.ConfirmationsByValue
298-
}
299-
300269
if c.LifiOutputSettler != "" {
301270
usdPricer := pyth.NewClient(ctx)
302271
err = usdPricer.Start(ctx)

0 commit comments

Comments
 (0)