From e2bd41b9676e8a3c67b5dbb2acef2aefcce4d113 Mon Sep 17 00:00:00 2001 From: hana <81144685+2501babe@users.noreply.github.com> Date: Sat, 11 Sep 2021 14:39:12 -0700 Subject: [PATCH] ts: Support empty account structs (#712) --- ts/src/coder/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/src/coder/common.ts b/ts/src/coder/common.ts index cc93f80302..ad2678ff45 100644 --- a/ts/src/coder/common.ts +++ b/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