@0x/contracts-asset-proxy: Add signature validation.

This commit is contained in:
Lawrence Forman
2019-09-28 01:54:09 -04:00
parent 82ac8e29e3
commit 7762b7b665
3 changed files with 37 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import {
expect,
filterLogsToArguments,
getRandomInteger,
hexRandom,
Numberish,
randomAddress,
TransactionHelper,
@@ -20,7 +21,7 @@ import {
TestEth2DaiBridgeTokenTransferEventArgs,
} from '../src';
blockchainTests.resets('Eth2DaiBridge unit tests', env => {
blockchainTests.resets.only('Eth2DaiBridge unit tests', env => {
const txHelper = new TransactionHelper(env.web3Wrapper, artifacts);
let testContract: TestEth2DaiBridgeContract;
let daiTokenAddress: string;
@@ -47,6 +48,14 @@ blockchainTests.resets('Eth2DaiBridge unit tests', env => {
});
});
describe('isValidSignature()', () => {
it('returns success bytes', async () => {
const LEGACY_WALLET_MAGIC_VALUE = '0xb0671381';
const result = await testContract.isValidSignature.callAsync(hexRandom(), hexRandom(_.random(0, 32)));
expect(result).to.eq(LEGACY_WALLET_MAGIC_VALUE);
});
});
describe('transfer()', () => {
interface TransferOpts {
toTokenAddress: string;