@@ -40,9 +40,10 @@ import {
4040import * as AccountAddress from './types/AccountAddress.js' ;
4141import * as CcdAmount from './types/CcdAmount.js' ;
4242import { DataBlob } from './types/DataBlob.js' ;
43+ import * as InitName from './types/InitName.js' ;
4344import * as Parameter from './types/Parameter.js' ;
4445import * as ReceiveName from './types/ReceiveName.js' ;
45- import * as InitName from './types/InitName.js' ;
46+
4647/**
4748 * A handler for a specific {@linkcode AccountTransactionType}.
4849 */
@@ -204,20 +205,20 @@ export class DeployModuleHandler implements AccountTransactionHandler<DeployModu
204205 }
205206 }
206207
207- deserialize ( serializePayload :Cursor ) : DeployModulePayload {
208+ deserialize ( serializePayload : Cursor ) : DeployModulePayload {
208209 const moduleVersion = serializePayload . read ( 4 ) ; // version
209210 const moduleLength = serializePayload . read ( 4 ) ?. readUInt32BE ( 0 ) ; // length
210211 const moduleSource = serializePayload . read ( moduleLength ) ; // wasm module
211212
212- if ( moduleVersion ) {
213+ if ( moduleVersion ) {
213214 return {
214215 source : new Uint8Array ( moduleSource ) ,
215216 version : moduleVersion . readUInt32BE ( 0 ) ,
216- } ;
217+ } ;
217218 } else {
218- return {
219- source : new Uint8Array ( moduleSource )
220- } ;
219+ return {
220+ source : new Uint8Array ( moduleSource ) ,
221+ } ;
221222 }
222223 }
223224
@@ -259,10 +260,10 @@ export class InitContractHandler implements AccountTransactionHandler<InitContra
259260 return Buffer . concat ( [ serializedAmount , serializedModuleRef , serializedInitName , serializedParameters ] ) ;
260261 }
261262
262- deserialize ( serializePayload :Cursor ) : InitContractPayload {
263+ deserialize ( serializePayload : Cursor ) : InitContractPayload {
263264 const amount = serializePayload . read ( 8 ) . readBigUInt64BE ( 0 ) ;
264265 const moduleRef = serializePayload . read ( 32 ) ;
265-
266+
266267 const initNameLength = serializePayload . read ( 2 ) . readUInt16BE ( 0 ) ;
267268 const initName = serializePayload . read ( initNameLength ) ;
268269 const initNameAfterConversion = InitName . fromString ( initName . toString ( 'utf8' ) ) ;
@@ -271,14 +272,14 @@ export class InitContractHandler implements AccountTransactionHandler<InitContra
271272 const param = serializePayload . read ( paramLength ) ;
272273 const paramBuffer = Parameter . fromBuffer ( param . buffer ) ;
273274
274- return {
275- amount : CcdAmount . fromMicroCcd ( amount ) ,
276- moduleRef : ModuleReference . fromBuffer ( moduleRef ) ,
277- initName : ContractName . fromInitName ( initNameAfterConversion ) ,
278- param : paramBuffer ,
279- //The execution energy cannot be recovered as it is not part of the payload serialization
280- maxContractExecutionEnergy : Energy . create ( 0n ) ,
281- }
275+ return {
276+ amount : CcdAmount . fromMicroCcd ( amount ) ,
277+ moduleRef : ModuleReference . fromBuffer ( moduleRef ) ,
278+ initName : ContractName . fromInitName ( initNameAfterConversion ) ,
279+ param : paramBuffer ,
280+ //The execution energy cannot be recovered as it is not part of the payload serialization
281+ maxContractExecutionEnergy : Energy . create ( 0n ) ,
282+ } ;
282283 }
283284
284285 toJSON ( payload : InitContractPayload ) : InitContractPayloadJSON {
0 commit comments