File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,26 @@ func (k Keeper) RemoveApprovedCertificates(
70
70
))
71
71
}
72
72
73
+ func (k Keeper ) removeCertFromList (serialNumber string , certs * types.ApprovedCertificates ) {
74
+ certIndex := - 1
75
+
76
+ for i , cert := range certs .Certs {
77
+ if cert .SerialNumber == serialNumber {
78
+ certIndex = i
79
+
80
+ break
81
+ }
82
+ }
83
+ if certIndex == - 1 {
84
+ return
85
+ }
86
+ if certIndex == len (certs .Certs )- 1 {
87
+ certs .Certs = certs .Certs [:certIndex ]
88
+ } else {
89
+ certs .Certs = append (certs .Certs [:certIndex ], certs .Certs [certIndex + 1 :]... )
90
+ }
91
+ }
92
+
73
93
// GetAllApprovedCertificates returns all approvedCertificates.
74
94
func (k Keeper ) GetAllApprovedCertificates (ctx sdk.Context ) (list []types.ApprovedCertificates ) {
75
95
store := prefix .NewStore (ctx .KVStore (k .storeKey ), pkitypes .KeyPrefix (types .ApprovedCertificatesKeyPrefix ))
You can’t perform that action at this time.
0 commit comments