@agoric/cosmos 0.34.2-dev-70d05b1.0.70d05b1 → 0.34.2-dev-4ea2a82.0.4ea2a82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +1 -0
- package/ante/ante.go +2 -2
- package/app/app.go +73 -96
- package/app/sim_test.go +0 -2
- package/app/upgrade.go +6 -6
- package/daemon/cmd/root_test.go +1 -0
- package/git-revision.txt +1 -1
- package/go.mod +83 -116
- package/go.sum +162 -130
- package/go.work +39 -0
- package/go.work.sum +2636 -0
- package/package.json +2 -2
- package/proto/Dockerfile +14 -0
- package/proto/agoric/swingset/msgs.proto +1 -0
- package/proto/agoric/vbank/msgs.proto +5 -1
- package/proto/agoric/vibc/msgs.proto +45 -2
- package/scripts/protocgen.sh +10 -1
- package/tests/integrations/types/aminojson_test.go +18 -2
- package/third_party/proto/cosmos/base/query/v1beta1/pagination.proto +2 -3
- package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +2 -3
- package/third_party/proto/ibc/core/channel/v1/channel.proto +6 -22
- package/third_party/proto/ibc/core/client/v1/client.proto +6 -53
- package/types/address_hooks.go +2 -2
- package/types/address_hooks_test.go +3 -3
- package/types/ibc_packet.go +3 -3
- package/types/ibc_packet_test.go +3 -3
- package/x/swingset/types/msgs.pb.go +90 -89
- package/x/vbank/types/msgs.pb.go +10 -8
- package/x/vibc/alias.go +0 -1
- package/x/vibc/keeper/dynamic_router.go +176 -0
- package/x/vibc/keeper/dynamic_router_test.go +240 -0
- package/x/vibc/keeper/keeper.go +40 -81
- package/x/vibc/keeper/migrations.go +1 -1
- package/x/vibc/keeper/scope.go +114 -0
- package/x/vibc/keeper/triggers.go +8 -4
- package/x/vibc/types/expected_keepers.go +7 -20
- package/x/vibc/types/ibc_module.go +13 -20
- package/x/vibc/types/msgs.go +60 -3
- package/x/vibc/types/msgs.pb.go +683 -31
- package/x/vibc/types/receiver.go +2 -2
- package/x/vlocalchain/vlocalchain_test.go +1 -1
- package/x/vtransfer/ibc_middleware.go +15 -17
- package/x/vtransfer/ibc_middleware_test.go +30 -53
- package/x/vtransfer/keeper/keeper.go +19 -28
- package/x/vtransfer/types/expected_keepers.go +15 -8
- package/x/vtransfer/utils_test.go +4 -9
|
@@ -6,6 +6,10 @@ package types
|
|
|
6
6
|
import (
|
|
7
7
|
context "context"
|
|
8
8
|
fmt "fmt"
|
|
9
|
+
io "io"
|
|
10
|
+
math "math"
|
|
11
|
+
math_bits "math/bits"
|
|
12
|
+
|
|
9
13
|
_ "github.com/cosmos/cosmos-proto"
|
|
10
14
|
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
|
11
15
|
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
|
@@ -16,9 +20,6 @@ import (
|
|
|
16
20
|
grpc "google.golang.org/grpc"
|
|
17
21
|
codes "google.golang.org/grpc/codes"
|
|
18
22
|
status "google.golang.org/grpc/status"
|
|
19
|
-
io "io"
|
|
20
|
-
math "math"
|
|
21
|
-
math_bits "math/bits"
|
|
22
23
|
)
|
|
23
24
|
|
|
24
25
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
@@ -828,92 +829,92 @@ func init() {
|
|
|
828
829
|
func init() { proto.RegisterFile("agoric/swingset/msgs.proto", fileDescriptor_788baa062b181a57) }
|
|
829
830
|
|
|
830
831
|
var fileDescriptor_788baa062b181a57 = []byte{
|
|
831
|
-
//
|
|
832
|
-
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x6c, 0x1b,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
0x56,
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
0x00, 0x00,
|
|
832
|
+
// 1350 bytes of a gzipped FileDescriptorProto
|
|
833
|
+
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4d, 0x6c, 0x1b, 0x45,
|
|
834
|
+
0x14, 0xce, 0xd6, 0x49, 0x5a, 0x8f, 0xdd, 0x26, 0xde, 0x94, 0xc4, 0xd9, 0x16, 0x8f, 0xbb, 0xa5,
|
|
835
|
+
0x92, 0x1b, 0x1a, 0x5b, 0x84, 0x0a, 0x21, 0x97, 0x03, 0xd9, 0x96, 0x1f, 0x0b, 0xa5, 0x2a, 0x1b,
|
|
836
|
+
0x55, 0xa0, 0xa2, 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|
857
|
+
0x59, 0xba, 0xb1, 0xa3, 0xe9, 0x14, 0x52, 0xd3, 0x25, 0xda, 0xf5, 0x3f, 0xbf, 0x86, 0x13, 0x0f,
|
|
858
|
+
0x0f, 0x76, 0x97, 0x16, 0xf8, 0x79, 0x0c, 0xef, 0xbc, 0x7c, 0x06, 0x2c, 0x8e, 0x1c, 0x87, 0x8a,
|
|
859
|
+
0x70, 0xd7, 0xf7, 0x30, 0x92, 0xbf, 0x17, 0xc0, 0xcc, 0x1a, 0xb6, 0xde, 0xd1, 0x1d, 0x07, 0x85,
|
|
860
|
+
0xab, 0x46, 0x68, 0xfb, 0x9e, 0x88, 0xc1, 0x94, 0xbf, 0xed, 0xa1, 0xa0, 0x2a, 0x10, 0x4e, 0xb7,
|
|
861
|
+
0xfb, 0x11, 0xa4, 0xc0, 0x20, 0x82, 0x65, 0xca, 0x87, 0x88, 0x4f, 0x87, 0x0b, 0x75, 0x2d, 0xce,
|
|
862
|
+
0x83, 0x69, 0x9d, 0x2c, 0x5f, 0x3d, 0x56, 0x17, 0x1a, 0x45, 0x95, 0x49, 0xed, 0x5a, 0xc2, 0xef,
|
|
863
|
+
0x19, 0xce, 0x2f, 0x1b, 0xac, 0xbc, 0x08, 0x16, 0x72, 0xf1, 0x73, 0x6e, 0x3f, 0x0b, 0xe0, 0x34,
|
|
864
|
+
0xd7, 0xad, 0x77, 0x91, 0x67, 0x1e, 0x25, 0xc1, 0x73, 0xa0, 0x8c, 0xe3, 0x18, 0xb4, 0x21, 0x9a,
|
|
865
|
+
0x25, 0x9c, 0xc6, 0xd5, 0x3e, 0x9f, 0x70, 0x95, 0x72, 0x5c, 0x33, 0xc1, 0xcb, 0x35, 0x70, 0x76,
|
|
866
|
+
0x1c, 0x29, 0xce, 0xfa, 0xaf, 0x02, 0x28, 0xaf, 0x61, 0xeb, 0x46, 0xe0, 0x6f, 0xd9, 0x38, 0x66,
|
|
867
|
+
0x7b, 0x05, 0x9c, 0xf0, 0x6c, 0x63, 0xd3, 0xd3, 0x5d, 0x44, 0x08, 0x17, 0x15, 0x18, 0x57, 0x5e,
|
|
868
|
+
0x82, 0xa5, 0x95, 0x97, 0x20, 0xb2, 0xca, 0x95, 0xe2, 0x07, 0xe0, 0x38, 0xe3, 0x41, 0x02, 0x2e,
|
|
869
|
+
0x2b, 0x7a, 0x3f, 0x82, 0x09, 0x34, 0x88, 0xe0, 0x29, 0x56, 0x1a, 0x14, 0x78, 0x3a, 0x1b, 0x96,
|
|
870
|
+
0xb8, 0x17, 0x3f, 0x04, 0xa5, 0xae, 0xbf, 0x8d, 0x02, 0xed, 0x8e, 0xa3, 0x5b, 0xb8, 0x5a, 0x20,
|
|
871
|
+
0x6d, 0xe3, 0xf6, 0x5e, 0x04, 0xc1, 0x8d, 0x18, 0x7e, 0x3d, 0x46, 0xfb, 0x11, 0x04, 0x5d, 0x2e,
|
|
872
|
+
0x0d, 0x22, 0x58, 0xa1, 0x11, 0xa5, 0xd8, 0x63, 0x4b, 0xff, 0x9b, 0x83, 0xdd, 0xa5, 0xcc, 0x5c,
|
|
873
|
+
0x5a, 0xda, 0x19, 0xe0, 0x7f, 0x52, 0xe1, 0x67, 0x92, 0xac, 0x10, 0x79, 0x56, 0xf0, 0xc3, 0x95,
|
|
874
|
+
0xe7, 0x49, 0x8a, 0x73, 0x99, 0x67, 0xc1, 0xaf, 0x93, 0x60, 0x76, 0x0d, 0x5b, 0x1d, 0x0f, 0x87,
|
|
875
|
+
0xba, 0xe3, 0x28, 0x3d, 0xcf, 0x74, 0x90, 0xf8, 0x32, 0x98, 0xde, 0x20, 0x23, 0x96, 0x07, 0xf5,
|
|
876
|
+
0x7e, 0x04, 0x19, 0x32, 0x88, 0xe0, 0x49, 0x4a, 0x84, 0xca, 0xac, 0xd1, 0x31, 0x6d, 0x6e, 0x27,
|
|
877
|
+
0x8e, 0x1d, 0xcd, 0x4e, 0x88, 0x5b, 0xa0, 0x62, 0xf8, 0x6e, 0x37, 0x86, 0x91, 0xa9, 0x31,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, 0x7a,
|
|
909
|
+
0xbc, 0xd7, 0xc7, 0xcd, 0xcd, 0x5a, 0x48, 0x8d, 0xc3, 0x2c, 0xb8, 0x6f, 0x1b, 0x54, 0x46, 0x1f,
|
|
910
|
+
0xcf, 0x17, 0x1e, 0x3f, 0x3d, 0x63, 0x26, 0x2d, 0xff, 0x2b, 0xb3, 0xec, 0xde, 0xa7, 0x2f, 0xd6,
|
|
911
|
+
0xb1, 0x7b, 0xcf, 0xd5, 0xe3, 0xf7, 0x7e, 0xe4, 0x09, 0x24, 0x5e, 0x07, 0x27, 0xf8, 0xe5, 0x74,
|
|
912
|
+
0x76, 0xdc, 0x94, 0x44, 0x2b, 0x3d, 0xf7, 0x24, 0x6d, 0xe2, 0x4f, 0x9a, 0xfa, 0x28, 0xbe, 0xc1,
|
|
913
|
+
0x95, 0x9b, 0x3f, 0xee, 0xd5, 0x84, 0x47, 0x7b, 0x35, 0xe1, 0xb7, 0xbd, 0x9a, 0xf0, 0xd9, 0x7e,
|
|
914
|
+
0x6d, 0xe2, 0xd1, 0x7e, 0x6d, 0xe2, 0x97, 0xfd, 0xda, 0xc4, 0xad, 0x2b, 0x99, 0x7e, 0xb4, 0x4a,
|
|
915
|
+
0xbf, 0x91, 0xa9, 0x5f, 0xd2, 0x8f, 0x2c, 0xdf, 0xd1, 0x3d, 0x2b, 0x69, 0x54, 0x99, 0xdb, 0x86,
|
|
916
|
+
0x34, 0xaa, 0x8d, 0x69, 0xf2, 0xf1, 0xfc, 0xe2, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x43,
|
|
917
|
+
0x34, 0x23, 0xe8, 0x0f, 0x00, 0x00,
|
|
917
918
|
}
|
|
918
919
|
|
|
919
920
|
// Reference imports to suppress errors if they are not otherwise used.
|
package/x/vbank/types/msgs.pb.go
CHANGED
|
@@ -6,6 +6,7 @@ package types
|
|
|
6
6
|
import (
|
|
7
7
|
context "context"
|
|
8
8
|
fmt "fmt"
|
|
9
|
+
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
|
9
10
|
grpc1 "github.com/cosmos/gogoproto/grpc"
|
|
10
11
|
proto "github.com/cosmos/gogoproto/proto"
|
|
11
12
|
grpc "google.golang.org/grpc"
|
|
@@ -26,16 +27,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
26
27
|
func init() { proto.RegisterFile("agoric/vbank/msgs.proto", fileDescriptor_4f9d0954f3583404) }
|
|
27
28
|
|
|
28
29
|
var fileDescriptor_4f9d0954f3583404 = []byte{
|
|
29
|
-
//
|
|
30
|
+
// 160 bytes of a gzipped FileDescriptorProto
|
|
30
31
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0x4c, 0xcf, 0x2f,
|
|
31
32
|
0xca, 0x4c, 0xd6, 0x2f, 0x4b, 0x4a, 0xcc, 0xcb, 0xd6, 0xcf, 0x2d, 0x4e, 0x2f, 0xd6, 0x2b, 0x28,
|
|
32
|
-
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x48, 0xe8, 0x81, 0x25,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x48, 0xe8, 0x81, 0x25, 0xa4, 0xc4, 0x93, 0xf3, 0x8b, 0x73,
|
|
34
|
+
0xf3, 0x8b, 0x41, 0x0a, 0xf4, 0xcb, 0x0c, 0x41, 0x14, 0x44, 0x99, 0x11, 0x0f, 0x17, 0xb3, 0x6f,
|
|
35
|
+
0x71, 0xba, 0x14, 0x6b, 0xc3, 0xf3, 0x0d, 0x5a, 0x8c, 0x4e, 0x41, 0x27, 0x1e, 0xc9, 0x31, 0x5e,
|
|
36
|
+
0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31,
|
|
37
|
+
0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f,
|
|
38
|
+
0xab, 0xef, 0x08, 0xb1, 0x12, 0x62, 0x81, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x7a, 0x7e, 0x4e, 0x62,
|
|
39
|
+
0x5e, 0xba, 0x3e, 0xd4, 0x92, 0x0a, 0xa8, 0x6b, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0,
|
|
40
|
+
0x16, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x8b, 0x6a, 0x41, 0xaa, 0x00, 0x00, 0x00,
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
// Reference imports to suppress errors if they are not otherwise used.
|
package/x/vibc/alias.go
CHANGED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
package keeper
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"fmt"
|
|
5
|
+
"slices"
|
|
6
|
+
"strings"
|
|
7
|
+
"sync"
|
|
8
|
+
|
|
9
|
+
porttypes "github.com/cosmos/ibc-go/v10/modules/core/05-port/types"
|
|
10
|
+
host "github.com/cosmos/ibc-go/v10/modules/core/24-host"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
// DynamicPortRouter wraps a static ibc-go router and adds runtime exact port
|
|
14
|
+
// bindings for SwingSet-managed IBC ports.
|
|
15
|
+
|
|
16
|
+
// The minimum length of a port identifier is 2 characters, so we can safely
|
|
17
|
+
// validate legacy prefix routes by padding them with "a"s up to the minimum
|
|
18
|
+
// length and using the existing port identifier validator.
|
|
19
|
+
const PortIdentifierMinLength = 2
|
|
20
|
+
|
|
21
|
+
type DynamicPortRouter struct {
|
|
22
|
+
base porttypes.PortRouter
|
|
23
|
+
|
|
24
|
+
mu sync.RWMutex
|
|
25
|
+
sealed bool
|
|
26
|
+
dynamic map[string]porttypes.IBCModule
|
|
27
|
+
legacy map[string]porttypes.IBCModule
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var _ porttypes.PortRouter = (*DynamicPortRouter)(nil)
|
|
31
|
+
|
|
32
|
+
func NewDynamicPortRouter(base porttypes.PortRouter) *DynamicPortRouter {
|
|
33
|
+
return &DynamicPortRouter{
|
|
34
|
+
base: base,
|
|
35
|
+
dynamic: map[string]porttypes.IBCModule{},
|
|
36
|
+
legacy: map[string]porttypes.IBCModule{},
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
func (r *DynamicPortRouter) AddLegacyPrefixRoute(prefix string, module porttypes.IBCModule) {
|
|
41
|
+
paddedPrefix := prefix + strings.Repeat("a", max(PortIdentifierMinLength-len(prefix), 0))
|
|
42
|
+
if err := host.PortIdentifierValidator(paddedPrefix); err != nil {
|
|
43
|
+
panic(fmt.Errorf("invalid port identifier %s: %s", prefix, err))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
r.mu.Lock()
|
|
47
|
+
defer r.mu.Unlock()
|
|
48
|
+
|
|
49
|
+
if r.sealed {
|
|
50
|
+
panic(fmt.Errorf("router sealed; cannot register %s route callbacks", prefix))
|
|
51
|
+
}
|
|
52
|
+
if module == nil {
|
|
53
|
+
panic(fmt.Errorf("module for prefix %s is nil", prefix))
|
|
54
|
+
}
|
|
55
|
+
if _, ok := r.legacy[prefix]; ok {
|
|
56
|
+
panic(fmt.Errorf("route %s has already been registered", prefix))
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
r.legacy[prefix] = module
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
func (r *DynamicPortRouter) BindPort(portID string, module porttypes.IBCModule) error {
|
|
63
|
+
if err := host.PortIdentifierValidator(portID); err != nil {
|
|
64
|
+
return err
|
|
65
|
+
}
|
|
66
|
+
if module == nil {
|
|
67
|
+
return fmt.Errorf("module for port %s is nil", portID)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
r.mu.Lock()
|
|
71
|
+
defer r.mu.Unlock()
|
|
72
|
+
|
|
73
|
+
if _, ok := r.dynamic[portID]; ok {
|
|
74
|
+
return fmt.Errorf("port %s is already dynamically bound", portID)
|
|
75
|
+
}
|
|
76
|
+
if r.base.HasRoute(portID) {
|
|
77
|
+
return fmt.Errorf("port %s collides with an existing static route", portID)
|
|
78
|
+
}
|
|
79
|
+
if route, ok := r.matchBasePrefixLocked(portID); ok && route != module {
|
|
80
|
+
return fmt.Errorf("port %s collides with an existing static route", portID)
|
|
81
|
+
}
|
|
82
|
+
if route, ok := r.matchLegacyPrefixLocked(portID); ok && route != module {
|
|
83
|
+
return fmt.Errorf("port %s collides with an existing static route", portID)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
r.dynamic[portID] = module
|
|
87
|
+
return nil
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
func (r *DynamicPortRouter) RevokePort(portID string) error {
|
|
91
|
+
r.mu.Lock()
|
|
92
|
+
defer r.mu.Unlock()
|
|
93
|
+
|
|
94
|
+
if _, ok := r.dynamic[portID]; !ok {
|
|
95
|
+
return fmt.Errorf("port %s is not dynamically bound", portID)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
delete(r.dynamic, portID)
|
|
99
|
+
return nil
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
func (r *DynamicPortRouter) Route(portID string) (porttypes.IBCModule, bool) {
|
|
103
|
+
r.mu.RLock()
|
|
104
|
+
defer r.mu.RUnlock()
|
|
105
|
+
|
|
106
|
+
if route, ok := r.dynamic[portID]; ok {
|
|
107
|
+
return route, true
|
|
108
|
+
}
|
|
109
|
+
if route, ok := r.matchLegacyPrefixLocked(portID); ok {
|
|
110
|
+
return route, true
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return r.base.Route(portID)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
func (r *DynamicPortRouter) HasRoute(portID string) bool {
|
|
117
|
+
r.mu.RLock()
|
|
118
|
+
defer r.mu.RUnlock()
|
|
119
|
+
|
|
120
|
+
if _, ok := r.dynamic[portID]; ok {
|
|
121
|
+
return true
|
|
122
|
+
}
|
|
123
|
+
if _, ok := r.matchLegacyPrefixLocked(portID); ok {
|
|
124
|
+
return true
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return r.base.HasRoute(portID)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
func (r *DynamicPortRouter) Keys() []string {
|
|
131
|
+
r.mu.RLock()
|
|
132
|
+
defer r.mu.RUnlock()
|
|
133
|
+
|
|
134
|
+
keys := slices.Clone(r.base.Keys())
|
|
135
|
+
for prefix := range r.legacy {
|
|
136
|
+
keys = append(keys, prefix)
|
|
137
|
+
}
|
|
138
|
+
slices.Sort(keys)
|
|
139
|
+
return slices.Compact(keys)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
func (r *DynamicPortRouter) Seal() {
|
|
143
|
+
r.mu.Lock()
|
|
144
|
+
defer r.mu.Unlock()
|
|
145
|
+
|
|
146
|
+
if r.sealed {
|
|
147
|
+
panic("router already sealed")
|
|
148
|
+
}
|
|
149
|
+
r.base.Seal()
|
|
150
|
+
r.sealed = true
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
func (r *DynamicPortRouter) Sealed() bool {
|
|
154
|
+
r.mu.RLock()
|
|
155
|
+
defer r.mu.RUnlock()
|
|
156
|
+
|
|
157
|
+
return r.sealed
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
func (r *DynamicPortRouter) matchBasePrefixLocked(portID string) (porttypes.IBCModule, bool) {
|
|
161
|
+
for _, prefix := range r.base.Keys() {
|
|
162
|
+
if strings.Contains(portID, prefix) {
|
|
163
|
+
return r.base.Route(prefix)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return nil, false
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
func (r *DynamicPortRouter) matchLegacyPrefixLocked(portID string) (porttypes.IBCModule, bool) {
|
|
170
|
+
for prefix, module := range r.legacy {
|
|
171
|
+
if strings.HasPrefix(portID, prefix) {
|
|
172
|
+
return module, true
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return nil, false
|
|
176
|
+
}
|