@ethereum-waffle/chai
Version:
A sweet set of chai matchers for your blockchain testing needs.
17 lines • 679 B
JavaScript
import { ensure } from '../calledOnContract/utils';
import { getAddressOf } from './account';
export function getAddresses(accounts) {
return Promise.all(accounts.map((account) => getAddressOf(account)));
}
export async function getBalances(accounts, blockNumber) {
return Promise.all(accounts.map((account) => {
ensure(account.provider !== undefined, TypeError, 'Provider not found');
if (blockNumber !== undefined) {
return account.provider.getBalance(getAddressOf(account), blockNumber);
}
else {
return account.provider.getBalance(getAddressOf(account));
}
}));
}
//# sourceMappingURL=balance.js.map