File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
packages/cli/src/scaffold Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @graphprotocol/graph-cli ' : patch
3+ ---
4+
5+ handle sized arrays in abi when changetype
Original file line number Diff line number Diff line change @@ -15,12 +15,13 @@ export const generateFieldAssignment = (
1515) : { assignment : string ; imports : string [ ] } => {
1616 const safeKey = key . map ( k => util . handleReservedWord ( k ) ) ;
1717 const safeValue = value . map ( v => util . handleReservedWord ( v ) ) ;
18+ const cleanType = type . replace ( / \[ \d + \] / g, '[]' ) ;
1819
1920 let rightSide = `event.params.${ safeValue . join ( '.' ) } ` ;
2021 const imports = [ ] ;
2122
22- if ( type in VALUE_TYPECAST_MAP ) {
23- const castTo = VALUE_TYPECAST_MAP [ type ] ;
23+ if ( cleanType in VALUE_TYPECAST_MAP ) {
24+ const castTo = VALUE_TYPECAST_MAP [ cleanType ] ;
2425 rightSide = `changetype<${ castTo } >(${ rightSide } )` ;
2526 imports . push ( castTo . replace ( '[]' , '' ) ) ;
2627 }
You can’t perform that action at this time.
0 commit comments