Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var CarData = artifacts.require("./CarData.sol");
- contract("CarData", function(accounts) {
- //setting up the account[1] will lead to revert, because account[1] is not allowed to call the method
- it('should revert the transaction of insertCarData when the from parameter is not the owner of the contract', function() {
- return CarData.deployed()
- .then(function (instance) {
- instance = CarData.at('0x34e92dda73951fd2245c70f396f7379af21e9148');
- instance.getPastEvents('logCarDataInserted', {
- filter: {},
- fromBlock: 0,
- toBlock: 'latest'
- }, function(error, result) {
- if(error) {
- console.log(error, 'error');
- } else {
- console.log(result, 'result');
- }
- });
- return instance.insertCarData("BG123456641", 1529767983, 1529767983, 1529767983, "1994", "Bulgaria", "Red", {from: accounts[0]});
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement