diff --git a/api/handlers/signing.go b/api/handlers/signing.go index e7e090fa..df556e26 100644 --- a/api/handlers/signing.go +++ b/api/handlers/signing.go @@ -22,7 +22,6 @@ const ( MayanProtocol ProtocolType = "mayan" RhinestoneProtocol ProtocolType = "rhinestone" LifiEscrowProtocol ProtocolType = "lifi-escrow" - LifiProtocol ProtocolType = "lifi" LighterProtocol ProtocolType = "lighter" ) diff --git a/api/handlers/unlock.go b/api/handlers/unlock.go index 60bd0b2e..29bb64ec 100644 --- a/api/handlers/unlock.go +++ b/api/handlers/unlock.go @@ -62,7 +62,7 @@ func (h *UnlockHandler) HandleUnlock(w http.ResponseWriter, r *http.Request) { sigChn := make(chan interface{}, 1) var m *message.Message switch b.Protocol { - case LifiProtocol: + case LifiEscrowProtocol: { m = evmMessage.NewLifiUnlockMessage(0, b.ChainId, &evmMessage.LifiUnlockData{ Source: 0, diff --git a/api/handlers/unlock_test.go b/api/handlers/unlock_test.go index 76864a19..837a563e 100644 --- a/api/handlers/unlock_test.go +++ b/api/handlers/unlock_test.go @@ -38,7 +38,7 @@ func (s *UnlockHandlerTestSuite) Test_HandleUnlock_InvalidRequest() { handler := handlers.NewUnlockHandler(msgChn, s.chains) input := handlers.UnlockBody{ - Protocol: "lifi", + Protocol: "lifi-escrow", OrderID: "id", Settler: "settler", } @@ -95,7 +95,7 @@ func (s *UnlockHandlerTestSuite) Test_HandleUnlock_ValidRequest() { handler := handlers.NewUnlockHandler(msgChn, s.chains) input := handlers.UnlockBody{ - Protocol: "lifi", + Protocol: "lifi-escrow", OrderID: "id", Settler: "settler", } diff --git a/chains/evm/message/unlock.go b/chains/evm/message/unlock.go index 2bc385f7..5433b738 100644 --- a/chains/evm/message/unlock.go +++ b/chains/evm/message/unlock.go @@ -13,7 +13,6 @@ import ( "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/peer" "github.com/rs/zerolog/log" - "github.com/sprintertech/sprinter-signing/chains/evm/signature" "github.com/sprintertech/sprinter-signing/comm" "github.com/sprintertech/sprinter-signing/tss" "github.com/sprintertech/sprinter-signing/tss/ecdsa/signing" @@ -21,6 +20,11 @@ import ( "github.com/sygmaprotocol/sygma-core/relayer/proposal" ) +const ( + DOMAIN_NAME = "OIFEscrowLIFI" + VERSION = "1" +) + type LifiUnlockHandler struct { chainID uint64 @@ -158,9 +162,9 @@ func (h *LifiUnlockHandler) lifiUnlockHash(data *LifiUnlockData) ([]byte, error) }, PrimaryType: "AllowOpen", Domain: apitypes.TypedDataDomain{ - Name: signature.DOMAIN_NAME, + Name: DOMAIN_NAME, ChainId: &chainId, - Version: signature.VERSION, + Version: VERSION, VerifyingContract: data.Settler.Hex(), }, Message: msg,