Skip to content

Commit

Permalink
Merge pull request #121 from notional-labs/ducnt/112
Browse files Browse the repository at this point in the history
Only need ibc_denom to DeleteHostZoneProposal
  • Loading branch information
GNaD13 authored Mar 27, 2023
2 parents 8364dd2 + a781c30 commit fe3e008
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 81 deletions.
14 changes: 7 additions & 7 deletions proto/feeabstraction/absfee/v1beta1/proposal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ message AddHostZoneProposal {
}

message DeleteHostZoneProposal {
option (gogoproto.goproto_getters) = false;
// the title of the proposal
string title = 1;
// the description of the proposal
string description = 2;
// the host chain config
HostChainFeeAbsConfig host_chain_config = 3;
option (gogoproto.goproto_getters) = false;
// the title of the proposal
string title = 1;
// the description of the proposal
string description = 2;
// the ibc denom of this token
string ibc_denom = 3;
}

message SetHostZoneProposal {
Expand Down
2 changes: 1 addition & 1 deletion x/feeabs/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func NewCmdSubmitDeleteHostZoneProposal() *cobra.Command {
}

content := types.NewDeleteHostZoneProposal(
proposal.Title, proposal.Description, proposal.HostChainFeeAbsConfig,
proposal.Title, proposal.Description, proposal.IbcDenom,
)

deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit)
Expand Down
8 changes: 4 additions & 4 deletions x/feeabs/client/cli/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ type (
Deposit string `json:"deposit" yaml:"deposit"`
}
DeleteHostZoneProposalJSON struct {
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
HostChainFeeAbsConfig types.HostChainFeeAbsConfig `json:"host_chain_fee_abs_config" yaml:"host_chain_fee_abs_config"`
Deposit string `json:"deposit" yaml:"deposit"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
IbcDenom string `json:"ibc_denom" yaml:"ibc_denom"`
Deposit string `json:"deposit" yaml:"deposit"`
}
SetHostZoneProposalJSON struct {
Title string `json:"title" yaml:"title"`
Expand Down
4 changes: 2 additions & 2 deletions x/feeabs/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ func (k Keeper) AddHostZoneProposal(ctx sdk.Context, p *types.AddHostZoneProposa
}

func (k Keeper) DeleteHostZoneProposal(ctx sdk.Context, p *types.DeleteHostZoneProposal) error {
_, err := k.GetHostZoneConfig(ctx, p.HostChainConfig.IbcDenom)
_, err := k.GetHostZoneConfig(ctx, p.IbcDenom)
if err == nil {
return types.ErrHostZoneConfigNotFound
}

err = k.DeleteHostZoneConfig(ctx, p.HostChainConfig.IbcDenom)
err = k.DeleteHostZoneConfig(ctx, p.IbcDenom)
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions x/feeabs/types/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ func NewAddHostZoneProposal(title, description string, config HostChainFeeAbsCon
}
}

func NewDeleteHostZoneProposal(title, description string, config HostChainFeeAbsConfig) govtypes.Content {
func NewDeleteHostZoneProposal(title, description, ibc_denom string) govtypes.Content {
return &DeleteHostZoneProposal{
Title: title,
Description: description,
HostChainConfig: &config,
Title: title,
Description: description,
IbcDenom: ibc_denom,
}
}

Expand Down
117 changes: 54 additions & 63 deletions x/feeabs/types/proposal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fe3e008

Please sign in to comment.