update abi-gen with new method interfaces (#2325)
* update abi-gen with new method interfaces * wip: get all packages to build * wip: get all packages to build * Fix two contract wrapper calls * Export necessary types part of the contract wrapper public interfaces * Revive and fix wrapper_unit_tests * Remove duplicate type * Fix lib_exchange_rich_error_decoder tests * Fix remaining test failures in contracts-* packages * Prettier fixes * remove transactionHelper * lint and update changelogs * Fix prettier * Revert changes to reference docs * Add back changelog already published and add revert changelog entry * Add missing CHANGELOG entries * Add missing comma * Update mesh-rpc-client dep * Update Mesh RPC logic in @0x/orderbook to v6.0.1-beta * Align package versions
This commit is contained in:
@@ -61,7 +61,7 @@ describe('ERC721Token', () => {
|
||||
);
|
||||
logDecoder = new LogDecoder(web3Wrapper, artifacts);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await token.mint.sendTransactionAsync(owner, tokenId, { from: owner }),
|
||||
await token.mint(owner, tokenId).sendTransactionAsync({ from: owner }),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
});
|
||||
@@ -78,7 +78,7 @@ describe('ERC721Token', () => {
|
||||
const to = erc721Receiver.address;
|
||||
const unownedTokenId = new BigNumber(2);
|
||||
await expectTransactionFailedAsync(
|
||||
token.transferFrom.sendTransactionAsync(from, to, unownedTokenId),
|
||||
token.transferFrom(from, to, unownedTokenId).sendTransactionAsync(),
|
||||
RevertReason.Erc721ZeroOwner,
|
||||
);
|
||||
});
|
||||
@@ -86,7 +86,7 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = constants.NULL_ADDRESS;
|
||||
await expectTransactionFailedAsync(
|
||||
token.transferFrom.sendTransactionAsync(from, to, tokenId),
|
||||
token.transferFrom(from, to, tokenId).sendTransactionAsync(),
|
||||
RevertReason.Erc721ZeroToAddress,
|
||||
);
|
||||
});
|
||||
@@ -94,7 +94,7 @@ describe('ERC721Token', () => {
|
||||
const from = spender;
|
||||
const to = erc721Receiver.address;
|
||||
await expectTransactionFailedAsync(
|
||||
token.transferFrom.sendTransactionAsync(from, to, tokenId),
|
||||
token.transferFrom(from, to, tokenId).sendTransactionAsync(),
|
||||
RevertReason.Erc721OwnerMismatch,
|
||||
);
|
||||
});
|
||||
@@ -102,7 +102,7 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = erc721Receiver.address;
|
||||
await expectTransactionFailedAsync(
|
||||
token.transferFrom.sendTransactionAsync(from, to, tokenId, { from: spender }),
|
||||
token.transferFrom(from, to, tokenId).sendTransactionAsync({ from: spender }),
|
||||
RevertReason.Erc721InvalidSpender,
|
||||
);
|
||||
});
|
||||
@@ -110,9 +110,9 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = erc721Receiver.address;
|
||||
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await token.transferFrom.sendTransactionAsync(from, to, tokenId),
|
||||
await token.transferFrom(from, to, tokenId).sendTransactionAsync(),
|
||||
);
|
||||
const newOwner = await token.ownerOf.callAsync(tokenId);
|
||||
const newOwner = await token.ownerOf(tokenId).callAsync();
|
||||
expect(newOwner).to.be.equal(to);
|
||||
const log = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>;
|
||||
expect(log.args._from).to.be.equal(from);
|
||||
@@ -122,16 +122,16 @@ describe('ERC721Token', () => {
|
||||
it('should transfer the token if spender is approved for all', async () => {
|
||||
const isApproved = true;
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await token.setApprovalForAll.sendTransactionAsync(spender, isApproved),
|
||||
await token.setApprovalForAll(spender, isApproved).sendTransactionAsync(),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
const from = owner;
|
||||
const to = erc721Receiver.address;
|
||||
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await token.transferFrom.sendTransactionAsync(from, to, tokenId),
|
||||
await token.transferFrom(from, to, tokenId).sendTransactionAsync(),
|
||||
);
|
||||
const newOwner = await token.ownerOf.callAsync(tokenId);
|
||||
const newOwner = await token.ownerOf(tokenId).callAsync();
|
||||
expect(newOwner).to.be.equal(to);
|
||||
const log = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>;
|
||||
expect(log.args._from).to.be.equal(from);
|
||||
@@ -140,19 +140,19 @@ describe('ERC721Token', () => {
|
||||
});
|
||||
it('should transfer the token if spender is individually approved', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await token.approve.sendTransactionAsync(spender, tokenId),
|
||||
await token.approve(spender, tokenId).sendTransactionAsync(),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
|
||||
const from = owner;
|
||||
const to = erc721Receiver.address;
|
||||
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await token.transferFrom.sendTransactionAsync(from, to, tokenId),
|
||||
await token.transferFrom(from, to, tokenId).sendTransactionAsync(),
|
||||
);
|
||||
const newOwner = await token.ownerOf.callAsync(tokenId);
|
||||
const newOwner = await token.ownerOf(tokenId).callAsync();
|
||||
expect(newOwner).to.be.equal(to);
|
||||
|
||||
const approvedAddress = await token.getApproved.callAsync(tokenId);
|
||||
const approvedAddress = await token.getApproved(tokenId).callAsync();
|
||||
expect(approvedAddress).to.be.equal(constants.NULL_ADDRESS);
|
||||
const log = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>;
|
||||
expect(log.args._from).to.be.equal(from);
|
||||
@@ -165,9 +165,9 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = spender;
|
||||
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await token.safeTransferFrom1.sendTransactionAsync(from, to, tokenId),
|
||||
await token.safeTransferFrom1(from, to, tokenId).sendTransactionAsync(),
|
||||
);
|
||||
const newOwner = await token.ownerOf.callAsync(tokenId);
|
||||
const newOwner = await token.ownerOf(tokenId).callAsync();
|
||||
expect(newOwner).to.be.equal(to);
|
||||
const log = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>;
|
||||
expect(log.args._from).to.be.equal(from);
|
||||
@@ -186,7 +186,7 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = contract.address;
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
token.safeTransferFrom1.sendTransactionAsync(from, to, tokenId),
|
||||
token.safeTransferFrom1(from, to, tokenId).sendTransactionAsync(),
|
||||
);
|
||||
});
|
||||
it('should revert if onERC721Received does not return the correct value', async () => {
|
||||
@@ -199,7 +199,7 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = invalidErc721Receiver.address;
|
||||
await expectTransactionFailedAsync(
|
||||
token.safeTransferFrom1.sendTransactionAsync(from, to, tokenId),
|
||||
token.safeTransferFrom1(from, to, tokenId).sendTransactionAsync(),
|
||||
RevertReason.Erc721InvalidSelector,
|
||||
);
|
||||
});
|
||||
@@ -207,9 +207,9 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = erc721Receiver.address;
|
||||
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await token.safeTransferFrom1.sendTransactionAsync(from, to, tokenId),
|
||||
await token.safeTransferFrom1(from, to, tokenId).sendTransactionAsync(),
|
||||
);
|
||||
const newOwner = await token.ownerOf.callAsync(tokenId);
|
||||
const newOwner = await token.ownerOf(tokenId).callAsync();
|
||||
expect(newOwner).to.be.equal(to);
|
||||
const transferLog = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>;
|
||||
const receiverLog = txReceipt.logs[1] as LogWithDecodedArgs<DummyERC721ReceiverTokenReceivedEventArgs>;
|
||||
@@ -228,9 +228,9 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = spender;
|
||||
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await token.safeTransferFrom2.sendTransactionAsync(from, to, tokenId, data),
|
||||
await token.safeTransferFrom2(from, to, tokenId, data).sendTransactionAsync(),
|
||||
);
|
||||
const newOwner = await token.ownerOf.callAsync(tokenId);
|
||||
const newOwner = await token.ownerOf(tokenId).callAsync();
|
||||
expect(newOwner).to.be.equal(to);
|
||||
const log = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>;
|
||||
expect(log.args._from).to.be.equal(from);
|
||||
@@ -249,7 +249,7 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = contract.address;
|
||||
await expectTransactionFailedWithoutReasonAsync(
|
||||
token.safeTransferFrom2.sendTransactionAsync(from, to, tokenId, data),
|
||||
token.safeTransferFrom2(from, to, tokenId, data).sendTransactionAsync(),
|
||||
);
|
||||
});
|
||||
it('should revert if onERC721Received does not return the correct value', async () => {
|
||||
@@ -262,7 +262,7 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = invalidErc721Receiver.address;
|
||||
await expectTransactionFailedAsync(
|
||||
token.safeTransferFrom2.sendTransactionAsync(from, to, tokenId, data),
|
||||
token.safeTransferFrom2(from, to, tokenId, data).sendTransactionAsync(),
|
||||
RevertReason.Erc721InvalidSelector,
|
||||
);
|
||||
});
|
||||
@@ -270,9 +270,9 @@ describe('ERC721Token', () => {
|
||||
const from = owner;
|
||||
const to = erc721Receiver.address;
|
||||
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await token.safeTransferFrom2.sendTransactionAsync(from, to, tokenId, data),
|
||||
await token.safeTransferFrom2(from, to, tokenId, data).sendTransactionAsync(),
|
||||
);
|
||||
const newOwner = await token.ownerOf.callAsync(tokenId);
|
||||
const newOwner = await token.ownerOf(tokenId).callAsync();
|
||||
expect(newOwner).to.be.equal(to);
|
||||
const transferLog = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>;
|
||||
const receiverLog = txReceipt.logs[1] as LogWithDecodedArgs<DummyERC721ReceiverTokenReceivedEventArgs>;
|
||||
|
||||
Reference in New Issue
Block a user