We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is my test im new to coding
const Token = artifacts.require('Token') const EthSwap = artifacts.require('EthSwap')
require('chai') .use(require('chai-as-promised')) .should()
function tokens(n){ return web3.utils.toWei(n, 'ether') }
contract('EthSwap' , (accounts) => { let token, ethSwap
before(async() =>{ token = await Token.new() ethSwap = await EthSwap.new(token.address) // Transfer all tokens to EthSwap (1 million) await token.transfer(ethSwap.address, tokens('1000000'))
})
describe('Token deployment', async () => { it('contract has a name', async () => { let token = await Token.new() const name = await token.name() assert.equal(name, 'Renn Token') }) })
describe('EthSwap deployment', async () => { it('contract has a name', async () => { let ethSwap = await EthSwap.new() const name = await ethSwap.name() assert.equal(name, 'EthSwap Ethereum Exchange') })
it('contract has tokens', async() => { let balance = await token.balanceOf(ethSwap.address) assert.equal(balance.toString(), tokens('1000000')) }) })
describe('buyTokens()', async () => { it('Allows user to instantly purchase tokens from ethSwap for a fixed price', async () => { await ethSwap.buyTokens({ from: accounts[1], value: web3.utils.toWei('1', 'ether') }) }) })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
EthSwap deployment
contract has a name:
Error: Invalid number of parameters for "undefined". Got 0 expected 1!
This is my test im new to coding
const Token = artifacts.require('Token')
const EthSwap = artifacts.require('EthSwap')
require('chai')
.use(require('chai-as-promised'))
.should()
function tokens(n){
return web3.utils.toWei(n, 'ether')
}
contract('EthSwap' , (accounts) => {
let token, ethSwap
})
describe('Token deployment', async () => {
it('contract has a name', async () => {
let token = await Token.new()
const name = await token.name()
assert.equal(name, 'Renn Token')
})
})
describe('EthSwap deployment', async () => {
it('contract has a name', async () => {
let ethSwap = await EthSwap.new()
const name = await ethSwap.name()
assert.equal(name, 'EthSwap Ethereum Exchange')
})
describe('buyTokens()', async () => {
it('Allows user to instantly purchase tokens from ethSwap for a fixed price', async () => {
await ethSwap.buyTokens({ from: accounts[1], value: web3.utils.toWei('1', 'ether') })
})
})
})
The text was updated successfully, but these errors were encountered: