This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix decodeLog() for non indexed params
Fix `decodeLog()` for non indexed params. The issue can be reproduced for events like this: ``` event Authorize( bytes32 indexed platformId, bytes32 indexed uid, address indexed user, AuthorizationRequest request ); ``` It is cause by `_mapTypes(types)` used in `decodeParameters(outputs, bytes)` (`var res = this.ethersAbiCoder.decode(this._mapTypes(outputs), "0x".concat(bytes.replace(/0x/i, '')));`) which returns `[ { indexed: false, name: 'request', type: 'address' } ]` for `types = outputs = [null, null, null, {"indexed":false,"name":"request","type":"address"}]` passed as argument. So when the iteration `outputs.forEach(function (output, i) {}` is performed the `returnValues` do not get `res[i]` assigned correctly because the index is shifted due to empty types cleanup. The fix might be linked to the following issue: web3#2268
- Loading branch information