This is my doctor contract.
pragma solidity ^0.4.24;
contract doctor {
struct doctor_ds {
address doctor_address;
string speciality;
}
mapping(address => doctor_ds) public doctors_list;
address hospital_address;
function doctor() {
hospital_address = msg.sender;
}
function add_doctors(address _new_doctor_address, string _speciality) {
doctors_list[_new_doctor_address].doctor_address = _new_doctor_address;
doctors_list[_new_doctor_address].speciality = _speciality;
}
function doctor_exist(address _doctor) public view returns(bool) {
if (doctors_list[_doctor].doctor_address == _doctor) {
return true;
} else {
return false;
}
}
}
================
This my patient contract.
pragma solidity ^0.4.24;
import "./doctor.sol";
contract patient {
doctor doctor_obj;
function patient(address _doctor_contract) {
doctor_obj = doctor(_doctor_contract);
}
function check_if_doctor(address _ddoctor) returns(bool) {
return doctor_obj.doctor_exist(_ddoctor);
}
function add_doc(address _d, string _s) {
doctor_obj.add_doctors(_d, _s);
}
function A() payable {
}
}
I am getting gas exceeded error, when i am calling doctor exists in patient contract(using remix and private ethereum blockchain) and also i want to create front end for patient contract, But How doctor contact's ABI will used in calling patient contract's add_doc and check_if_doctor functions. I don't know code for web3js when contracts interact with each other. Somebody please help