Fix Rich Error test bind context

This commit is contained in:
Jacob Evans 2019-11-16 19:38:04 +10:00
parent 62def596af
commit 469c10e45f
No known key found for this signature in database
GPG Key ID: 2036DA2ADDFB0842

View File

@ -40,7 +40,8 @@ blockchainTests.resets('LibExchangeRichErrorDecoder', ({ provider, txDefaults })
// Solidity counterparts. // Solidity counterparts.
const endpointName = `decode${revert.name}`; const endpointName = `decode${revert.name}`;
const callAsync = (_encoded: string) => { const callAsync = (_encoded: string) => {
return (decoder as any)[endpointName](_encoded).callAsync.call((decoder as any)[endpointName]); const wrapperFunctions = (decoder as any)[endpointName](_encoded);
return wrapperFunctions.callAsync.bind(wrapperFunctions).call((decoder as any)[endpointName]);
}; };
describe(`${endpointName}()`, async () => { describe(`${endpointName}()`, async () => {
it('decodes encoded parameters', async () => { it('decodes encoded parameters', async () => {