diff --git a/vms/evm/subscriber_test.go b/vms/evm/subscriber_test.go new file mode 100644 index 00000000..75293903 --- /dev/null +++ b/vms/evm/subscriber_test.go @@ -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) +}