I am trying to run a test with truffle.
But I am getting an error:
Error: Invalid number of arguments to Solidity function
My contract looks like this:
pragma solidity ^0.4.0;
contract Leontest1 {
uint flight_number;
uint day_number;
string low_no = "This is a low flight number";
function Leontest1() {
//contructor
}
function low_numbers (uint flight_number) returns (string) {
if (flight_number > 6) {low_no = "This is not a low flight number";} else {low_no = low_no;}
return low_no;
}
}
And my test.js looks like this:
var Leontest1 = artifacts.require("./Leontest1.sol");
contract('Leontest1:low_numbers', function(accounts) {
it("should assert true", async function() {
const contract = await Leontest1.deployed();
await contract.low_numbers(5);
const result = await contract.low_numbers.call();
assert.equal(result,"This is a low flight number");
});
});
Can someone help me please?
I am using Truffle v4.1.7
Thanks in advance,