Skip to content

Commit

Permalink
return true for connect disconnect functions if not implemented (#268)
Browse files Browse the repository at this point in the history
* remove console log and implement basic functionality for connect, disconnect, connected, and enabled methods in MassaStationWallet

* implement warning messages for unimplemented methods in MassaStationWallet

* refactor MassaStationWallet methods to remove warnings and clarify connection status
  • Loading branch information
Ben-Rey authored Nov 28, 2024
1 parent 31ac402 commit b8e722e
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions src/massaStation/MassaStationWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export class MassaStationWallet implements Wallet {
publicKey,
privateKey,
});
console.log('importAccount res ', res);
if (res.isError) {
throw res.error;
}
Expand Down Expand Up @@ -162,27 +161,35 @@ export class MassaStationWallet implements Wallet {
};
}

/**
* Simulates connecting to the station.
* This method always returns `true` because the station is inherently connected.
*/
public async connect(): Promise<boolean> {
throw new Error(
'connect functionality is not yet implemented for the current provider.',
);
return true;
}

/**
* Simulates disconnecting from the station.
* This method always returns `true` because the station cannot be disconnected.
*/
public async disconnect(): Promise<boolean> {
throw new Error(
'disconnect functionality is not yet implemented for the current provider.',
);
return true;
}

/**
* Indicates if the station is connected.
* Always returns `true` because the station is always connected when running.
*/
public connected(): boolean {
throw new Error(
'connected functionality is not yet implemented for the current provider.',
);
return true;
}

/**
* Indicates if the station is enabled.
* Always returns `true` because the station is always enabled by default.
*/
public enabled(): boolean {
throw new Error(
'enabled functionality is not yet implemented for the current provider.',
);
return true;
}
}

0 comments on commit b8e722e

Please sign in to comment.