Almost ready with deposits...

This commit is contained in:
Bruno Skvorc 2019-07-29 15:44:03 +02:00
parent 8223a2ed8e
commit a7c6640e43

View File

@ -214,17 +214,21 @@ async function makeValidatorDeposits() {
["amount", "uint64"], ["amount", "uint64"],
["signature", "bytes96"], ["signature", "bytes96"],
], ],
})); }), new BN('3').toBuffer('le', 8));
// A signer is needed to sign a transaction from a given account // A signer is needed to sign a transaction from a given account
let signer = provider.getSigner(item.address); let wallet = new ethers.Wallet(item.pk, provider);
contract.connect(signer); contract.connect(wallet);
let tx = contract.deposit(sign_pubkey, withdrawalCredentials, signature_d); let tx = await contract.deposit(sign_pubkey, withdrawal_credentials, signature_d);
console.log("Validator " + item.address + " is depositing 32 ether to the deposit contract at " + contractAddress + " via TX " + tx.hash); console.log("Validator " + item.address + " is depositing 32 ether to the deposit contract at " + contractAddress + " via TX " + tx.hash);
tx.wait();
}); });
serverStart();
}
function serverStart() {
const server = ganache.server(startupOptions); const server = ganache.server(startupOptions);
server.listen(8545, function(err, blockchain) { server.listen(8545, function(err, blockchain) {
// The server starts, you can connect to it with RPC now. // The server starts, you can connect to it with RPC now.