generated from Borodutch/frontend-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from BigWhaleLabs/send-ready-event-every-second
send Ready event every second and remove old listeners
- Loading branch information
Showing
10 changed files
with
87 additions
and
114 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const messages = [ | ||
'Reading Wtns', | ||
'Reading Coeffs', | ||
'Building ABC', | ||
'QAP AB', | ||
'QAP C', | ||
'IFFT_A: fft 14 mix start', | ||
'IFFT_A: fft 14 mix end', | ||
'IFFT_A: fft 14 join', | ||
'FFT_A: fft 14 mix start', | ||
'FFT_A: fft 14 mix end', | ||
'FFT_A: fft 14 join', | ||
'IFFT_B: fft 14 mix start', | ||
'IFFT_B: fft 14 mix end', | ||
'IFFT_B: fft 14 join', | ||
'FFT_B: fft 14 mix start', | ||
'FFT_B: fft 14 mix end', | ||
'FFT_B: fft 14 join', | ||
'IFFT_C: fft 14 mix start', | ||
'IFFT_C: fft 14 mix end', | ||
'IFFT_C: fft 14 join', | ||
'FFT_C: fft 14 mix start', | ||
'FFT_C: fft 14 mix end', | ||
'FFT_C: fft 14 join', | ||
'Reading A Points', | ||
'Reading B1 Points', | ||
'Reading B2 Points', | ||
'Reading C Points', | ||
'Reading H Points', | ||
] | ||
|
||
export default function getProofProgress(log: string) { | ||
const position = messages.findIndex((message) => log.startsWith(message)) | ||
if (position === -1) return null | ||
return (position * 100) / messages.length | ||
} |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Messages from 'models/Messages' | ||
import ProofResultStatus from 'models/ProofResultStatus' | ||
import getProofProgress from 'helpers/getProofProgress' | ||
import postWebViewMessage from 'helpers/postWebViewMessage' | ||
|
||
export default function onProofProgress(id: string) { | ||
return (info: string) => { | ||
postWebViewMessage({ | ||
data: { | ||
info, | ||
percent: getProofProgress(info), | ||
status: ProofResultStatus.ProofGeneration, | ||
}, | ||
id, | ||
type: Messages.GetProofStatus, | ||
}) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.