Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Migration] Application module #378

Closed

Conversation

red-0ne
Copy link
Contributor

@red-0ne red-0ne commented Feb 11, 2024

Summary

Human Summary

Application module migration based off of migration/gateway-module-x-service-module which is based off of migration/base.

Issue

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Testing

  • Run all unit tests: make go_develop_and_test
  • Run E2E tests locally: make test_e2e
  • Run E2E tests on DevNet: Add the devnet-test-e2e label to the PR. This is VERY expensive, only do it after all the reviews are complete.

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have performed a self-review of my own code
  • I have commented my code, updated documentation and left TODOs throughout the codebase

@red-0ne red-0ne added application Changes related to the Application actor code health Cleans up some code labels Feb 11, 2024
@red-0ne red-0ne added this to the Shannon TestNet milestone Feb 11, 2024
@red-0ne red-0ne self-assigned this Feb 11, 2024
@red-0ne red-0ne force-pushed the migration/application-module branch 2 times, most recently from 79c0a56 to 4c1e606 Compare February 11, 2024 06:30
@bryanchriswhite bryanchriswhite mentioned this pull request Feb 12, 2024
11 tasks
@bryanchriswhite bryanchriswhite marked this pull request as ready for review February 12, 2024 10:01
@red-0ne red-0ne changed the base branch from migration/gateway-module-x-service-module to migration/gateway-module February 15, 2024 20:59
@red-0ne red-0ne changed the base branch from migration/gateway-module to migration/gateway-module-x-service-module February 15, 2024 21:00
@red-0ne red-0ne changed the base branch from migration/gateway-module-x-service-module to migration/gateway-module February 15, 2024 21:03
@red-0ne red-0ne force-pushed the migration/application-module branch from 3ac490d to 6e18452 Compare February 15, 2024 21:03
@red-0ne red-0ne changed the base branch from migration/gateway-module to migration/gateway-module-x-service-module February 15, 2024 21:09
@red-0ne red-0ne changed the base branch from migration/gateway-module-x-service-module to migration/gateway-x-service February 15, 2024 21:19
ignite scaffold module application --dep bank,account,gateway --params max-delegated-gateways:uint
ignite scaffold map application stake:coin service-configs:array.string delegatee-gateway-addresses:array.string --no-message --module application --index address --signer address
ignite scaffold message stake-application stake:coin services:array.string --signer address --module application
ignite scaffold message unstake-application --signer address --module application
ignite scaffold message delegate-to-gateway gateway-address:string --signer app-address --module application
ignite scaffold message undelegate-from-gateway gateway-address:string --signer app-address --module application
@red-0ne red-0ne force-pushed the migration/application-module branch from 6e18452 to 1140daf Compare February 15, 2024 21:22
Comment on lines 12 to 23
ErrAppSample = sdkerrors.Register(ModuleName, 1101, "sample error")
ErrAppInvalidStake = sdkerrors.Register(ModuleName, 1102, "invalid application stake")
ErrAppInvalidAddress = sdkerrors.Register(ModuleName, 1103, "invalid application address")
ErrAppUnauthorized = sdkerrors.Register(ModuleName, 1104, "unauthorized application signer")
ErrAppNotFound = sdkerrors.Register(ModuleName, 1105, "application not found")
ErrAppInvalidServiceConfigs = sdkerrors.Register(ModuleName, 1107, "invalid service configs")
ErrAppGatewayNotFound = sdkerrors.Register(ModuleName, 1108, "gateway not found")
ErrAppInvalidGatewayAddress = sdkerrors.Register(ModuleName, 1109, "invalid gateway address")
ErrAppAlreadyDelegated = sdkerrors.Register(ModuleName, 1110, "application already delegated to gateway")
ErrAppMaxDelegatedGateways = sdkerrors.Register(ModuleName, 1111, "maximum number of delegated gateways reached")
ErrAppInvalidMaxDelegatedGateways = sdkerrors.Register(ModuleName, 1112, "invalid MaxDelegatedGateways parameter")
ErrAppNotDelegated = sdkerrors.Register(ModuleName, 1113, "application not delegated to gateway")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ErrAppSample = sdkerrors.Register(ModuleName, 1101, "sample error")
ErrAppInvalidStake = sdkerrors.Register(ModuleName, 1102, "invalid application stake")
ErrAppInvalidAddress = sdkerrors.Register(ModuleName, 1103, "invalid application address")
ErrAppUnauthorized = sdkerrors.Register(ModuleName, 1104, "unauthorized application signer")
ErrAppNotFound = sdkerrors.Register(ModuleName, 1105, "application not found")
ErrAppInvalidServiceConfigs = sdkerrors.Register(ModuleName, 1107, "invalid service configs")
ErrAppGatewayNotFound = sdkerrors.Register(ModuleName, 1108, "gateway not found")
ErrAppInvalidGatewayAddress = sdkerrors.Register(ModuleName, 1109, "invalid gateway address")
ErrAppAlreadyDelegated = sdkerrors.Register(ModuleName, 1110, "application already delegated to gateway")
ErrAppMaxDelegatedGateways = sdkerrors.Register(ModuleName, 1111, "maximum number of delegated gateways reached")
ErrAppInvalidMaxDelegatedGateways = sdkerrors.Register(ModuleName, 1112, "invalid MaxDelegatedGateways parameter")
ErrAppNotDelegated = sdkerrors.Register(ModuleName, 1113, "application not delegated to gateway")
ErrAppInvalidStake = sdkerrors.Register(ModuleName, 1101, "invalid application stake")
ErrAppInvalidAddress = sdkerrors.Register(ModuleName, 1102, "invalid application address")
ErrAppUnauthorized = sdkerrors.Register(ModuleName, 1103, "unauthorized application signer")
ErrAppNotFound = sdkerrors.Register(ModuleName, 1104, "application not found")
ErrAppInvalidServiceConfigs = sdkerrors.Register(ModuleName, 1105, "invalid service configs")
ErrAppGatewayNotFound = sdkerrors.Register(ModuleName, 1106, "gateway not found")
ErrAppInvalidGatewayAddress = sdkerrors.Register(ModuleName, 1107, "invalid gateway address")
ErrAppAlreadyDelegated = sdkerrors.Register(ModuleName, 1108, "application already delegated to gateway")
ErrAppMaxDelegatedGateways = sdkerrors.Register(ModuleName, 1109, "maximum number of delegated gateways reached")
ErrAppInvalidMaxDelegatedGateways = sdkerrors.Register(ModuleName, 1110, "invalid MaxDelegatedGateways parameter")
ErrAppNotDelegated = sdkerrors.Register(ModuleName, 1111, "application not delegated to gateway")

@@ -0,0 +1 @@
package types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
package types
package types
// This file is in place to declare the package for dynamically generated protobufs

)

// ValidateAppServiceConfigs returns an error if any of the application service configs are invalid
func ValidateAppServiceConfigs(services []*sharedtypes.ApplicationServiceConfig) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func ValidateAppServiceConfigs(services []*sharedtypes.ApplicationServiceConfig) error {
// TODO_TECHDEBT(#348): ensure consistent error convention is used.
func ValidateAppServiceConfigs(services []*sharedtypes.ApplicationServiceConfig) error {

}

// ValidateSupplierServiceConfigs returns an error if any of the supplier service configs are invalid
func ValidateSupplierServiceConfigs(services []*sharedtypes.SupplierServiceConfig) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func ValidateSupplierServiceConfigs(services []*sharedtypes.SupplierServiceConfig) error {
// TODO_TECHDEBT(#348): ensure consistent error convention is used.
func ValidateSupplierServiceConfigs(services []*sharedtypes.SupplierServiceConfig) error {

Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! More of the same kind of feedback as #371 & #365.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application Changes related to the Application actor code health Cleans up some code
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants