@@ -36,6 +36,7 @@ export async function nodeStored(ctx: EventHandlerContext) {
3636
3737 newNode . created = Number ( nodeEvent . created )
3838 newNode . farmingPolicyId = nodeEvent . farmingPolicyId
39+ newNode . certification = NodeCertification . Diy
3940
4041 const newLocation = new Location ( )
4142 newLocation . id = ctx . event . id
@@ -45,45 +46,11 @@ export async function nodeStored(ctx: EventHandlerContext) {
4546
4647 newNode . location = newLocation
4748
48- if ( node . isV28 ) {
49- const nodeAsV28 = node . asV28
50- if ( nodeAsV28 . certificationType ) {
51- const certificationTypeAsString = nodeAsV28 . certificationType . __kind . toString ( )
52- let certType = NodeCertification . Diy
53- switch ( certificationTypeAsString ) {
54- case 'Diy' :
55- certType = NodeCertification . Diy
56- break
57- case 'Certified' :
58- certType = NodeCertification . Certified
59- break
60- }
61- newNode . certification = certType
62- } else {
63- newNode . certification = NodeCertification . Diy
64- }
65- }
66-
6749 if ( node . isV43 ) {
6850 const nodeAsV43 = node . asV43
6951 newNode . secure = nodeAsV43 . secureBoot ? true : false
7052 newNode . virtualized = nodeAsV43 . virtualized ? true : false
7153 newNode . serialNumber = nodeAsV43 . serialNumber . toString ( )
72- if ( nodeAsV43 . certificationType ) {
73- const certificationTypeAsString = nodeAsV43 . certificationType . __kind . toString ( )
74- let certType = NodeCertification . Diy
75- switch ( certificationTypeAsString ) {
76- case 'Diy' :
77- certType = NodeCertification . Diy
78- break
79- case 'Certified' :
80- certType = NodeCertification . Certified
81- break
82- }
83- newNode . certification = certType
84- } else {
85- newNode . certification = NodeCertification . Diy
86- }
8754 }
8855
8956 if ( node . isV101 || node . isV63 ) {
@@ -99,21 +66,6 @@ export async function nodeStored(ctx: EventHandlerContext) {
9966 newNode . virtualized = nodeEvent . virtualized ? true : false
10067 newNode . serialNumber = nodeEvent . serialNumber . toString ( )
10168 newNode . connectionPrice = nodeEvent . connectionPrice
102- if ( nodeEvent . certification ) {
103- const certificationTypeAsString = nodeEvent . certification . __kind . toString ( )
104- let certType = NodeCertification . Diy
105- switch ( certificationTypeAsString ) {
106- case 'Diy' :
107- certType = NodeCertification . Diy
108- break
109- case 'Certified' :
110- certType = NodeCertification . Certified
111- break
112- }
113- newNode . certification = certType
114- } else {
115- newNode . certification = NodeCertification . Diy
116- }
11769 }
11870
11971 await ctx . store . save < Node > ( newNode )
0 commit comments