@@ -65,6 +65,14 @@ export async function contractCreated(
6565 contractEvent = contractCreatedEvent . asV105
6666 newNameContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
6767 }
68+ if ( contractCreatedEvent . isV147 ) {
69+ contractEvent = contractCreatedEvent . asV147
70+ newNameContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
71+ }
72+ if ( contractCreatedEvent . isV148 ) {
73+ contractEvent = contractCreatedEvent . asV148
74+ newNameContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
75+ }
6876 await ctx . store . save < NameContract > ( newNameContract )
6977 }
7078 else if ( contractEvent . contractType . __kind === "NodeContract" ) {
@@ -90,7 +98,14 @@ export async function contractCreated(
9098 contractEvent = contractCreatedEvent . asV105
9199 newNodeContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
92100 }
93-
101+ if ( contractCreatedEvent . isV147 ) {
102+ contractEvent = contractCreatedEvent . asV147
103+ newNodeContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
104+ }
105+ if ( contractCreatedEvent . isV148 ) {
106+ contractEvent = contractCreatedEvent . asV148
107+ newNodeContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
108+ }
94109 // Gather IPS and update them
95110 let touchedIps : PublicIp [ ] = await ctx . store . find ( PublicIp , {
96111 where : {
@@ -131,6 +146,14 @@ export async function contractCreated(
131146 contractEvent = contractCreatedEvent . asV105
132147 newRentContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
133148 }
149+ if ( contractCreatedEvent . isV147 ) {
150+ contractEvent = contractCreatedEvent . asV147
151+ newRentContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
152+ }
153+ if ( contractCreatedEvent . isV148 ) {
154+ contractEvent = contractCreatedEvent . asV148
155+ newRentContract . solutionProviderID = Number ( contractEvent . solutionProviderId ) || 0
156+ }
134157 await ctx . store . save < RentContract > ( newRentContract )
135158
136159 // Update node to dedicated if it is rented
@@ -194,9 +217,8 @@ async function updateNodeContract(ctx: Ctx, ctr: any, contract: NodeContract, st
194217 contract . nodeID = parsedNodeContract . nodeId
195218 contract . numberOfPublicIPs = parsedNodeContract . publicIps
196219
197-
198- contract . deploymentData = validateString ( ctx , contract . deploymentData . toString ( ) )
199- contract . deploymentHash = validateString ( ctx , contract . deploymentHash . toString ( ) )
220+ contract . deploymentData = validateString ( ctx , parsedNodeContract . deploymentData . toString ( ) )
221+ contract . deploymentHash = validateString ( ctx , parsedNodeContract . deploymentHash . toString ( ) )
200222
201223 let state = ContractState . OutOfFunds
202224 switch ( ctr . state . __kind ) {
0 commit comments