Skip to content

Commit

Permalink
Merge pull request #370 from EYBlockchain/daveroga/review-test-e2e
Browse files Browse the repository at this point in the history
daveroga/review Check PR sdk tests
  • Loading branch information
Westlad authored Dec 15, 2021
2 parents 60f8725 + e839da9 commit 47a5fb6
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 45 deletions.
9 changes: 8 additions & 1 deletion cli/lib/nf3.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ class Nf3 {
@async
*/
async startProposer() {
const newGasBlockEmitter = new EventEmitter();
const connection = new WebSocket(this.optimistWsUrl);
this.websockets.push(connection); // save so we can close it properly later
connection.onopen = () => {
Expand All @@ -589,10 +590,16 @@ class Nf3 {
const msg = JSON.parse(message.data);
const { type, txDataToSign } = msg;
if (type === 'block') {
await this.submitTransaction(txDataToSign, this.stateContractAddress, this.BLOCK_STAKE);
const res = await this.submitTransaction(
txDataToSign,
this.stateContractAddress,
this.BLOCK_STAKE,
);
newGasBlockEmitter.emit('gascost', res.gasUsed);
}
};
// add this proposer to the list of peers that can accept direct transfers and withdraws
return newGasBlockEmitter;
}

/**
Expand Down
Loading

0 comments on commit 47a5fb6

Please sign in to comment.