@@ -43,7 +43,7 @@ type MayanMessageHandler struct {
4343 chainID uint64
4444
4545 mayanPools map [uint64 ]common.Address
46- liqudityPools map [uint64 ]common.Address
46+ liquidityPools map [uint64 ]common.Address
4747 confirmationWatcher ConfirmationWatcher
4848 tokenStore config.TokenStore
4949 mayanDecoder MayanContract
@@ -60,7 +60,7 @@ type MayanMessageHandler struct {
6060func NewMayanMessageHandler (
6161 chainID uint64 ,
6262 client EventFilterer ,
63- liqudityPools map [uint64 ]common.Address ,
63+ liquidityPools map [uint64 ]common.Address ,
6464 mayanPools map [uint64 ]common.Address ,
6565 coordinator Coordinator ,
6666 host host.Host ,
@@ -76,7 +76,7 @@ func NewMayanMessageHandler(
7676 chainID : chainID ,
7777 client : client ,
7878 mayanPools : mayanPools ,
79- liqudityPools : liqudityPools ,
79+ liquidityPools : liquidityPools ,
8080 coordinator : coordinator ,
8181 host : host ,
8282 comm : comm ,
@@ -118,14 +118,16 @@ func (h *MayanMessageHandler) HandleMessage(m *message.Message) (*proposal.Propo
118118 return nil , err
119119 }
120120
121- symbol , token , err := h .tokenStore .ConfigByAddress (h .chainID , common .BytesToAddress (msg .TokenIn [12 :]))
121+ tokenIn := common .BytesToAddress (msg .TokenIn [12 :])
122+ symbol , token , err := h .tokenStore .ConfigByAddress (h .chainID , tokenIn )
122123 if err != nil {
123124 data .ErrChn <- err
124125 return nil , err
125126 }
126127
127128 destChainId , err := mayan .WormholeToEVMChainID (msg .DestChainId )
128129 if err != nil {
130+ data .ErrChn <- err
129131 return nil , err
130132 }
131133 destinationBorrowToken , err := h .tokenStore .ConfigBySymbol (destChainId , symbol )
@@ -150,7 +152,7 @@ func (h *MayanMessageHandler) HandleMessage(m *message.Message) (*proposal.Propo
150152 context .Background (),
151153 h .chainID ,
152154 txHash ,
153- common . BytesToAddress ( msg . TokenIn [ 12 :]) ,
155+ tokenIn ,
154156 new (big.Int ).SetUint64 (msg .PromisedAmount ))
155157 if err != nil {
156158 data .ErrChn <- err
@@ -240,8 +242,6 @@ func (h *MayanMessageHandler) verifyOrder(
240242 return err
241243 }
242244
243- fmt .Printf ("%+v" , msg )
244-
245245 denormalizedAmountIn := contracts .DenormalizeAmount (new (big.Int ).SetUint64 (order .AmountIn ), tc .Decimals )
246246 if data .BorrowAmount .Cmp (denormalizedAmountIn ) != - 1 {
247247 return fmt .Errorf ("requested borrow amount more than input amount" )
@@ -263,7 +263,7 @@ func (h *MayanMessageHandler) verifyOrder(
263263 return fmt .Errorf ("invalid order status %d" , order .Status )
264264 }
265265
266- srcLiquidityPool , ok := h .liqudityPools [h .chainID ]
266+ srcLiquidityPool , ok := h .liquidityPools [h .chainID ]
267267 if ! ok {
268268 return fmt .Errorf ("no source liqudity recipient configured" )
269269 }
0 commit comments