@@ -18,11 +18,12 @@ import { ProposedCertificate } from "./module/types/pki/proposed_certificate"
18
18
import { ProposedCertificateRevocation } from "./module/types/pki/proposed_certificate_revocation"
19
19
import { RejectedCertificate } from "./module/types/pki/rejected_certificate"
20
20
import { RevokedCertificates } from "./module/types/pki/revoked_certificates"
21
+ import { RevokedNocRootCertificates } from "./module/types/pki/revoked_noc_root_certificates"
21
22
import { RevokedRootCertificates } from "./module/types/pki/revoked_root_certificates"
22
23
import { UniqueCertificate } from "./module/types/pki/unique_certificate"
23
24
24
25
25
- export { ApprovedCertificates , ApprovedCertificatesBySubject , ApprovedCertificatesBySubjectKeyId , ApprovedRootCertificates , Certificate , CertificateIdentifier , ChildCertificates , Grant , NocCertificates , NocRootCertificates , PkiRevocationDistributionPoint , PkiRevocationDistributionPointsByIssuerSubjectKeyID , ProposedCertificate , ProposedCertificateRevocation , RejectedCertificate , RevokedCertificates , RevokedRootCertificates , UniqueCertificate } ;
26
+ export { ApprovedCertificates , ApprovedCertificatesBySubject , ApprovedCertificatesBySubjectKeyId , ApprovedRootCertificates , Certificate , CertificateIdentifier , ChildCertificates , Grant , NocCertificates , NocRootCertificates , PkiRevocationDistributionPoint , PkiRevocationDistributionPointsByIssuerSubjectKeyID , ProposedCertificate , ProposedCertificateRevocation , RejectedCertificate , RevokedCertificates , RevokedNocRootCertificates , RevokedRootCertificates , UniqueCertificate } ;
26
27
27
28
async function initTxClient ( vuexGetters ) {
28
29
return await txClient ( vuexGetters [ 'common/wallet/signer' ] , {
@@ -81,6 +82,8 @@ const getDefaultState = () => {
81
82
NocRootCertificatesAll : { } ,
82
83
NocCertificates : { } ,
83
84
NocCertificatesAll : { } ,
85
+ RevokedNocRootCertificates : { } ,
86
+ RevokedNocRootCertificatesAll : { } ,
84
87
85
88
_Structure : {
86
89
ApprovedCertificates : getStructure ( ApprovedCertificates . fromPartial ( { } ) ) ,
@@ -99,6 +102,7 @@ const getDefaultState = () => {
99
102
ProposedCertificateRevocation : getStructure ( ProposedCertificateRevocation . fromPartial ( { } ) ) ,
100
103
RejectedCertificate : getStructure ( RejectedCertificate . fromPartial ( { } ) ) ,
101
104
RevokedCertificates : getStructure ( RevokedCertificates . fromPartial ( { } ) ) ,
105
+ RevokedNocRootCertificates : getStructure ( RevokedNocRootCertificates . fromPartial ( { } ) ) ,
102
106
RevokedRootCertificates : getStructure ( RevokedRootCertificates . fromPartial ( { } ) ) ,
103
107
UniqueCertificate : getStructure ( UniqueCertificate . fromPartial ( { } ) ) ,
104
108
@@ -255,6 +259,18 @@ export default {
255
259
}
256
260
return state . NocCertificatesAll [ JSON . stringify ( params ) ] ?? { }
257
261
} ,
262
+ getRevokedNocRootCertificates : ( state ) => ( params = { params : { } } ) => {
263
+ if ( ! ( < any > params ) . query ) {
264
+ ( < any > params ) . query = null
265
+ }
266
+ return state . RevokedNocRootCertificates [ JSON . stringify ( params ) ] ?? { }
267
+ } ,
268
+ getRevokedNocRootCertificatesAll : ( state ) => ( params = { params : { } } ) => {
269
+ if ( ! ( < any > params ) . query ) {
270
+ ( < any > params ) . query = null
271
+ }
272
+ return state . RevokedNocRootCertificatesAll [ JSON . stringify ( params ) ] ?? { }
273
+ } ,
258
274
259
275
getTypeStructure : ( state ) => ( type ) => {
260
276
return state . _Structure [ type ] . fields
@@ -787,7 +803,55 @@ export default {
787
803
} ,
788
804
789
805
790
- async sendMsgRevokeX509Cert ( { rootGetters } , { value, fee = [ ] , memo = '' } ) {
806
+
807
+
808
+
809
+
810
+
811
+ async QueryRevokedNocRootCertificates ( { commit, rootGetters, getters } , { options : { subscribe, all} = { subscribe :false , all :false } , params, query= null } ) {
812
+ try {
813
+ const key = params ?? { } ;
814
+ const queryClient = await initQueryClient ( rootGetters )
815
+ let value = ( await queryClient . queryRevokedNocRootCertificates ( key . subject , key . subjectKeyId ) ) . data
816
+
817
+
818
+ commit ( 'QUERY' , { query : 'RevokedNocRootCertificates' , key : { params : { ...key } , query} , value } )
819
+ if ( subscribe ) commit ( 'SUBSCRIBE' , { action : 'QueryRevokedNocRootCertificates' , payload : { options : { all } , params : { ...key } , query } } )
820
+ return getters [ 'getRevokedNocRootCertificates' ] ( { params : { ...key } , query} ) ?? { }
821
+ } catch ( e ) {
822
+ throw new SpVuexError ( 'QueryClient:QueryRevokedNocRootCertificates' , 'API Node Unavailable. Could not perform query: ' + e . message )
823
+
824
+ }
825
+ } ,
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+ async QueryRevokedNocRootCertificatesAll ( { commit, rootGetters, getters } , { options : { subscribe, all} = { subscribe :false , all :false } , params, query= null } ) {
834
+ try {
835
+ const key = params ?? { } ;
836
+ const queryClient = await initQueryClient ( rootGetters )
837
+ let value = ( await queryClient . queryRevokedNocRootCertificatesAll ( query ) ) . data
838
+
839
+
840
+ while ( all && ( < any > value ) . pagination && ( < any > value ) . pagination . next_key != null ) {
841
+ let next_values = ( await queryClient . queryRevokedNocRootCertificatesAll ( { ...query , 'pagination.key' :( < any > value ) . pagination . next_key } ) ) . data
842
+ value = mergeResults ( value , next_values ) ;
843
+ }
844
+ commit ( 'QUERY' , { query : 'RevokedNocRootCertificatesAll' , key : { params : { ...key } , query} , value } )
845
+ if ( subscribe ) commit ( 'SUBSCRIBE' , { action : 'QueryRevokedNocRootCertificatesAll' , payload : { options : { all } , params : { ...key } , query } } )
846
+ return getters [ 'getRevokedNocRootCertificatesAll' ] ( { params : { ...key } , query} ) ?? { }
847
+ } catch ( e ) {
848
+ throw new SpVuexError ( 'QueryClient:QueryRevokedNocRootCertificatesAll' , 'API Node Unavailable. Could not perform query: ' + e . message )
849
+
850
+ }
851
+ } ,
852
+
853
+
854
+ async sendMsgAddNocX509Cert ( { rootGetters } , { value, fee = [ ] , memo = '' } ) {
791
855
try {
792
856
const txClient = await initTxClient ( rootGetters )
793
857
const msg = await txClient . msgRejectAddX509RootCert ( value )
0 commit comments