From aabf1a2e07f1ca879f8372270b244345d6279c7c Mon Sep 17 00:00:00 2001
From: Sergey Prokhorov <seriy.pr@gmail.com>
Date: Wed, 4 Dec 2024 12:35:32 +0100
Subject: [PATCH] Test on OTP-26, drop pre-OTP-23; OTP-27 not compatible yet;
 fix dialyzer

---
 .github/workflows/ci.yml | 11 +++++------
 src/mtp_codec.erl        |  2 +-
 src/mtp_config.erl       |  2 +-
 src/mtp_policy_table.erl |  2 ++
 src/mtp_rpc.erl          |  2 +-
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9220d1b..1b55b21 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,15 +19,14 @@ jobs:
       matrix:
         os:
           - "ubuntu-20.04"
-        rebar3: ["3.18.0"]
+        rebar3: ["3.20.0"]
         otp:
-          - "25.1"
+          - "26.2"
+          - "25.3"
           - "24.3"
-          - "23.3"
-          - "22.3"
         include:
-          - otp: "21.3"
-            rebar3: "3.15.2"
+          - otp: "23.3"
+            rebar3: "3.18.0"
             os: "ubuntu-20.04"
     env:
       SHELL: /bin/sh            # needed for erlexec
diff --git a/src/mtp_codec.erl b/src/mtp_codec.erl
index 8ff4b69..fc86cfe 100644
--- a/src/mtp_codec.erl
+++ b/src/mtp_codec.erl
@@ -16,7 +16,7 @@
          try_decode_packet/2,
          encode_packet/2,
          fold_packets/4, fold_packets_if/4]).
--export_type([codec/0]).
+-export_type([codec/0, packet_codec/0]).
 
 -type state() :: any().
 -type crypto_codec() :: mtp_aes_cbc
diff --git a/src/mtp_config.erl b/src/mtp_config.erl
index 933724d..6d6477d 100644
--- a/src/mtp_config.erl
+++ b/src/mtp_config.erl
@@ -26,7 +26,7 @@
 %% gen_server callbacks
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
          terminate/2, code_change/3]).
--export_type([netloc_v4v6/0]).
+-export_type([dc_id/0, netloc/0, netloc_v4v6/0]).
 
 -type dc_id() :: integer().
 -type netloc() :: {inet:ip4_address(), inet:port_number()}.
diff --git a/src/mtp_policy_table.erl b/src/mtp_policy_table.erl
index f58efd8..a2bf47f 100644
--- a/src/mtp_policy_table.erl
+++ b/src/mtp_policy_table.erl
@@ -22,6 +22,8 @@
 %% gen_server callbacks
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
          terminate/2, code_change/3]).
+-export_type([sub_tab/0]).
+
 -type sub_tab() :: atom().
 -type value() :: mtp_policy:db_val().
 
diff --git a/src/mtp_rpc.erl b/src/mtp_rpc.erl
index 9562a37..7d77763 100644
--- a/src/mtp_rpc.erl
+++ b/src/mtp_rpc.erl
@@ -19,7 +19,7 @@
 %% Helpers
 -export([inet_pton/1,
          encode_ip_port/2]).
--export_type([codec/0]).
+-export_type([conn_id/0, packet/0, codec/0]).
 
 -dialyzer(no_improper_lists).