Skip to content

Commit

Permalink
fix proposal feeabs struct (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
nghuyenthevinh2000 authored Mar 13, 2024
1 parent d1eb119 commit f2a7cf2
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 14 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ test:
docker-build-debug:
@DOCKER_BUILDKIT=1 docker build -t feeapp:debug -f Dockerfile .

docker-build-debug-no-cache:
@DOCKER_BUILDKIT=1 docker build -t feeapp:debug -f Dockerfile --no-cache .

lint:
@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 .
@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
Expand Down
2 changes: 1 addition & 1 deletion scripts/host_zone_gaia.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ibc_denom": "ibc/9117A26BA81E29FA4F78F57DC2BD90CD3D26848101BA880445F119B22A1E254E",
"osmosis_pool_token_denom_in": "ibc/9117A26BA81E29FA4F78F57DC2BD90CD3D26848101BA880445F119B22A1E254E",
"pool_id": "1",
"frozen": false
"status": 0
},
"deposit": "100000000stake"
}
2 changes: 1 addition & 1 deletion tests/integration/cosmoshub/proposals/add_host_zone.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ibc_denom": "ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5",
"osmosis_pool_token_denom_in": "uosmo",
"pool_id": "408",
"frozen": false
"status": 0
},
"deposit": "100000000uatom"
}
2 changes: 1 addition & 1 deletion tests/integration/cosmoshub/proposals/set_host_zone.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ibc_denom": "ibc/80C64E7EB7E8B6705FC9C1D9C486EB6278823068D9224915B6A5DABDF03FB2D5",
"osmosis_pool_token_denom_in": "uosmo",
"pool_id": "408",
"frozen": false
"status": 0
},
"deposit": "100000000uatom"
}
8 changes: 7 additions & 1 deletion tests/integration/stargaze/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,19 @@ proposal.json
"ibc_denom": "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518",
"osmosis_pool_token_denom_in": "uosmo",
"pool_id": "404",
"frozen": false
"status": 0
},
"deposit": "100000000ustars"
}
}
```

"status" field indicates fee abstraction connection status to host zone:
* 0: UPDADTED
* 1: OUTDATED
* 2: FROZEN


```bash
starsd tx gov submit-legacy-proposal add-hostzone-config proposal.json --from investor
starsd tx gov vote 2 yes --from investor
Expand Down
18 changes: 14 additions & 4 deletions tests/interchaintest/feeabs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ type HostChainFeeAbsConfigResponse struct {
HostChainConfig HostChainFeeAbsConfig `json:"host_chain_config"`
}

const (
HostChainFeeAbsStatus_UPDATED string = "UPDATED"
HostChainFeeAbsStatus_OUTDATED string = "OUTDATED"
HostChainFeeAbsStatus_FROZEN string = "FROZEN"
)

type HostChainFeeAbsConfig struct {
IbcDenom string `json:"ibc_denom"`
OsmosisPoolTokenDenomIn string `json:"osmosis_pool_token_denom_in"`
PoolId string `json:"pool_id"`
Frozen bool `json:"frozen"`
// ibc token is allowed to be used as fee token
IbcDenom string `protobuf:"bytes,1,opt,name=ibc_denom,json=ibcDenom,proto3" json:"ibc_denom,omitempty" yaml:"allowed_token"`
// token_in in cross_chain swap contract.
OsmosisPoolTokenDenomIn string `protobuf:"bytes,2,opt,name=osmosis_pool_token_denom_in,json=osmosisPoolTokenDenomIn,proto3" json:"osmosis_pool_token_denom_in,omitempty"`
// pool id
PoolId string `protobuf:"varint,3,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
// Host chain fee abstraction connection status
Status string `protobuf:"varint,4,opt,name=status,proto3,enum=feeabstraction.feeabs.v1beta1.HostChainFeeAbsStatus" json:"status,omitempty"`
}
2 changes: 1 addition & 1 deletion tests/interchaintest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/cosmos/cosmos-sdk v0.47.8
github.com/cosmos/ibc-go/v7 v7.3.1
github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845
github.com/osmosis-labs/fee-abstraction/v7 v7.0.0-00010101000000-000000000000
github.com/osmosis-labs/fee-abstraction/v7 v7.0.0-20240308160138-d1eb119cae30
github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230721183422-fb937bb0e165
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.26.0
Expand Down
4 changes: 2 additions & 2 deletions tests/interchaintest/host_zone_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestHostZoneProposal(t *testing.T) {
IbcDenom: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
OsmosisPoolTokenDenomIn: "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
PoolId: "1",
Frozen: false,
Status: feeabsCli.HostChainFeeAbsStatus_UPDATED,
}})

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

// Start testing for delete host zone proposal
Expand Down
2 changes: 1 addition & 1 deletion tests/interchaintest/proposal/add_host_zone.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ibc_denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
"osmosis_pool_token_denom_in": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
"pool_id": "1",
"frozen": false
"status": 0
},
"deposit": "100000000stake"
}
2 changes: 1 addition & 1 deletion tests/interchaintest/proposal/set_host_zone.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ibc_denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
"osmosis_pool_token_denom_in": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9",
"pool_id": "1",
"frozen": true
"status": 2
},
"deposit": "100000000stake"
}
2 changes: 1 addition & 1 deletion tests/interchaintest/testnet/proposal/add_host_zone.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ibc_denom": "ibc/1C812795FFE318D29581174B1A04CD6F242E1A3DA504E98D7EDD339B1AF00466",
"osmosis_pool_token_denom_in": "ibc/1C812795FFE318D29581174B1A04CD6F242E1A3DA504E98D7EDD339B1AF00466",
"pool_id": "1",
"frozen": false
"status": 0
},
"deposit": "100000000stake"
}

0 comments on commit f2a7cf2

Please sign in to comment.