Last active
January 17, 2018 21:03
-
-
Save Arieg419/f4a968ee7a8d6a23fabac1d28a22963f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MoveFundsAfterDateContract = { | |
balance: 400, | |
expirationDate: new Date("October 13, 2016 11:13:00"), | |
id: 2, | |
fromAddress: "Bob", | |
call: function() { | |
return { getBalance: this.balance, getFromAddress: this.fromAddress }; | |
}, | |
send: function() { | |
return { changeBalance: this.changeBalance }; | |
}, | |
abi: function() { | |
return { callables: this.call(), sendables: this.send() }; | |
}, | |
moveFunds: function() { | |
var currentDate = new Date(); | |
if (currentDate > this.expirationDate) { | |
return { | |
senderNodeId: "B", | |
senderAddress: "Bob", | |
recipientNodeId: "A", | |
recipientAddress: "Alice", | |
value: 20, | |
action: "TRANSACTION_EXTERNAL_ACCOUNT" | |
}; | |
} | |
return null; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment