Minor changes to typescript tests

This commit is contained in:
Greg Hysen
2018-04-12 17:55:06 -07:00
committed by Amir Bandeali
parent b3b29f527e
commit 4e48de1116
3 changed files with 6 additions and 8 deletions

View File

@@ -5,9 +5,7 @@ import ethUtil = require('ethereumjs-util');
import { AssetProxyId } from './types';
export function encodeAssetProxyId(assetProxyId: AssetProxyId): Buffer {
const formattedAssetProxyId = new BN(assetProxyId);
const encodedAssetProxyId = ethUtil.toUnsigned(formattedAssetProxyId);
return encodedAssetProxyId;
return ethUtil.toBuffer(assetProxyId);
}
export function encodeAddress(address: string): Buffer {

View File

@@ -31,7 +31,7 @@ export const crypto = {
argTypes.push('address');
} else if (_.isString(arg)) {
argTypes.push('string');
} else if (arg instanceof Buffer) {
} else if (_.isBuffer(arg)) {
argTypes.push('bytes');
} else if (_.isBoolean(arg)) {
argTypes.push('bool');

View File

@@ -183,7 +183,7 @@ describe('AssetProxyDispatcher', () => {
expect(proxyAddress).to.be.equal(newAddress);
});
it('should throw if registering with incorrect "old_address" field', async () => {
it('should throw if registering with incorrect "currentAssetProxyAddress" field', async () => {
// Initial registration
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
AssetProxyId.ERC20,
@@ -225,7 +225,7 @@ describe('AssetProxyDispatcher', () => {
expect(newProxyAddress).to.be.equal(ZeroEx.NULL_ADDRESS);
});
it('should throw if requesting address is not authorized', async () => {
it('should throw if requesting address is not owner', async () => {
return expect(
assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
AssetProxyId.ERC20,
@@ -286,7 +286,7 @@ describe('AssetProxyDispatcher', () => {
);
});
it('should throw if delegating to unregistered proxy', async () => {
it('should throw if dispatching to unregistered proxy', async () => {
// Construct metadata for ERC20 proxy
const encodedProxyMetadata = encodeERC20ProxyData(zrx.address);
// Perform a transfer from makerAddress to takerAddress
@@ -298,7 +298,7 @@ describe('AssetProxyDispatcher', () => {
makerAddress,
takerAddress,
amount,
{ from: notOwner },
{ from: exchangeAddress },
),
).to.be.rejectedWith(constants.REVERT);
});