Skip to content

Commit

Permalink
[Service] Align add service fee param with other params implementation (
Browse files Browse the repository at this point in the history
#778)

## Summary

This PR refactors the `AddServiceFee` governance parameter to align it
with the implementation style of other parameters:

* Changed the param type from `uint64` to `Coin`.
* Added end-to-end (E2E) tests.
* Introduced `UpdateParam` (previously, only `UpdateParams` was
available).

## Issue

The `AddServiceFee` governance parameter was the first one implemented
and did not benefit from improvements made in subsequent governance
parameters.

Since this is the first and reference implementation for payable
messages, it's crucial that it adheres to Poktroll practices for adding
governance parameters.

_About 2300LOC are auto-generated code and json files_

## Type of change

Select one or more:

- [ ] New feature, functionality or library
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Documentation
- [ ] Other (specify)

## Testing

- [ ] **Documentation**: `make docusaurus_start`; only needed if you
make doc changes
- [x] **Unit Tests**: `make go_develop_and_test`
- [x] **LocalNet E2E Tests**: `make test_e2e`
- [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR.

## Sanity Checklist

- [x] I have tested my changes using the available tooling
- [x] I have commented my code
- [x] I have performed a self-review of my own code; both comments &
source code
- [ ] I create and reference any new tickets, if applicable
- [x] I have left TODOs throughout the codebase, if applicable

---------

Co-authored-by: Daniel Olshansky <[email protected]>
  • Loading branch information
red-0ne and Olshansk authored Sep 5, 2024
1 parent 0360638 commit 7775e1d
Show file tree
Hide file tree
Showing 26 changed files with 2,406 additions and 216 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,11 @@ params_update_shared_proof_window_open_offset_blocks: ## Update the shared modul
params_update_shared_proof_window_close_offset_blocks: ## Update the shared module proof_window_close_offset_blocks param
poktrolld tx authz exec ./tools/scripts/params/shared_proof_window_close_offset_blocks.json $(PARAM_FLAGS)

.PHONY: params_update_service_add_service_fee
params_update_service_add_service_fee: ## Update the service module add_service_fee param
poktrolld tx authz exec ./tools/scripts/params/service_add_service_fee.json $(PARAM_FLAGS)


.PHONY: params_query_all
params_query_all: check_jq ## Query the params from all available modules
@for module in $(MODULES); do \
Expand Down
130 changes: 84 additions & 46 deletions api/poktroll/service/params.pulsar.go

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

Loading

0 comments on commit 7775e1d

Please sign in to comment.