Skip to content

Commit

Permalink
working draft of subscriber test
Browse files Browse the repository at this point in the history
  • Loading branch information
feuGeneA committed Nov 14, 2023
1 parent 96b8afe commit 2aeb418
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions vms/evm/subscriber_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package evm

import (
"os"
"testing"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/logging"
"github.com/ava-labs/awm-relayer/config"
"github.com/ava-labs/awm-relayer/database"
)

func TestIt(t *testing.T) {
sourceSubnet := config.SourceSubnet{
SubnetID: "2TGBXcnwx5PqiXWiqxAKUaNSqDguXNh1mxnp82jui68hxJSZAx",
ChainID: "S4mMqUXe7vHsGiRAma6bv3CKnyaLssyAxmQ2KvFpX1KEvfFCD",
VM: config.EVM.String(),
APINodeHost: "127.0.0.1",
APINodePort: 9650,
EncryptConnection: false,
RPCEndpoint: "https://subnets.avax.network/mysubnet/rpc",
}

logger := logging.NewLogger(
"awm-relayer-test",
logging.NewWrappedCore(
logging.Info,
os.Stdout,
logging.JSON.ConsoleEncoder(),
),
)

subnetId, err := ids.FromString(sourceSubnet.ChainId)
if err != nil {
t.Fatalf("Failed to create subnet ID")
}

db, err := database.NewJSONFileStorage(logger, t.TempDir(), []ids.ID{subnetId})
if err != nil {
t.Fatalf("Failed to create JSON file storage")
}

subscriber := subscriber.NewSubscriber(logger, sourceSubnet, db)
}

0 comments on commit 2aeb418

Please sign in to comment.