diff --git a/chess/api/src/controllers/searchOpenLobbies.ts b/chess/api/src/controllers/searchOpenLobbies.ts index b48650c3..11d3c9c3 100644 --- a/chess/api/src/controllers/searchOpenLobbies.ts +++ b/chess/api/src/controllers/searchOpenLobbies.ts @@ -25,8 +25,6 @@ export class SearchOpenLobbiesController extends Controller { if (searchQuery.length < MIN_SEARCH_LENGTH || searchQuery.length > LOBBY_ID_LENGTH) return emptyResponse; - wallet = wallet.toLowerCase(); - if (searchQuery.length == LOBBY_ID_LENGTH) { const lobbies = await getOpenLobbyById.run({ searchQuery, wallet }, pool); return { lobbies }; diff --git a/chess/api/src/controllers/userLobbies.ts b/chess/api/src/controllers/userLobbies.ts index 15eb8ba1..e4d3eede 100644 --- a/chess/api/src/controllers/userLobbies.ts +++ b/chess/api/src/controllers/userLobbies.ts @@ -29,7 +29,6 @@ export class UserLobbiesController extends Controller { throw new ValidateError({ count: { message: 'invalid number' } }, ''); } - wallet = wallet.toLowerCase(); // after typecheck, valid data output is given in .right const p = valPage.right; const c = valCount.right; diff --git a/chess/api/src/controllers/userLobbiesBlockheight.ts b/chess/api/src/controllers/userLobbiesBlockheight.ts index b12cdae4..11a2eebb 100644 --- a/chess/api/src/controllers/userLobbiesBlockheight.ts +++ b/chess/api/src/controllers/userLobbiesBlockheight.ts @@ -18,7 +18,6 @@ export class UserLobbiesBlockheightController extends Controller { throw new ValidateError({ blockHeight: { message: 'invalid number' } }, ''); } - wallet = wallet.toLowerCase(); const lobbies = await getNewLobbiesByUserAndBlockHeight.run( { wallet, block_height: blockHeight }, pool diff --git a/chess/frontend/src/components/LobbyList.tsx b/chess/frontend/src/components/LobbyList.tsx index d2d05dde..46dd5f2e 100644 --- a/chess/frontend/src/components/LobbyList.tsx +++ b/chess/frontend/src/components/LobbyList.tsx @@ -119,7 +119,7 @@ const LobbyList: React.FC = ({ fullWidth onClick={() => onLobbySelect(lobby)} > - {actionMap[lobby.lobby_state]} + {actionMap[lobby.lobby_state as LobbyStatus]} } /> diff --git a/chess/frontend/src/pages/Login.tsx b/chess/frontend/src/pages/Login.tsx index e5b40f36..10cccd54 100644 --- a/chess/frontend/src/pages/Login.tsx +++ b/chess/frontend/src/pages/Login.tsx @@ -16,7 +16,8 @@ const wallets = [ "EVM Self-sequence", "Algorand", "Polkadot", - "Cardano" + "Cardano", + "Mina", ] as const; type WalletType = typeof wallets[number]; @@ -62,6 +63,7 @@ const Login: React.FC = () => { Cardano: { mode: WalletMode.Cardano }, Polkadot: { mode: WalletMode.Polkadot }, Algorand: { mode: WalletMode.Algorand }, + Mina: { mode: WalletMode.Mina } }); } getWallets(); diff --git a/chess/frontend/src/paima/types.d.ts b/chess/frontend/src/paima/types.d.ts index fac42159..be0cd9cf 100644 --- a/chess/frontend/src/paima/types.d.ts +++ b/chess/frontend/src/paima/types.d.ts @@ -1,5 +1,6 @@ import type { Hash } from '@paima/sdk/utils'; -import type { BaseRoundStatus, LobbyState, LobbyStateQuery, LobbyStatus, NewLobby, UserLobby, UserStats } from '@chess/utils'; +import type { BaseRoundStatus, LobbyState, LobbyStateQuery, NewLobby, UserLobby, UserStats } from '@chess/utils'; +import type { LobbyStatus } from '@chess/db'; export interface RoundEnd { blocks: number; seconds: number; diff --git a/chess/state-transition/src/stf/v1/index.ts b/chess/state-transition/src/stf/v1/index.ts index 2f322ccf..84c11440 100644 --- a/chess/state-transition/src/stf/v1/index.ts +++ b/chess/state-transition/src/stf/v1/index.ts @@ -20,7 +20,7 @@ export default async function ( dbConn: Pool ): Promise { console.log(inputData, 'parsing input data'); - const user = inputData.userAddress.toLowerCase(); + const user = inputData.realAddress; const parsed = parse(inputData.inputData); console.log(`Processing input string: ${inputData.inputData}`); console.log(`Input string parsed as: ${parsed.input}`); diff --git a/chess/utils/src/types.ts b/chess/utils/src/types.ts index 5d7ad707..23b6bc2d 100644 --- a/chess/utils/src/types.ts +++ b/chess/utils/src/types.ts @@ -15,6 +15,7 @@ type IGetBlockHeightsResult = { export type ConciseResult = 'w' | 't' | 'l'; export type ExpandedResult = 'win' | 'tie' | 'loss'; export type MatchResult = [ConciseResult, ConciseResult]; +export { LobbyStatus } from '@chess/db'; export interface MatchWinnerResponse { match_status?: LobbyStatus;