Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny committed Nov 18, 2024
1 parent 4782da4 commit 1c484e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
2 changes: 1 addition & 1 deletion pkg/solana/chainreader/bindings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ func (_m *mockBinding) CreateType(b bool) (any, error) {
return ret.Get(0), ret.Error(1)
}

func (_ *mockBinding) Decode(_ context.Context, _ []byte, _ any) error {
func (_m *mockBinding) Decode(_ context.Context, _ []byte, _ any) error {
return nil
}
47 changes: 0 additions & 47 deletions pkg/solana/chainreader/chain_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package chainreader_test

import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"math/big"
Expand Down Expand Up @@ -680,52 +679,6 @@ func (r *wrappedTestChainReader) QueryKey(_ context.Context, _ types.BoundContra
return nil, nil
}

func getAddresses(t *testing.T, tester ChainComponentsInterfaceTester[*testing.T], contractName, readName string) (ag_solana.PublicKey, ag_solana.PublicKey) {
t.Helper()

fn := ag_solana.MustPublicKeyFromBase58

var (
addresses []string
found bool
)

for _, binding := range tester.GetBindings(t) {
if binding.Name == contractName {
encoded, err := base64.StdEncoding.DecodeString(binding.Address)
if err != nil {
t.Logf("%s", err)
t.FailNow()
}

var readAddresses map[string][]string

err = json.Unmarshal(encoded, &readAddresses)
if err != nil {
t.Logf("%s", err)
t.FailNow()
}

var ok bool

addresses, ok = readAddresses[readName]
if !ok {
t.Log("no addresses found")
t.FailNow()
}

found = true
}
}

if !found {
t.Log("no addresses found")
t.FailNow()
}

return fn(addresses[0]), fn(addresses[1])
}

func (r *wrappedTestChainReader) Bind(ctx context.Context, bindings []types.BoundContract) error {
return r.service.Bind(ctx, bindings)
}
Expand Down

0 comments on commit 1c484e2

Please sign in to comment.