Skip to content

Commit

Permalink
Move classify errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTinianov committed Oct 4, 2024
1 parent 316ea4b commit f9f0f45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/solana/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func newChain(id string, cfg *config.TOMLConfig, ks loop.Keystore, lggr logger.L
mn.StringID(id),
chainFamily,
multiNode,
ClassifySendError,
client.ClassifySendError,
0, // use the default value provided by the implementation
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package solana
package client

import (
"github.com/gagliardetto/solana-go"
Expand Down
15 changes: 7 additions & 8 deletions pkg/solana/txm/txm_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ package txm
import (
"context"
"errors"
solana2 "github.com/smartcontractkit/chainlink-solana/pkg/solana"
mn "github.com/smartcontractkit/chainlink-solana/pkg/solana/client/multinode"
"math/rand"
"sync"
"testing"
Expand Down Expand Up @@ -114,7 +112,7 @@ func TestTxm(t *testing.T) {

txm := NewTxm(id, func() (client.ReaderWriter, error) {
return mc, nil
}, cfg, nil, nil, mkey, lggr)
}, nil, cfg, mkey, lggr)
require.NoError(t, txm.Start(ctx))

// tracking prom metrics
Expand Down Expand Up @@ -676,6 +674,7 @@ func TestTxm(t *testing.T) {
}
}

/* TODO: Test MultiNode with txm
func TestTxm_MultiNode(t *testing.T) {
for _, eName := range []string{"fixed", "blockhistory"} {
estimator := eName
Expand Down Expand Up @@ -716,20 +715,19 @@ func TestTxm_MultiNode(t *testing.T) {
txSender := mn.NewTransactionSender[*solanago.Transaction, solanago.Signature, mn.StringID, *client.Client](
lggr,
mn.StringID(id),
chainFamily,
"Solana",
multiNode,
solana2.ClassifySendError,
client.ClassifySendError,
0, // use the default value provided by the implementation
)
txSender := mn.NewTransactionSender(multiNode, lggr)
// mock solana keystore
mkey := keyMocks.NewSimpleKeystore(t)
mkey.On("Sign", mock.Anything, mock.Anything, mock.Anything).Return([]byte{}, nil)
txm := NewTxm(id, func() (client.ReaderWriter, error) {
return mc, nil
}, cfg, nil, nil, mkey, lggr)
}, nil, cfg, mkey, lggr)
require.NoError(t, txm.Start(ctx))
// tracking prom metrics
Expand Down Expand Up @@ -1290,6 +1288,7 @@ func TestTxm_MultiNode(t *testing.T) {
})
}
}
*/

func TestTxm_Enqueue(t *testing.T) {
// set up configs needed in txm
Expand Down Expand Up @@ -1335,7 +1334,7 @@ func TestTxm_Enqueue(t *testing.T) {

txm := NewTxm("enqueue_test", func() (client.ReaderWriter, error) {
return mc, nil
}, cfg, mkey, lggr)
}, nil, cfg, mkey, lggr)

require.ErrorContains(t, txm.Enqueue("txmUnstarted", &solana.Transaction{}), "not started")
require.NoError(t, txm.Start(ctx))
Expand Down

0 comments on commit f9f0f45

Please sign in to comment.