Skip to content

Commit

Permalink
chore: appease linters
Browse files Browse the repository at this point in the history
  • Loading branch information
johnletey committed Oct 24, 2024
1 parent 071fe58 commit 0daa546
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ abigen --abi ethereum/abi/MessageTransmitter.json --pkg contracts- --type Messag
### Useful links
[Relayer Flow Charts](./docs/flows.md)

[USDC faucet](https://usdcfaucet.com/)
[USDC faucet](https://faucet.circle.com)

[Circle Docs/Contract Addresses](https://developers.circle.com/stablecoins/docs/evm-smart-contracts)
2 changes: 1 addition & 1 deletion solana/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package solana
import "github.com/strangelove-ventures/noble-cctp-relayer/types"

// TODO: Uncomment this once the full interface is implemented!
//var _ types.Chain = (*Solana)(nil)
// var _ types.Chain = (*Solana)(nil)

type Solana struct{}

Expand Down
9 changes: 7 additions & 2 deletions solana/listener.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package solana

import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"strings"

"github.com/cosmos/btcutil/base58"
"github.com/gagliardetto/solana-go"
"github.com/google/uuid"

"github.com/cosmos/btcutil/base58"

"github.com/strangelove-ventures/noble-cctp-relayer/solana/generated/message_transmitter"
)

Expand Down Expand Up @@ -45,7 +48,8 @@ type Transaction struct {
func (s *Solana) NewTransactionRequest(endpoint string, hash string) (*http.Request, error) {
data := fmt.Sprintf(`{"method":"getTransaction","jsonrpc":"2.0","params":["%s",{"encoding":"jsonParsed","commitment":"confirmed","maxSupportedTransactionVersion":0}],"id":"%s"}`, hash, uuid.New().String())

return http.NewRequest("POST", endpoint, strings.NewReader(data))
// TODO: Receive the context from the main listener!
return http.NewRequestWithContext(context.Background(), http.MethodPost, endpoint, strings.NewReader(data))
}

// ParseTransaction is a utility that fetches a transaction from the Solana RPC
Expand All @@ -59,6 +63,7 @@ func (s *Solana) ParseTransaction(endpoint string, hash string) (events []messag
if err != nil {
return nil, err
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion solana/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package solana_test
import (
"testing"

"github.com/strangelove-ventures/noble-cctp-relayer/solana"
"github.com/stretchr/testify/require"

"github.com/strangelove-ventures/noble-cctp-relayer/solana"
)

// TestParseTransaction tests the transaction parsing utility used by the relayer.
Expand Down

0 comments on commit 0daa546

Please sign in to comment.