How to use the @0x/contracts-test-utils.expect function in @0x/contracts-test-utils

To help you get started, we’ve selected a few @0x/contracts-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / contracts / exchange / src / balance_stores / balance_store.ts View on Github external
private _assertEthBalancesEqual(rhs: BalanceStore): void {
        for (const ownerAddress of [...this._ownerAddresses, ...rhs._ownerAddresses]) {
            const thisBalance = _.get(this._balances.eth, [ownerAddress], new BigNumber(0));
            const rhsBalance = _.get(rhs._balances.eth, [ownerAddress], new BigNumber(0));
            expect(thisBalance, `${this._readableAddressName(ownerAddress)} ETH balance`).to.bignumber.equal(
                rhsBalance,
            );
        }
    }
github 0xProject / 0x-monorepo / contracts / exchange / src / balance_stores / balance_store.ts View on Github external
private _assertErc721BalancesEqual(rhs: BalanceStore): void {
        for (const ownerAddress of [...this._ownerAddresses, ...rhs._ownerAddresses]) {
            for (const tokenAddress of [...this._tokenAddresses.erc721, ...rhs._tokenAddresses.erc721]) {
                const thisBalance = _.get(this._balances.erc721, [ownerAddress, tokenAddress], []);
                const rhsBalance = _.get(rhs._balances.erc721, [ownerAddress, tokenAddress], []);
                expect(
                    thisBalance,
                    `${this._readableAddressName(ownerAddress)} ${this._readableAddressName(tokenAddress)} balance`,
                ).to.deep.equal(rhsBalance);
            }
        }
    }
github 0xProject / 0x-monorepo / contracts / exchange / src / balance_stores / balance_store.ts View on Github external
private _assertErc1155BalancesEqual(rhs: BalanceStore): void {
        for (const ownerAddress of [...this._ownerAddresses, ...rhs._ownerAddresses]) {
            for (const tokenAddress of [...this._tokenAddresses.erc1155, ...rhs._tokenAddresses.erc1155]) {
                const thisBalance = _.get(this._balances.erc1155, [ownerAddress, tokenAddress], {});
                const rhsBalance = _.get(rhs._balances.erc1155, [ownerAddress, tokenAddress], {});
                expect(
                    thisBalance,
                    `${this._readableAddressName(ownerAddress)} ${this._readableAddressName(tokenAddress)} balance`,
                ).to.deep.equal(rhsBalance);
            }
        }
    }
}
github 0xProject / 0x-monorepo / contracts / exchange / src / balance_stores / balance_store.ts View on Github external
private _assertErc20BalancesEqual(rhs: BalanceStore): void {
        for (const ownerAddress of [...this._ownerAddresses, ...rhs._ownerAddresses]) {
            for (const tokenAddress of [...this._tokenAddresses.erc20, ...rhs._tokenAddresses.erc20]) {
                const thisBalance = _.get(this._balances.erc20, [ownerAddress, tokenAddress], new BigNumber(0));
                const rhsBalance = _.get(rhs._balances.erc20, [ownerAddress, tokenAddress], new BigNumber(0));
                expect(
                    thisBalance,
                    `${this._readableAddressName(ownerAddress)} ${this._readableAddressName(tokenAddress)} balance`,
                ).to.bignumber.equal(rhsBalance);
            }
        }
    }