Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chains/lighter/message/lighter.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (h *LighterMessageHandler) calldata(tx *lighter.LighterTx, borrowAmount *bi
return consts.LighterABI.Pack(
"withdraw",
common.HexToHash(tx.Hash),
common.HexToAddress(tx.L1Address),
common.BytesToAddress(tx.Transfer.Memo[:20]),
borrowAmount)
}

Expand Down
4 changes: 4 additions & 0 deletions chains/lighter/message/lighter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func (s *LighterMessageHandlerTestSuite) Test_HandleMessage_ValidMessage() {
Transfer: &lighter.Transfer{
USDCAmount: 2000000,
ToAccountIndex: 3,
Memo: []byte{238, 123, 250, 212, 202, 237, 62, 98, 106, 248, 169, 199, 213, 3, 76, 213, 137, 238, 73, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
}, nil)

Expand Down Expand Up @@ -137,6 +138,7 @@ func (s *LighterMessageHandlerTestSuite) Test_HandleMessage_InvalidTxType() {
Transfer: &lighter.Transfer{
USDCAmount: 2000000,
ToAccountIndex: 3,
Memo: []byte{238, 123, 250, 212, 202, 237, 62, 98, 106, 248, 169, 199, 213, 3, 76, 213, 137, 238, 73, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
}, nil)

Expand Down Expand Up @@ -179,6 +181,7 @@ func (s *LighterMessageHandlerTestSuite) Test_HandleMessage_InvalidAccount() {
Transfer: &lighter.Transfer{
USDCAmount: 2000000,
ToAccountIndex: 5,
Memo: []byte{238, 123, 250, 212, 202, 237, 62, 98, 106, 248, 169, 199, 213, 3, 76, 213, 137, 238, 73, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
}, nil)

Expand Down Expand Up @@ -258,6 +261,7 @@ func (s *LighterMessageHandlerTestSuite) Test_HandleMessage_BorrowAmountTooHigh(
Transfer: &lighter.Transfer{
USDCAmount: 2000000,
ToAccountIndex: 3,
Memo: []byte{238, 123, 250, 212, 202, 237, 62, 98, 106, 248, 169, 199, 213, 3, 76, 213, 137, 238, 73, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
}, nil)

Expand Down
1 change: 1 addition & 0 deletions protocol/lighter/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Transfer struct {
FromAccountIndex uint64
ToAccountIndex int
Fee uint64
Memo []byte
}

type LighterTx struct {
Expand Down
Loading