-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified to be an issue.Verified to be an issue.fixed/completeThis Bug is fixed or Enhancement is complete and published.This Bug is fixed or Enhancement is complete and published.
Description
although it is undocumented but event.args actually can get event property via string instead of array, for example:
// solidity
event ValueChanged(address indexed author, string oldValue, string newValue);
function setValue(string value) public {
emit ValueChanged(msg.sender, _value, value);
_value = value;
}
// javascript
const tx = await contractWithSigner.setValue("I like turtles.");
const receipt = await tx.wait();
console.log(receipt.events[0].args.newValue)
// print "I like turtles."
console.log(receipt.events[0].args[2])
// same "I like turtles."
it works in javascript but does not work in typescript since args
is defined as any[]:
export interface Event extends Log {
args?: Array<any>;
// ...
}
PR is on the way to fix it.
KimiWu123
Metadata
Metadata
Assignees
Labels
bugVerified to be an issue.Verified to be an issue.fixed/completeThis Bug is fixed or Enhancement is complete and published.This Bug is fixed or Enhancement is complete and published.