Browse Source

ts: Support empty account structs (#712)

hana 4 years ago
parent
commit
e2bd41b967
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ts/src/coder/common.ts

+ 1 - 1
ts/src/coder/common.ts

@@ -35,7 +35,7 @@ export function accountSize(
   }
   return idlAccount.type.fields
     .map((f) => typeSize(idl, f.type))
-    .reduce((a, b) => a + b);
+    .reduce((a, b) => a + b, 0);
 }
 
 // Returns the size of the type in bytes. For variable length types, just return