Skip to content

Commit d2b5f20

Browse files
migrate from frozen to more generic host chain fee abs connection status (#156)
* initial migrate from frozen to more generic host chain fee abs connection status * more generic set state host zone * add code for exponential backoff, no test * add unit test * linting * allcaps * error handling --------- Co-authored-by: Jacob Gadikian <[email protected]>
1 parent b032641 commit d2b5f20

28 files changed

+742
-157
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ build-integration-binary:
148148
###############################################################################
149149
### Proto ###
150150
###############################################################################
151-
PROTO_BUILDER_IMAGE=ghcr.io/cosmos/proto-builder:0.13.5
151+
PROTO_BUILDER_IMAGE=ghcr.io/cosmos/proto-builder:0.14.0
152152

153153
proto-all: proto-format proto-gen
154154

proto/feeabstraction/feeabs/v1beta1/epoch.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,9 @@ message EpochInfo {
6262
// current_epoch_start_height is the block height at which the current epoch
6363
// started. (The block height at which the timer last ticked)
6464
int64 current_epoch_start_height = 8;
65+
}
66+
67+
message ExponentialBackoff {
68+
int64 jump = 1;
69+
int64 future_epoch = 2;
6570
}

proto/feeabstraction/feeabs/v1beta1/proposal.proto

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ import "google/api/annotations.proto";
77

88
option go_package = "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types";
99

10+
enum HostChainFeeAbsStatus {
11+
UPDATED = 0;
12+
OUTDATED = 1;
13+
FROZEN = 2;
14+
}
15+
1016
message HostChainFeeAbsConfig {
1117
// ibc token is allowed to be used as fee token
1218
string ibc_denom = 1 [ (gogoproto.moretags) = "yaml:\"allowed_token\"" ];
1319
// token_in in cross_chain swap contract.
1420
string osmosis_pool_token_denom_in = 2;
1521
// pool id
1622
uint64 pool_id = 3;
17-
// Frozen
18-
bool frozen = 4;
23+
// Host chain fee abstraction connection status
24+
HostChainFeeAbsStatus status = 4;
1925
}
2026

2127
message AddHostZoneProposal {

tests/interchaintest/feeabs/query.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"context"
55
"encoding/json"
66

7-
feeabstypes "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types"
87
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
8+
9+
feeabstypes "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types"
910
)
1011

1112
func QueryHostZoneConfigWithDenom(c *cosmos.CosmosChain, ctx context.Context, denom string) (*HostChainFeeAbsConfigResponse, error) {

tests/interchaintest/feeabs/tx.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package feeabs
22

33
import (
44
"context"
5+
56
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
67
)
78

tests/interchaintest/feeabs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import (
1010
sdktypes "github.com/cosmos/cosmos-sdk/types"
1111
paramsutils "github.com/cosmos/cosmos-sdk/x/params/client/utils"
1212
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
13-
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
1413
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
1514
"github.com/strangelove-ventures/interchaintest/v7/ibc"
1615
"github.com/strangelove-ventures/interchaintest/v7/testutil"
1716
"github.com/stretchr/testify/require"
17+
18+
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
1819
)
1920

2021
func TestFeeAbs(t *testing.T) {

tests/interchaintest/host_zone_proposal_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import (
55
"fmt"
66
"testing"
77

8-
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
98
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
109
"github.com/stretchr/testify/require"
10+
11+
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
1112
)
1213

1314
func TestHostZoneProposal(t *testing.T) {

tests/interchaintest/packet_foward_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import (
77

88
sdktypes "github.com/cosmos/cosmos-sdk/types"
99
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
10-
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
1110
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
1211
"github.com/strangelove-ventures/interchaintest/v7/testutil"
1312
"github.com/stretchr/testify/require"
13+
14+
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
1415
)
1516

1617
func TestPacketForwardMiddleware(t *testing.T) {

tests/interchaintest/query_osmosis_twap_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import (
1010
sdktypes "github.com/cosmos/cosmos-sdk/types"
1111
paramsutils "github.com/cosmos/cosmos-sdk/x/params/client/utils"
1212
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
13-
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
1413
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
1514
"github.com/strangelove-ventures/interchaintest/v7/testutil"
1615
"github.com/stretchr/testify/require"
16+
17+
feeabsCli "github.com/osmosis-labs/fee-abstraction/tests/interchaintest/feeabs"
1718
)
1819

1920
func TestQueryOsmosisTwap(t *testing.T) {
@@ -154,5 +155,5 @@ func TestQueryOsmosisTwap(t *testing.T) {
154155
twap, err := feeabsCli.QueryOsmosisArithmeticTwap(feeabs, ctx, uatomOnFeeabs)
155156
fmt.Println(err)
156157
fmt.Println(twap)
157-
//require.NoError(t, err)
158+
// require.NoError(t, err)
158159
}

tests/interchaintest/setup.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
sdktypes "github.com/cosmos/cosmos-sdk/types"
1212
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
1313
"github.com/icza/dyno"
14-
feeabstype "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types"
1514
"github.com/strangelove-ventures/interchaintest/v7"
1615
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
1716
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos/wasm"
@@ -21,6 +20,8 @@ import (
2120
"github.com/strangelove-ventures/interchaintest/v7/testutil"
2221
"github.com/stretchr/testify/require"
2322
"go.uber.org/zap/zaptest"
23+
24+
feeabstype "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types"
2425
)
2526

2627
type HasPacketForwarding struct {

0 commit comments

Comments
 (0)