Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lykalabrada committed Oct 6, 2023
2 parents f033034 + e13ad96 commit 0800abf
Show file tree
Hide file tree
Showing 112 changed files with 14,473 additions and 19,077 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
record: true
parallel: true
start: npm run start:web
wait-on: "http://localhost:19000"
wait-on: "http://localhost:8081"
browser: chrome
spec: mobile-app/cypress/e2e/**
tag: ${{ github.event_name }}
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ jobs:
- run: npm ci
- run: npx pretty-quick --staged --check --pattern "mobile-app/**"

unit:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 16
cache: "npm"

- run: npm ci
- run: npm run test:ci

- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
fail_ci_if_error: true
# unit:
# name: Unit Test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
# with:
# node-version: 16
# cache: "npm"
#
# - run: npm ci
# - run: npm run test:ci
#
# - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
# with:
# fail_ci_if_error: true
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
- "/var/run/docker.sock:/var/run/docker.sock:ro"

defi-blockchain:
image: defi/defichain:master-91a01aea0
image: defi/defichain:master-b352814976
command: >
defid
-printtoconsole
Expand Down Expand Up @@ -55,10 +55,9 @@ services:
-grandcentralheight=16
-grandcentralepilogueheight=17
-nextnetworkupgradeheight=18
-changiintermediateheight=19
defi-playground:
image: ghcr.io/birthdayresearch/playground-api:3.34.0
image: ghcr.io/birthdayresearch/playground-api:4.0.0-rc.1.2
depends_on:
- defi-blockchain
ports:
Expand All @@ -71,7 +70,7 @@ services:
- "traefik.http.routers.playground.entrypoints=web"

defi-whale:
image: ghcr.io/birthdayresearch/whale-api:3.34.0
image: ghcr.io/birthdayresearch/whale-api:4.0.0-rc.1.2
depends_on:
- defi-blockchain
ports:
Expand Down
2 changes: 2 additions & 0 deletions metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ const defaultConfig = getDefaultConfig(__dirname);

defaultConfig.resolver.extraNodeModules.stream =
require.resolve("stream-browserify");
defaultConfig.transformer.minifierConfig.compress.drop_console = true;
defaultConfig.resolver.sourceExts = [...defaultConfig.resolver.sourceExts, "mjs", "cjs"];

module.exports = defaultConfig;
14 changes: 7 additions & 7 deletions mobile-app/app/api/transaction/dfi_converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ConvertDirection } from "@screens/enum";
export async function dfiConversionSigner(
account: WhaleWalletAccount,
amount: BigNumber,
mode: ConvertDirection
mode: ConvertDirection,
): Promise<CTransactionSegWit> {
const script = await account.getScript();
const builder = account.withTransactionBuilder();
Expand All @@ -31,7 +31,7 @@ export async function dfiConversionSigner(
},
],
},
script
script,
);
} else {
signed = await builder.account.accountToUtxos(
Expand All @@ -45,7 +45,7 @@ export async function dfiConversionSigner(
],
mintingOutputsStart: 2, // 0: DfTx, 1: change, 2: minted utxos (mandated by jellyfish-tx)
},
script
script,
);
}
return new CTransactionSegWit(signed);
Expand All @@ -56,7 +56,7 @@ export function dfiConversionCrafter(
convertDirection: ConvertDirection,
onBroadcast: () => any,
onConfirmation: () => void,
submitButtonLabel?: string
submitButtonLabel?: string,
): DfTxSigner {
if (
![
Expand All @@ -81,7 +81,7 @@ export function dfiConversionCrafter(
amount: amount.toFixed(8),
symbolA,
symbolB,
}
},
),
drawerMessages: {
preparing: translate("screens/OceanInterface", "Preparing to convert…"),
Expand All @@ -92,7 +92,7 @@ export function dfiConversionCrafter(
symbolA: symbolA,
symbolB: symbolB,
amount: amount.toFixed(8),
}
},
),
complete: translate(
"screens/OceanInterface",
Expand All @@ -101,7 +101,7 @@ export function dfiConversionCrafter(
symbolA,
symbolB,
amount: amount.toFixed(8),
}
},
),
},
onBroadcast,
Expand Down
29 changes: 19 additions & 10 deletions mobile-app/app/api/transaction/transfer_domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function transferDomainSigner(
sourceTokenId: string,
targetTokenId: string,
amount: BigNumber,
convertDirection: ConvertDirection
convertDirection: ConvertDirection,
): Promise<CTransactionSegWit> {
const dvmScript = await account.getScript();
const evmScript = await account.getEvmScript();
Expand All @@ -48,23 +48,25 @@ export async function transferDomainSigner(
src: {
address: sourceScript,
amount: {
token: Number(sourceTokenId),
token: stripEvmSuffixFromTokenId(sourceTokenId),
amount,
},
domain: srcDomain,
data: new Uint8Array([]),
},
dst: {
address: dstScript,
amount: {
token: Number(targetTokenId),
token: stripEvmSuffixFromTokenId(targetTokenId),
amount,
},
domain: dstDomain,
data: new Uint8Array([]),
},
},
],
},
dvmScript
dvmScript,
);

return new CTransactionSegWit(signed);
Expand All @@ -77,11 +79,11 @@ export function transferDomainCrafter(
targetToken: TransferDomainToken,
onBroadcast: () => any,
onConfirmation: () => void,
submitButtonLabel?: string
submitButtonLabel?: string,
): DfTxSigner {
if (
![ConvertDirection.evmToDvm, ConvertDirection.dvmToEvm].includes(
convertDirection
convertDirection,
)
) {
throw new Error("Unexpected transfer domain");
Expand All @@ -99,7 +101,7 @@ export function transferDomainCrafter(
sourceToken.tokenId,
targetToken.tokenId,
amount,
convertDirection
convertDirection,
),
title: translate(
"screens/ConvertConfirmScreen",
Expand All @@ -108,7 +110,7 @@ export function transferDomainCrafter(
amount: amount.toFixed(8),
symbolA,
symbolB,
}
},
),
drawerMessages: {
preparing: translate("screens/OceanInterface", "Preparing to convert…"),
Expand All @@ -119,7 +121,7 @@ export function transferDomainCrafter(
symbolA: symbolA,
symbolB: symbolB,
amount: amount.toFixed(8),
}
},
),
complete: translate(
"screens/OceanInterface",
Expand All @@ -128,7 +130,7 @@ export function transferDomainCrafter(
symbolA: symbolA,
symbolB: symbolB,
amount: amount.toFixed(8),
}
},
),
},
onBroadcast,
Expand All @@ -139,3 +141,10 @@ export function transferDomainCrafter(
: undefined,
};
}

function stripEvmSuffixFromTokenId(tokenId: string) {
if (tokenId.includes("-EVM")) {
return Number(tokenId.replace("-EVM", ""));
}
return Number(tokenId);
}
10 changes: 5 additions & 5 deletions mobile-app/app/components/DomainSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element {

const toggleDomain = async () => {
await setDomain(
domain === DomainType.DVM ? DomainType.EVM : DomainType.DVM
domain === DomainType.DVM ? DomainType.EVM : DomainType.DVM,
);
};
return (
Expand All @@ -30,7 +30,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element {
{domain === DomainType.DVM && (
<View
style={tailwind(
"flex-1 flex-row justify-center rounded-full items-center p-0 absolute left-0"
"flex-1 flex-row justify-center rounded-full items-center p-0 absolute left-0",
)}
>
<View
Expand Down Expand Up @@ -58,7 +58,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element {
{domain === DomainType.EVM && (
<View
style={tailwind(
"flex-1 rounded-full flex-row justify-center items-center absolute right-0"
"flex-1 rounded-full flex-row justify-center items-center absolute right-0",
)}
>
<LinearGradient
Expand All @@ -70,15 +70,15 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element {
<View style={tailwind("rounded-full p-1 flex-row items-center")}>
<View
style={tailwind(
"flex items-center justify-center rounded-full w-5 h-5"
"flex items-center justify-center rounded-full w-5 h-5",
)}
>
<EvmDFIIcon width={20} height={20} />
</View>

<Text
style={tailwind(
"text-mono-light-v2-00 text-xs ml-1 w-9 font-normal-v2"
"text-mono-light-v2-00 text-xs ml-1 w-9 font-normal-v2",
)}
testID={`${testID}_EVM`}
>
Expand Down
28 changes: 28 additions & 0 deletions mobile-app/app/components/EVMLinearGradient.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { tailwind } from "@tailwind";
import { LinearGradient } from "expo-linear-gradient";
import { ReactElement } from "react";

/* Only apply evm border color if it's an EVM Token */
export function EVMLinearGradient({
children,
isEvmToken,
}: {
children: ReactElement;
isEvmToken?: boolean;
}): JSX.Element | null {
if (isEvmToken) {
return (
<LinearGradient
collapsable={false}
colors={["#02CF92", "#3B57CF"]}
start={{ x: 0.0, y: 1.0 }}
end={{ x: 1.0, y: 1.0 }}
style={tailwind("p-0.5 rounded-full")}
>
{children}
</LinearGradient>
);
}

return children;
}
Loading

0 comments on commit 0800abf

Please sign in to comment.