sync
This commit is contained in:
parent
4f0c48c240
commit
5286b6c110
|
|
@ -38,16 +38,29 @@ function Beneficiary() {
|
|||
var will_beneficiary = await eth.contractWithSigner.wills(response[i].toNumber());
|
||||
//console.log(response[i].toNumber());
|
||||
|
||||
var withdrawdateNew = timeConverter(will_beneficiary.withdrawDate.toNumber());
|
||||
|
||||
var myWill = {
|
||||
id: response[i].toNumber(),
|
||||
amount: ethers.utils.formatEther(will_beneficiary.amount),
|
||||
testator: will_beneficiary.testator,
|
||||
beneficiary: will_beneficiary.beneficiary,
|
||||
withdrawDate: withdrawdateNew
|
||||
try{
|
||||
var withdrawdateNew = timeConverter(will_beneficiary.withdrawDate.toNumber());
|
||||
var myWill = {
|
||||
id: response[i].toNumber(),
|
||||
amount: ethers.utils.formatEther(will_beneficiary.amount),
|
||||
testator: will_beneficiary.testator,
|
||||
beneficiary: will_beneficiary.beneficiary,
|
||||
withdrawDate: withdrawdateNew
|
||||
}
|
||||
}
|
||||
console.log(myWill)
|
||||
catch(e) {
|
||||
console.log("Invalid withdrawDate");
|
||||
var myWill = {
|
||||
id: response[i].toNumber(),
|
||||
amount: ethers.utils.formatEther(will_beneficiary.amount),
|
||||
testator: will_beneficiary.testator,
|
||||
beneficiary: will_beneficiary.beneficiary,
|
||||
withdrawDate: "Invalid withdrawDate: " + will_beneficiary.withdrawDate._hex
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
console.log(myWill)
|
||||
myBeneficiary.push(myWill);
|
||||
}
|
||||
setwill_beneficiary(myBeneficiary);
|
||||
|
|
|
|||
|
|
@ -42,10 +42,13 @@ async function withdraw(){
|
|||
<br/>
|
||||
<div className="btnArea">
|
||||
{ props.amount > 0 ?
|
||||
<div>
|
||||
<button className="withdrawBtn" onClick={withdraw} >Withdraw</button>
|
||||
</div>
|
||||
:
|
||||
<button className="withdrawBtn" onClick={withdraw} disabled>Withdraw</button>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -34,14 +34,25 @@ function Testator() {
|
|||
console.log(response[i].toNumber());
|
||||
var will_testator = await eth.contractWithSigner.wills(response[i].toNumber());
|
||||
|
||||
var withdrawdateNew = timeConverter(will_testator.withdrawDate.toNumber());
|
||||
|
||||
var myWill = {
|
||||
id: response[i].toNumber(),
|
||||
amount: ethers.utils.formatEther(will_testator.amount),
|
||||
testator: will_testator.testator,
|
||||
beneficiary: will_testator.beneficiary,
|
||||
withdrawDate: withdrawdateNew
|
||||
try{
|
||||
var withdrawdateNew = timeConverter(will_testator.withdrawDate.toNumber());
|
||||
var myWill = {
|
||||
id: response[i].toNumber(),
|
||||
amount: ethers.utils.formatEther(will_testator.amount),
|
||||
testator: will_testator.testator,
|
||||
beneficiary: will_testator.beneficiary,
|
||||
withdrawDate: withdrawdateNew
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
console.log("Invalid withdrawDate");
|
||||
var myWill = {
|
||||
id: response[i].toNumber(),
|
||||
amount: ethers.utils.formatEther(will_testator.amount),
|
||||
testator: will_testator.testator,
|
||||
beneficiary: will_testator.beneficiary,
|
||||
withdrawDate: "Invalid withdrawDate: " + will_testator.withdrawDate._hex,
|
||||
}
|
||||
}
|
||||
myWills.push(myWill);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue