Revert ethereum address lowercase (#407)

* Revert "add if not null check to ethereum address (#406)"

This reverts commit c6364bd4f6.

* Revert "make ethereum_address lowercase in backend (#405)"

This reverts commit 3cee60e30d.
This commit is contained in:
dan13ram
2021-03-12 21:33:50 +05:30
committed by GitHub
parent c6364bd4f6
commit 2f4987f491
5 changed files with 2 additions and 6 deletions

View File

@@ -1 +0,0 @@
UPDATE player SET ethereum_address=lower(ethereum_address) WHERE ethereum_address IS NOT NULL;

View File

@@ -1 +0,0 @@
alter table "public"."player" drop constraint "ethereum_address_is_valid";

View File

@@ -1 +0,0 @@
alter table "public"."player" add constraint "ethereum_address_is_valid" check (ethereum_address ~* '^0x([a-z0-9-]{40})$'::text);

View File

@@ -108,7 +108,7 @@ export const migrateSourceCredAccounts = async (
const rank = computeRank(index);
return {
ethereum_address: addressEntry && addressEntry.address.toLowerCase(),
ethereum_address: addressEntry && addressEntry.address,
scIdentityId: a.account.identity.id,
username: a.account.identity.name.toLowerCase(),
totalXp: a.totalCred,

View File

@@ -11,8 +11,7 @@ async function createPlayer(ethAddress: string) {
return resProfile.insert_player.returning[0];
}
export async function getOrCreatePlayer(ethereumAddress: string) {
const ethAddress = ethereumAddress.toLowerCase();
export async function getOrCreatePlayer(ethAddress: string) {
const res = await client.GetPlayerFromETH({
ethereum_address: ethAddress,
});