diff --git a/Course_Identity_And_Smart_Contracts/starNotaryv2/test/TestStarNotary.js b/Course_Identity_And_Smart_Contracts/starNotaryv2/test/TestStarNotary.js index 7b02f4fc..b14b19f5 100644 --- a/Course_Identity_And_Smart_Contracts/starNotaryv2/test/TestStarNotary.js +++ b/Course_Identity_And_Smart_Contracts/starNotaryv2/test/TestStarNotary.js @@ -11,7 +11,7 @@ contract('StarNotary', (accs) => { it('can Create a Star', async() => { let tokenId = 1; let instance = await StarNotary.deployed(); - await instance.createStar('Awesome Star!', tokenId, {from: accounts[0]}) + await instance.createStar('Awesome Star!', tokenId, {from: owner}) assert.equal(await instance.tokenIdToStarInfo.call(tokenId), 'Awesome Star!') }); @@ -51,7 +51,6 @@ it('lets user2 buy a star, if it is put up for sale', async() => { let balance = web3.utils.toWei(".05", "ether"); await instance.createStar('awesome star', starId, {from: user1}); await instance.putStarUpForSale(starId, starPrice, {from: user1}); - let balanceOfUser1BeforeTransaction = await web3.eth.getBalance(user2); await instance.buyStar(starId, {from: user2, value: balance}); assert.equal(await instance.ownerOf.call(starId), user2); }); @@ -65,7 +64,6 @@ it('lets user2 buy a star and decreases its balance in ether', async() => { let balance = web3.utils.toWei(".05", "ether"); await instance.createStar('awesome star', starId, {from: user1}); await instance.putStarUpForSale(starId, starPrice, {from: user1}); - let balanceOfUser1BeforeTransaction = await web3.eth.getBalance(user2); const balanceOfUser2BeforeTransaction = await web3.eth.getBalance(user2); await instance.buyStar(starId, {from: user2, value: balance, gasPrice:0}); const balanceAfterUser2BuysStar = await web3.eth.getBalance(user2);