Skip to content

Commit

Permalink
Remove unused code in Motoko canister
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa committed Apr 3, 2024
1 parent 0a009ae commit 5add34b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
8 changes: 1 addition & 7 deletions canisters/backend/Core.mo
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ import Nat64 "mo:base/Nat64";
import System "lib/System";
import Iter "lib/IterMore";
import IcEth "canister:ic_eth";
import Seq "mo:sequence/Sequence";
import Stream "mo:sequence/Stream";

module {
public class Core(installer : Principal, sys : System.System, _state : State.Stable.State, history : History.History) {

let state = State.OOOf(sys, _state);
public let logger = History.Logger(sys, history);

func unreachable() : None {
do { assert false; loop {} };
};

public func login(caller : Principal) : Types.Resp.Login {
let log = logger.Begin(caller, #login);
log.okWith(state.login(caller));
Expand Down Expand Up @@ -116,7 +110,7 @@ module {
log.okWith(true);
};

public func getPublicHistory(caller : Principal) : [Types.PublicEvent] {
public func getPublicHistory(_caller : Principal) : [Types.PublicEvent] {
Iter.toArray(state.getPublicHistory());
};

Expand Down
2 changes: 0 additions & 2 deletions canisters/backend/History.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Error "mo:base/Error";
import Cycles "mo:base/ExperimentalCycles";
import Int "mo:base/Int";
import Iter "mo:base/Iter";
import Seq "mo:sequence/Sequence";
Expand Down
1 change: 0 additions & 1 deletion canisters/backend/Snapshot.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Types "Types";
import State "State";

import Int "mo:base/Int";
import Trie "mo:base/Trie";
import Iter "lib/IterMore";

Expand Down
3 changes: 2 additions & 1 deletion src/services/addressService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { handleError, handlePromise } from '../utils/handlers';
import makeObservable from '../utils/makeObservable';
import { getBackend } from './backendService';
import { USER_STORE } from './userService';
import { applicationName } from '../setupApp';

export const ADDRESSES_STORE = makeObservable<string[] | null>();

Expand Down Expand Up @@ -49,7 +50,7 @@ async function verifyAddress(address: string, ethereum: any): Promise<boolean> {
return false;
}
const principal = user.client.getIdentity().getPrincipal().toString();
const message = principal; // TODO: human-readable message?
const message = `${applicationName}\n${principal}`;
const signature = await ethereum.request({
method: 'personal_sign',
params: [`0x${toHex(message)}`, address],
Expand Down

0 comments on commit 5add34b

Please sign in to comment.