Updated generated contract wrappers and ran linter
This commit is contained in:
parent
365c056b0f
commit
24783107ba
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"version": "2.0.9",
|
"version": "2.0.9",
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
|
@ -20,6 +20,7 @@ pragma solidity ^0.5.5;
|
|||||||
|
|
||||||
import "./TestLogDecodingDownstream.sol";
|
import "./TestLogDecodingDownstream.sol";
|
||||||
|
|
||||||
|
|
||||||
contract TestLogDecoding {
|
contract TestLogDecoding {
|
||||||
|
|
||||||
/// @dev arbitrary event; fields to not matter.
|
/// @dev arbitrary event; fields to not matter.
|
||||||
|
@ -18,12 +18,14 @@
|
|||||||
|
|
||||||
pragma solidity ^0.5.5;
|
pragma solidity ^0.5.5;
|
||||||
|
|
||||||
|
|
||||||
contract ITestLogDecodingDownstream {
|
contract ITestLogDecodingDownstream {
|
||||||
|
|
||||||
/// @dev Emits a local event
|
/// @dev Emits a local event
|
||||||
function emitEvent() external;
|
function emitEvent() external;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
contract TestLogDecodingDownstream is
|
contract TestLogDecodingDownstream is
|
||||||
ITestLogDecodingDownstream
|
ITestLogDecodingDownstream
|
||||||
{
|
{
|
||||||
|
@ -16,13 +16,13 @@ describe.only('TestLogDecoding', () => {
|
|||||||
let testLogDecodingDeployedWithoutDependencies: TestLogDecodingContract;
|
let testLogDecodingDeployedWithoutDependencies: TestLogDecodingContract;
|
||||||
const expectedEvent = {
|
const expectedEvent = {
|
||||||
foo: new BigNumber(256),
|
foo: new BigNumber(256),
|
||||||
bar: "0x1234",
|
bar: '0x1234',
|
||||||
car: "4321",
|
car: '4321',
|
||||||
};
|
};
|
||||||
const expectedDownstreamEvent = {
|
const expectedDownstreamEvent = {
|
||||||
lorem: new BigNumber(256),
|
lorem: new BigNumber(256),
|
||||||
ipsum: "4321",
|
ipsum: '4321',
|
||||||
}
|
};
|
||||||
const emptyDependencyList = {};
|
const emptyDependencyList = {};
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
@ -30,13 +30,13 @@ describe.only('TestLogDecoding', () => {
|
|||||||
artifacts.TestLogDecoding,
|
artifacts.TestLogDecoding,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
emptyDependencyList
|
emptyDependencyList,
|
||||||
);
|
);
|
||||||
testLogDecodingWithDependencies = await TestLogDecodingContract.deployFrom0xArtifactAsync(
|
testLogDecodingWithDependencies = await TestLogDecodingContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestLogDecoding,
|
artifacts.TestLogDecoding,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
artifacts
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@ -50,21 +50,27 @@ describe.only('TestLogDecoding', () => {
|
|||||||
it('should decode locally emitted event args when no dependencies are passed into wrapper', async () => {
|
it('should decode locally emitted event args when no dependencies are passed into wrapper', async () => {
|
||||||
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEvent.awaitTransactionSuccessAsync();
|
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEvent.awaitTransactionSuccessAsync();
|
||||||
expect(txReceipt.logs.length).to.be.equal(1);
|
expect(txReceipt.logs.length).to.be.equal(1);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||||
});
|
});
|
||||||
it('should not event args when no dependencies are passed into wrapper', async () => {
|
it('should not event args when no dependencies are passed into wrapper', async () => {
|
||||||
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
||||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.undefined();//(emptyArgs);
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.undefined();
|
||||||
});
|
});
|
||||||
it('should decode locally emitted event args when dependencies are passed into wrapper', async () => {
|
it('should decode locally emitted event args when dependencies are passed into wrapper', async () => {
|
||||||
const txReceipt = await testLogDecodingWithDependencies.emitEvent.awaitTransactionSuccessAsync();
|
const txReceipt = await testLogDecodingWithDependencies.emitEvent.awaitTransactionSuccessAsync();
|
||||||
expect(txReceipt.logs.length).to.be.equal(1);
|
expect(txReceipt.logs.length).to.be.equal(1);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||||
});
|
});
|
||||||
it('should decode downstream event args when dependencies are passed into wrapper', async () => {
|
it('should decode downstream event args when dependencies are passed into wrapper', async () => {
|
||||||
const txReceipt = await testLogDecodingWithDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
const txReceipt = await testLogDecodingWithDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
||||||
expect(txReceipt.logs.length).to.be.equal(1);
|
expect(txReceipt.logs.length).to.be.equal(1);
|
||||||
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedDownstreamEvent);
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(
|
||||||
|
expectedDownstreamEvent,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user