*add dht getter that returns a mock object including ready

This commit is contained in:
Derrick Hammer 2023-03-18 13:55:33 -04:00
parent 46b0911d57
commit 44b9842ea9
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,15 @@ export class SwarmClient extends Client {
private _topics: Set<Uint8Array> = new Set<Uint8Array>();
get dht() {
const self = this;
return {
async ready() {
return self.ready();
},
};
}
constructor(useDefaultDht = true, autoReconnect = false) {
super();
this.useDefaultSwarm = useDefaultDht;