Skip to content

Commit

Permalink
Update model for TS (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
algochoi committed Jul 27, 2023
1 parent de85c86 commit bee2916
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions typescript_templates/model.vm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ true##
#if ( $argType == $fieldType )
$name##
#elseif ( $argType == "string | Uint8Array" && $fieldType == "Uint8Array" )
typeof $name === 'string' ? new Uint8Array(Buffer.from($name, 'base64')) : $name##
typeof $name === 'string' ? base64ToBytes($name) : $name##
#else
UNHANDLED CONSTRUCTOR TYPE CONVERSION
- property: $prop
Expand Down Expand Up @@ -129,12 +129,12 @@ typeof $value !== 'undefined' ? $assignment : undefined##
*/

/* eslint-disable no-use-before-define */
import { Buffer } from 'buffer';
import BaseModel from '../../basemodel';
import { base64ToBytes } from '../../../../encoding/binarydata';
#if ( $propFile.indexer == "false" )
import { EncodedSignedTransaction } from '../../../../types/transactions/encoded';
import BlockHeader from '../../../../types/blockHeader';
import { EncodedSignedTransaction } from '../../../../types/transactions/encoded';
#end
import BaseModel from '../../basemodel';

#foreach( $modelEntry in $models.entrySet() )
#set( $def = $modelEntry.key )
Expand Down

0 comments on commit bee2916

Please sign in to comment.