Skip to content

Commit bd260e9

Browse files
Merge pull request #346 from StakerDAO/zero-balance-no-fail
Do not throw on zero balance
2 parents b095cc6 + c9cbda9 commit bd260e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/chain/tezos/contracts/WrappedTezosHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export namespace WrappedTezosHelper {
162162
const packedKey = TezosMessageUtils.encodeBigMapKey(Buffer.from(TezosMessageUtils.writePackedData(account, 'address'), 'hex'));
163163
const mapResult = await TezosNodeReader.getValueForBigMapKey(server, mapid, packedKey);
164164

165-
if (mapResult === undefined) { throw new Error(`Map ${mapid} does not contain a record for ${account}`); }
165+
if (mapResult === undefined) { return 0 }
166166

167167
const numberString = JSONPath({ path: '$.int', json: mapResult });
168168
return Number(numberString);

0 commit comments

Comments
 (0)