Updated sendTransaction, added tests. (#1528)

* Renamed sendTransaction to send, improved API.

* Added send tests.

* Now using promisified web3
This commit is contained in:
Nicolás Venturo
2018-12-01 02:47:32 -03:00
committed by GitHub
parent 88e8c7c94b
commit c0bda4db88
7 changed files with 107 additions and 22 deletions

View File

@ -2,7 +2,7 @@ const expectEvent = require('../../helpers/expectEvent');
const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior');
const shouldFail = require('../../helpers/shouldFail');
const { ZERO_ADDRESS } = require('../../helpers/constants');
const { sendTransaction } = require('../../helpers/sendTransaction');
const send = require('../../helpers/send');
const ERC721ReceiverMock = artifacts.require('ERC721ReceiverMock.sol');
const BigNumber = web3.BigNumber;
@ -217,7 +217,7 @@ function shouldBehaveLikeERC721 (
describe('via safeTransferFrom', function () {
const safeTransferFromWithData = function (from, to, tokenId, opts) {
return sendTransaction(
return send.transaction(
this.token,
'safeTransferFrom',
'address,address,uint256,bytes',

View File

@ -1,5 +1,5 @@
const shouldFail = require('../../helpers/shouldFail');
const { sendTransaction } = require('../../helpers/sendTransaction');
const send = require('../../helpers/send');
const { ZERO_ADDRESS } = require('../../helpers/constants');
const BigNumber = web3.BigNumber;
@ -36,7 +36,7 @@ function shouldBehaveLikeERC721PausedToken (owner, [recipient, operator]) {
it('reverts when trying to safeTransferFrom with data', async function () {
await shouldFail.reverting(
sendTransaction(
send.transaction(
this.token,
'safeTransferFrom',
'address,address,uint256,bytes',