Skip to content

Commit

Permalink
v3 Alpha Contract and Tests Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
remedcu committed Nov 14, 2020
1 parent 31240d0 commit c24447b
Show file tree
Hide file tree
Showing 21 changed files with 957 additions and 156 deletions.
8 changes: 4 additions & 4 deletions client/approver.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const checkRights = () => {
let approverHTML = document.getElementById("approverHTML");
inherichain.methods
.approverStatus(accounts[0])
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
if (!values) {
window.alert("You don't have the rights of approver.");
Expand All @@ -76,7 +76,7 @@ const initWalletAddress = () => {
inherichain = initContract(address);
inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
// Storing the data in localstorage (cache)
localStorage.setItem("inherichainWalletAddress", address);
Expand Down Expand Up @@ -123,7 +123,7 @@ const initApp = () => {
}
inherichain.methods
.approveHeir(value)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
approverAcceptanceStatus.innerHTML = "Success!";
})
Expand All @@ -139,7 +139,7 @@ const initApp = () => {
e.preventDefault();
inherichain.methods
.initiateCharity()
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
initiateCharityStatus.innerHTML = "Success!";
})
Expand Down
6 changes: 3 additions & 3 deletions client/backupOwner.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const checkRights = () => {
let backupOwnerHTML = document.getElementById("backupOwnerHTML");
inherichain.methods
.backupOwner()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
if (values != accounts[0]) {
window.alert("You don't have the rights of backup owner.");
Expand All @@ -75,7 +75,7 @@ const initWalletAddress = () => {
inherichain = initContract(address);
inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
// Storing the data in localstorage (cache)
localStorage.setItem("inherichainWalletAddress", address);
Expand Down Expand Up @@ -112,7 +112,7 @@ const initApp = () => {
const address = e.target.elements[0].value;
inherichain.methods
.updateOwner(address)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
backupOwnerUpdateOwnerStatus.innerHTML = "Success!";
})
Expand Down
6 changes: 3 additions & 3 deletions client/charity.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const checkRights = () => {
let charityHTML = document.getElementById("charityHTML");
inherichain.methods
.charity()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
if (values != accounts[0]) {
window.alert("You don't have the rights of charity.");
Expand All @@ -75,7 +75,7 @@ const initWalletAddress = () => {
inherichain = initContract(address);
inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
// Storing the data in localstorage (cache)
localStorage.setItem("inherichainWalletAddress", address);
Expand Down Expand Up @@ -124,7 +124,7 @@ const initApp = () => {
approverDeadline,
charityDeadline
)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
accessWalletCharityStatus.innerHTML = `Success!`;
})
Expand Down
10 changes: 5 additions & 5 deletions client/heir.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const checkRights = () => {
let heirHTML = document.getElementById("heirHTML");
inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
if (values != accounts[0]) {
window.alert("You don't have the rights of heir.");
Expand All @@ -75,7 +75,7 @@ const initWalletAddress = () => {
inherichain = initContract(address);
inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
// Storing the data in localstorage (cache)
localStorage.setItem("inherichainWalletAddress", address);
Expand Down Expand Up @@ -125,7 +125,7 @@ const initApp = () => {
e.preventDefault();
inherichain.methods
.claimOwnership()
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
heirClaimOwnershipStatus.innerHTML = "Success!";
})
Expand Down Expand Up @@ -156,7 +156,7 @@ const initApp = () => {
approverDeadline,
charityDeadline
)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
accessWalletApproverStatus.innerHTML = `Success!`;
})
Expand Down Expand Up @@ -187,7 +187,7 @@ const initApp = () => {
approverDeadline,
charityDeadline
)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
accessWalletDeadlineStatus.innerHTML = `Success!`;
})
Expand Down
26 changes: 13 additions & 13 deletions client/interact.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const initWalletAddress = () => {
inherichain = initContract(address);
inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
// Storing the data in localstorage (cache)
localStorage.setItem("inherichainWalletAddress", address);
Expand Down Expand Up @@ -136,7 +136,7 @@ const getData = () => {

inherichain.methods
.owner()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
currentOwner.innerHTML = values;
})
Expand All @@ -147,7 +147,7 @@ const getData = () => {

inherichain.methods
.backupOwner()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
currentBackupOwner.innerHTML = values;
})
Expand All @@ -159,7 +159,7 @@ const getData = () => {

inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
currentHeir.innerHTML = values;
})
Expand All @@ -170,7 +170,7 @@ const getData = () => {

inherichain.methods
.charity()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
currentCharity.innerHTML = values;
})
Expand All @@ -181,15 +181,15 @@ const getData = () => {

inherichain.methods
.approversLength()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
approversLength = values;
approvers.innerHTML =
'<div class="col-sm-6">Approver Count : ' + approversLength + "</div>";
for (let index = 0; index < approversLength; index++) {
inherichain.methods
.approvers(index)
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
let temp = index + 1;
approvers.innerHTML +=
Expand All @@ -212,7 +212,7 @@ const getData = () => {

inherichain.methods
.heirDeadline()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
deadline.innerHTML = convertSectoDay(values);
})
Expand All @@ -223,7 +223,7 @@ const getData = () => {

inherichain.methods
.heirApprovedDeadline()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
approverDeadline.innerHTML = convertSectoDay(values);
})
Expand All @@ -234,7 +234,7 @@ const getData = () => {

inherichain.methods
.charityDeadline()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
charityDeadline.innerHTML = convertSectoDay(values);
})
Expand All @@ -245,7 +245,7 @@ const getData = () => {

inherichain.methods
.status()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
contractStatus.innerHTML = status[values];
})
Expand All @@ -256,7 +256,7 @@ const getData = () => {

inherichain.methods
.claimTime()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
claimTime.innerHTML = values;
})
Expand All @@ -267,7 +267,7 @@ const getData = () => {

inherichain.methods
.voteCount()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
voteCount.innerHTML = values;
})
Expand Down
24 changes: 12 additions & 12 deletions client/owner.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const checkRights = () => {
let ownerHTML = document.getElementById("ownerHTML");
inherichain.methods
.owner()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
if (values != accounts[0]) {
window.alert("You don't have the rights of owner.");
Expand All @@ -69,7 +69,7 @@ const initWalletAddress = () => {
inherichain = initContract(address);
inherichain.methods
.heir()
.call({from: accounts[0]})
.call({ from: accounts[0] })
.then((values) => {
// Storing the data in localstorage (cache)
localStorage.setItem("inherichainWalletAddress", address);
Expand Down Expand Up @@ -182,7 +182,7 @@ const initApp = () => {
const address = e.target.elements[0].value;
inherichain.methods
.updateBackupOwner(address)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerUpdateBackupOwnerStatus.innerHTML = "Success!";
})
Expand All @@ -199,7 +199,7 @@ const initApp = () => {
const address = e.target.elements[0].value;
inherichain.methods
.updateHeir(address)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerUpdateHeirStatus.innerHTML = "Success!";
})
Expand All @@ -216,7 +216,7 @@ const initApp = () => {
const address = e.target.elements[0].value;
inherichain.methods
.updateCharity(address)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerUpdateCharityStatus.innerHTML = "Success!";
})
Expand All @@ -233,7 +233,7 @@ const initApp = () => {
const address = e.target.elements[0].value;
inherichain.methods
.addApprover(address)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerAddApproverStatus.innerHTML = "Success!";
})
Expand All @@ -250,7 +250,7 @@ const initApp = () => {
const address = e.target.elements[0].value;
inherichain.methods
.deleteApprover(address)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerDeleteApproverStatus.innerHTML = "Success!";
})
Expand All @@ -269,7 +269,7 @@ const initApp = () => {
const charityDeadline = e.target.elements[2].value;
inherichain.methods
.updateDeadline(deadline, approverDeadline, charityDeadline)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerUpdateDeadlineStatus.innerHTML = "Success!";
})
Expand All @@ -287,7 +287,7 @@ const initApp = () => {
const address = e.target.elements[1].value;
inherichain.methods
.transferETH(address, amount)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerTransferSomeETHStatus.innerHTML = "Success!";
})
Expand All @@ -304,7 +304,7 @@ const initApp = () => {
const amount = web3.utils.toWei(e.target.elements[0].value);
inherichain.methods
.withdrawSomeETH(amount)
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerWithdrawSomeETHStatus.innerHTML = "Success!";
})
Expand All @@ -320,7 +320,7 @@ const initApp = () => {
e.preventDefault();
inherichain.methods
.withdrawAllETH()
.send({from: accounts[0]})
.send({ from: accounts[0] })
.then(() => {
ownerWithdrawAllETHStatus.innerHTML = "Success!";
})
Expand Down Expand Up @@ -360,7 +360,7 @@ const initApp = () => {
const bytecode = e.target.elements[1].value;
inherichain.methods
.deployContract(amount, bytecode)
.send({from: accounts[0], value: web3.utils.toWei(amount)})
.send({ from: accounts[0], value: web3.utils.toWei(amount) })
.then(() => {
ownerDeployContractStatus.innerHTML = "Success!";
})
Expand Down

0 comments on commit c24447b

Please sign in to comment.