How to use openzeppelin-test-helpers - 10 common examples

To help you get started, we’ve selected a few openzeppelin-test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matryx / MatryxPlatform / test / 08LogicUpgrade.js View on Github external
it('Revert when making a call to library with incorrect address in system', async function() {
    data = await init()
    platform = data.platform
    system = Contract(MatryxSystem.address, IMatryxSystem)
    const versions = await system.getAllVersions()
    const v = await system.getVersion()
    console.log(`all versions: ${versions} (system ${system.address}) `)
    await system.setContract(1, stb("LibCommit"), MatryxSystem.address)
    const tx = commit.getInitialCommits()

    await shouldFail.reverting(tx)
  })
github iExecBlockchainComputing / PoCo / test / byFunctions / IexecHub / 03_reveal.js View on Github external
it("[4.2] Reveal - Error (unset)", async () => {
		await shouldFail.reverting(IexecHubInstance.reveal(
			tasks[2],
			odbtools.hashResult(tasks[2], "true").digest,
			{ from: worker1, gas: constants.AMOUNT_GAS_PROVIDED }
		));
	});
github OpenZeppelin / openzeppelin-contracts-ethereum-package / test / drafts / ERC777 / ERC777.behavior.js View on Github external
it('reverts when sending more than the balance', async function () {
        const balance = await this.token.balanceOf(holder);
        await shouldFail.reverting(this.token.send(recipient, balance.addn(1), data, { from: holder }));
      });
github Amxx / KitsuneWallet-ERC1836 / test / 001_withMasterOwnable.js View on Github external
it("Unauthorized execute", async () => {
		assert.equal(await web3.eth.getBalance(Ident.address), web3.utils.toWei("0.50", "ether"));

		await shouldFail.reverting(Ident.execute(
			0,
			user2,
			web3.utils.toWei("0.50", "ether"),
			"0x",
			{ from: user2 }
		));

		assert.equal(await web3.eth.getBalance(Ident.address), web3.utils.toWei("0.50", "ether"));
	});
github iExecBlockchainComputing / PoCo / test / byFunctions / IexecHub / 01_initialize.js View on Github external
it("[1.2] Initialization - Error (low id)", async () => {
		await shouldFail.reverting(IexecHubInstance.initialize(deals[1], 0, { from: scheduler, gas: constants.AMOUNT_GAS_PROVIDED }));
	});
github matryx / MatryxPlatform / test / 02Tournament.js View on Github external
it('Unable to create a tournament with 0 bounty', async function() {
    let rData = {
      start: 0,
      duration: 30,
      review: 20,
      bounty: 0
    }
    let tData = {
      content: 'content',
      bounty: 0,
      entryFee: web3.toWei(2)
    }

    let tx = platform.createTournament(tData, rData)
    await shouldFail.reverting(tx)
  })
github matryx / MatryxPlatform / test / 08LogicUpgrade.js View on Github external
it("Unable to create the same version twice", async function() {
    await system.createVersion(25)
    const tx = system.createVersion(25)
    await shouldFail.reverting(tx)
  })
github matryx / MatryxPlatform / test / 08LogicUpgrade.js View on Github external
it('Revert when setting library that has no code', async function() {
    data = await init()
    platform = data.platform
    system = data.system
    const tx = system.setContract(1, stb("LibPlatform"), accounts[0])
    await shouldFail.reverting(tx)
  })
github matryx / MatryxPlatform / test / 05Submission.js View on Github external
it('Unable to use the same commit hash for 2 submissions in the same round', async () => {
    let submissionHash = await createSubmission(t, '0x00', toWei(10), 1)
    let { commitHash } = await platform.getSubmission(submissionHash)

    t.accountNumber = 1
    let tx = t.createSubmission('content', commitHash)
    await shouldFail.reverting(tx)
  })
})
github matryx / MatryxPlatform / test / 04Commit.js View on Github external
it('Cannot add user to a group twice', async () => {
    let commitHash = await createCommit('0x00', false, genId(16), toWei(1), 0)
    await commit.addGroupMember(commitHash, accounts[1])

    let tx = commit.addGroupMember(commitHash, accounts[1])
    await shouldFail.reverting(tx)
  })

openzeppelin-test-helpers

JavaScript testing helpers for Ethereum smart contract development.

MIT
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Popular openzeppelin-test-helpers functions