Skip to content

Commit f2a7cf2

Browse files
fix proposal feeabs struct (#164)
1 parent d1eb119 commit f2a7cf2

File tree

11 files changed

+33
-14
lines changed

11 files changed

+33
-14
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ test:
9999
docker-build-debug:
100100
@DOCKER_BUILDKIT=1 docker build -t feeapp:debug -f Dockerfile .
101101

102+
docker-build-debug-no-cache:
103+
@DOCKER_BUILDKIT=1 docker build -t feeapp:debug -f Dockerfile --no-cache .
104+
102105
lint:
103106
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run mvdan.cc/gofumpt -w .
104107
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run github.com/client9/misspell/cmd/misspell -w

scripts/host_zone_gaia.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ibc_denom": "ibc/9117A26BA81E29FA4F78F57DC2BD90CD3D26848101BA880445F119B22A1E254E",
77
"osmosis_pool_token_denom_in": "ibc/9117A26BA81E29FA4F78F57DC2BD90CD3D26848101BA880445F119B22A1E254E",
88
"pool_id": "1",
9-
"frozen": false
9+
"status": 0
1010
},
1111
"deposit": "100000000stake"
1212
}

tests/integration/cosmoshub/proposals/add_host_zone.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ibc_denom": "ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5",
66
"osmosis_pool_token_denom_in": "uosmo",
77
"pool_id": "408",
8-
"frozen": false
8+
"status": 0
99
},
1010
"deposit": "100000000uatom"
1111
}

tests/integration/cosmoshub/proposals/set_host_zone.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ibc_denom": "ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5",
66
"osmosis_pool_token_denom_in": "uosmo",
77
"pool_id": "408",
8-
"frozen": false
8+
"status": 0
99
},
1010
"deposit": "100000000uatom"
1111
}

tests/integration/stargaze/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,19 @@ proposal.json
148148
"ibc_denom": "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518",
149149
"osmosis_pool_token_denom_in": "uosmo",
150150
"pool_id": "404",
151-
"frozen": false
151+
"status": 0
152152
},
153153
"deposit": "100000000ustars"
154154
}
155155
}
156156
```
157157

158+
"status" field indicates fee abstraction connection status to host zone:
159+
* 0: UPDADTED
160+
* 1: OUTDATED
161+
* 2: FROZEN
162+
163+
158164
```bash
159165
starsd tx gov submit-legacy-proposal add-hostzone-config proposal.json --from investor
160166
starsd tx gov vote 2 yes --from investor

tests/interchaintest/feeabs/types.go

+14-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ type HostChainFeeAbsConfigResponse struct {
44
HostChainConfig HostChainFeeAbsConfig `json:"host_chain_config"`
55
}
66

7+
const (
8+
HostChainFeeAbsStatus_UPDATED string = "UPDATED"
9+
HostChainFeeAbsStatus_OUTDATED string = "OUTDATED"
10+
HostChainFeeAbsStatus_FROZEN string = "FROZEN"
11+
)
12+
713
type HostChainFeeAbsConfig struct {
8-
IbcDenom string `json:"ibc_denom"`
9-
OsmosisPoolTokenDenomIn string `json:"osmosis_pool_token_denom_in"`
10-
PoolId string `json:"pool_id"`
11-
Frozen bool `json:"frozen"`
14+
// ibc token is allowed to be used as fee token
15+
IbcDenom string `protobuf:"bytes,1,opt,name=ibc_denom,json=ibcDenom,proto3" json:"ibc_denom,omitempty" yaml:"allowed_token"`
16+
// token_in in cross_chain swap contract.
17+
OsmosisPoolTokenDenomIn string `protobuf:"bytes,2,opt,name=osmosis_pool_token_denom_in,json=osmosisPoolTokenDenomIn,proto3" json:"osmosis_pool_token_denom_in,omitempty"`
18+
// pool id
19+
PoolId string `protobuf:"varint,3,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
20+
// Host chain fee abstraction connection status
21+
Status string `protobuf:"varint,4,opt,name=status,proto3,enum=feeabstraction.feeabs.v1beta1.HostChainFeeAbsStatus" json:"status,omitempty"`
1222
}

tests/interchaintest/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/cosmos/cosmos-sdk v0.47.8
88
github.com/cosmos/ibc-go/v7 v7.3.1
99
github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845
10-
github.com/osmosis-labs/fee-abstraction/v7 v7.0.0-00010101000000-000000000000
10+
github.com/osmosis-labs/fee-abstraction/v7 v7.0.0-20240308160138-d1eb119cae30
1111
github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230721183422-fb937bb0e165
1212
github.com/stretchr/testify v1.8.4
1313
go.uber.org/zap v1.26.0

tests/interchaintest/host_zone_proposal_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestHostZoneProposal(t *testing.T) {
4141
IbcDenom: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
4242
OsmosisPoolTokenDenomIn: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
4343
PoolId: "1",
44-
Frozen: false,
44+
Status: feeabsCli.HostChainFeeAbsStatus_UPDATED,
4545
}})
4646

4747
// Start testing for set host zone proposal
@@ -63,7 +63,7 @@ func TestHostZoneProposal(t *testing.T) {
6363
IbcDenom: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
6464
OsmosisPoolTokenDenomIn: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
6565
PoolId: "1",
66-
Frozen: true,
66+
Status: feeabsCli.HostChainFeeAbsStatus_FROZEN,
6767
}})
6868

6969
// Start testing for delete host zone proposal

tests/interchaintest/proposal/add_host_zone.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ibc_denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
77
"osmosis_pool_token_denom_in": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
88
"pool_id": "1",
9-
"frozen": false
9+
"status": 0
1010
},
1111
"deposit": "100000000stake"
1212
}

tests/interchaintest/proposal/set_host_zone.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ibc_denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
77
"osmosis_pool_token_denom_in": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
88
"pool_id": "1",
9-
"frozen": true
9+
"status": 2
1010
},
1111
"deposit": "100000000stake"
1212
}

tests/interchaintest/testnet/proposal/add_host_zone.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ibc_denom": "ibc/1C812795FFE318D29581174B1A04CD6F242E1A3DA504E98D7EDD339B1AF00466",
66
"osmosis_pool_token_denom_in": "ibc/1C812795FFE318D29581174B1A04CD6F242E1A3DA504E98D7EDD339B1AF00466",
77
"pool_id": "1",
8-
"frozen": false
8+
"status": 0
99
},
1010
"deposit": "100000000stake"
1111
}

0 commit comments

Comments
 (0)