This pull request introduces support for adding assets in the services pallet by adding AssetId to various APIs and structures, and implementing constraints and validation for assets.
Changes introduced in this pull request:
API and Trait Updates:
Added AssetId to the ServicesApi trait and updated related method signatures in pallets/services/rpc/runtime-api/src/lib.rs and pallets/services/rpc/src/lib.rs. [1][2][3][4]
Struct and Type Modifications:
Updated ServiceRequest and Service structs to include assets field, and added corresponding constraints and bounds in primitives/src/services/mod.rs. [1][2][3]
Added MaxAssetsPerService type to Constraints trait and implemented it in pallets/services/src/impls.rs and pallets/services/src/types.rs. [1][2][3]
Validation and Error Handling:
Added validation to ensure at least one asset is provided and the number of assets does not exceed the maximum allowed in pallets/services/src/lib.rs. [1][2][3]
Event and Storage Updates:
Modified events and storage to handle assets in pallets/services/src/lib.rs. [1][2][3][4]
Precompile Changes:
Updated the requestService precompile function to include assets parameter in precompiles/services/src/lib.rs and precompiles/services/Services.sol. [1][2][3]
Summary of changes
This pull request introduces support for adding assets in the services pallet by adding
AssetId
to various APIs and structures, and implementing constraints and validation for assets.Changes introduced in this pull request:
API and Trait Updates:
AssetId
to theServicesApi
trait and updated related method signatures inpallets/services/rpc/runtime-api/src/lib.rs
andpallets/services/rpc/src/lib.rs
. [1] [2] [3] [4]Struct and Type Modifications:
ServiceRequest
andService
structs to includeassets
field, and added corresponding constraints and bounds inprimitives/src/services/mod.rs
. [1] [2] [3]MaxAssetsPerService
type toConstraints
trait and implemented it inpallets/services/src/impls.rs
andpallets/services/src/types.rs
. [1] [2] [3]Validation and Error Handling:
pallets/services/src/lib.rs
. [1] [2] [3]Event and Storage Updates:
pallets/services/src/lib.rs
. [1] [2] [3] [4]Precompile Changes:
requestService
precompile function to includeassets
parameter inprecompiles/services/src/lib.rs
andprecompiles/services/Services.sol
. [1] [2] [3]Reference issue to close (if applicable)
Closes #774