Skip to content

Commit 5cddb59

Browse files
authored
fix: use deadline from sprinter-api on lighter (#94)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> ## 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: #<issue> ## 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 269976d commit 5cddb59

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

api/handlers/signing.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type SigningBody struct {
3737
DepositTxHash string `json:"depositTxHash"`
3838
BorrowAmount *BigInt `json:"borrowAmount"`
3939
RepaymentChainId uint64 `json:"repaymentChainId"`
40+
Deadline uint64 `json:"deadline"`
4041
}
4142

4243
type SigningHandler struct {

chains/lighter/message/lighter.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"math/big"
99
"strconv"
10-
"time"
1110

1211
"github.com/ethereum/go-ethereum/common"
1312
"github.com/libp2p/go-libp2p/core/host"
@@ -26,7 +25,6 @@ import (
2625

2726
var (
2827
ARBITRUM_CHAIN_ID = big.NewInt(42161)
29-
FILL_DEADLINE = time.Minute * 5
3028
)
3129

3230
type Coordinator interface {
@@ -109,8 +107,7 @@ func (h *LighterMessageHandler) HandleMessage(m *message.Message) (*proposal.Pro
109107
h.usdcAddress,
110108
ARBITRUM_CHAIN_ID,
111109
h.lighterAddress,
112-
//nolint:gosec
113-
uint64(time.Now().Add(FILL_DEADLINE).Unix()),
110+
data.Deadline,
114111
data.Caller,
115112
data.LiquidityPool,
116113
data.Nonce)

chains/lighter/message/message.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type LighterData struct {
2121
Calldata string
2222
Nonce *big.Int
2323
BorrowAmount *big.Int
24+
Deadline uint64
2425
Source uint64
2526
Destination uint64
2627
}

0 commit comments

Comments
 (0)