Skip to content

Commit e680057

Browse files
fix: provider id change (#215)
Add `providerId` at the end of the struct instead.
1 parent b6a999f commit e680057

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

service_contracts/abi/ServiceProviderRegistry.abi.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,6 @@
390390
"type": "tuple",
391391
"internalType": "struct ServiceProviderRegistryStorage.ServiceProviderInfo",
392392
"components": [
393-
{
394-
"name": "providerId",
395-
"type": "uint256",
396-
"internalType": "uint256"
397-
},
398393
{
399394
"name": "serviceProvider",
400395
"type": "address",
@@ -419,6 +414,11 @@
419414
"name": "isActive",
420415
"type": "bool",
421416
"internalType": "bool"
417+
},
418+
{
419+
"name": "providerId",
420+
"type": "uint256",
421+
"internalType": "uint256"
422422
}
423423
]
424424
},
@@ -697,11 +697,6 @@
697697
"type": "tuple",
698698
"internalType": "struct ServiceProviderRegistryStorage.ServiceProviderInfo",
699699
"components": [
700-
{
701-
"name": "providerId",
702-
"type": "uint256",
703-
"internalType": "uint256"
704-
},
705700
{
706701
"name": "serviceProvider",
707702
"type": "address",
@@ -726,6 +721,11 @@
726721
"name": "isActive",
727722
"type": "bool",
728723
"internalType": "bool"
724+
},
725+
{
726+
"name": "providerId",
727+
"type": "uint256",
728+
"internalType": "uint256"
729729
}
730730
]
731731
}
@@ -748,11 +748,6 @@
748748
"type": "tuple",
749749
"internalType": "struct ServiceProviderRegistryStorage.ServiceProviderInfo",
750750
"components": [
751-
{
752-
"name": "providerId",
753-
"type": "uint256",
754-
"internalType": "uint256"
755-
},
756751
{
757752
"name": "serviceProvider",
758753
"type": "address",
@@ -777,6 +772,11 @@
777772
"name": "isActive",
778773
"type": "bool",
779774
"internalType": "bool"
775+
},
776+
{
777+
"name": "providerId",
778+
"type": "uint256",
779+
"internalType": "uint256"
780780
}
781781
]
782782
}
@@ -856,11 +856,6 @@
856856
"type": "tuple",
857857
"internalType": "struct ServiceProviderRegistryStorage.ServiceProviderInfo",
858858
"components": [
859-
{
860-
"name": "providerId",
861-
"type": "uint256",
862-
"internalType": "uint256"
863-
},
864859
{
865860
"name": "serviceProvider",
866861
"type": "address",
@@ -885,6 +880,11 @@
885880
"name": "isActive",
886881
"type": "bool",
887882
"internalType": "bool"
883+
},
884+
{
885+
"name": "providerId",
886+
"type": "uint256",
887+
"internalType": "uint256"
888888
}
889889
]
890890
},
@@ -1115,11 +1115,6 @@
11151115
}
11161116
],
11171117
"outputs": [
1118-
{
1119-
"name": "providerId",
1120-
"type": "uint256",
1121-
"internalType": "uint256"
1122-
},
11231118
{
11241119
"name": "serviceProvider",
11251120
"type": "address",
@@ -1144,6 +1139,11 @@
11441139
"name": "isActive",
11451140
"type": "bool",
11461141
"internalType": "bool"
1142+
},
1143+
{
1144+
"name": "providerId",
1145+
"type": "uint256",
1146+
"internalType": "uint256"
11471147
}
11481148
],
11491149
"stateMutability": "view"

service_contracts/src/ServiceProviderRegistry.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ contract ServiceProviderRegistry is
158158

159159
// Store provider info
160160
providers[providerId] = ServiceProviderInfo({
161-
providerId: providerId,
162161
serviceProvider: msg.sender,
163162
payee: payee,
164163
name: name,
165164
description: description,
166-
isActive: true
165+
isActive: true,
166+
providerId: providerId
167167
});
168168

169169
// Update address mapping

service_contracts/src/ServiceProviderRegistryStorage.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ contract ServiceProviderRegistryStorage {
1818

1919
/// @notice Main provider information
2020
struct ServiceProviderInfo {
21-
uint256 providerId; // Unique identifier for the provider
2221
address serviceProvider; // Address that controls the provider registration
2322
address payee; // Address that receives payments (cannot be changed after registration)
2423
string name; // Optional provider name (max 128 chars)
2524
string description; //Service description, ToC, contract info, website..
2625
bool isActive;
26+
uint256 providerId; // Unique identifier for the provider
2727
}
2828

2929
/// @notice Product offering of the Service Provider

0 commit comments

Comments
 (0)