-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/extends capacity refactor #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
e90e1df
d83db72
9b68f1e
ab624cf
ddbdaec
a4198e5
6438969
e3bd752
3279a1f
76b09d2
9598a40
86de7f8
dee1283
d3244b2
c5e08d4
ea69238
e6076d7
5219318
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| import { PostageBatch } from '@ethersphere/bee-js' | ||
| import { stampGetCounter, stampGetErrorCounter } from './counters' | ||
| import { logger } from '../logger' | ||
| import { ERROR_NO_STAMP, StampsConfig, StampsConfigAutobuy, StampsConfigExtends } from '../config' | ||
| import { ERROR_NO_STAMP, StampsConfig } from '../config' | ||
|
|
||
| export interface StampsManager { | ||
| start?: (config: StampsConfig) => Promise<void> | ||
| start: (config: StampsConfig, refreshStamps: () => void) => Promise<void> | ||
| stop: () => void | ||
| postageStamp: () => string | ||
| } | ||
|
|
||
| export class BaseStampManager implements StampsManager { | ||
| export class BaseStampManager { | ||
|
luissanchez0305 marked this conversation as resolved.
|
||
| private interval?: ReturnType<typeof setInterval> | ||
| public stamp?: string | ||
| public usableStamps?: PostageBatch[] | ||
|
Comment on lines
+7
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think these needs to be public right?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should be part of the base class. This is solely Autobuy related.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still applicable. |
||
|
|
@@ -45,14 +45,13 @@ export class BaseStampManager implements StampsManager { | |
| /** | ||
| * Start the manager in either hardcoded or autobuy mode | ||
| */ | ||
| public async startFeature( | ||
| config: StampsConfigAutobuy | StampsConfigExtends, | ||
| refreshStamps: () => void, | ||
| ): Promise<void> { | ||
| async start(config: StampsConfig, refreshStamps: () => void): Promise<void> { | ||
| this.stop() | ||
| refreshStamps() | ||
|
|
||
| this.interval = setInterval(refreshStamps, config.refreshPeriod) | ||
| if (config.mode === 'autobuy' || config.mode === 'extends') { | ||
| this.interval = setInterval(refreshStamps, config.refreshPeriod) | ||
| } | ||
| } | ||
|
|
||
| stop(): void { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.