Comparing version 0.1.4 to 0.1.5
const SolidityEvent = require('web3/lib/web3/event.js'); | ||
function decodeLogs (logs, contract) { | ||
return logs.map(log => { | ||
const event = new SolidityEvent(null, contract.events[log.topics[0]], '0x0'); | ||
return event.decode(log); | ||
}); | ||
const decodedLogs = []; | ||
for (const log of logs) { | ||
const eventName = log.topics[0]; | ||
if (eventName in contract.events) { | ||
const eventType = new SolidityEvent(null, contract.events[eventName], '0x0'); | ||
decodedLogs.push(eventType.decode(log)); | ||
} | ||
} | ||
return decodedLogs; | ||
} | ||
module.exports = decodeLogs |
const abi = require('ethereumjs-abi') | ||
function encodeCall(name, arguments = [], rawValues = []) { | ||
function encodeCall(name, args = [], rawValues = []) { | ||
const values = rawValues.map(value => value.toString()) // convert BigNumbers to string | ||
const methodId = abi.methodID(name, arguments).toString('hex'); | ||
const params = abi.rawEncode(arguments, values).toString('hex'); | ||
const methodId = abi.methodID(name, args).toString('hex'); | ||
const params = abi.rawEncode(args, values).toString('hex'); | ||
return '0x' + methodId + params; | ||
@@ -8,0 +8,0 @@ } |
{ | ||
"name": "zos-lib", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "zeppelin_os library", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
212594
62
1636