Skip to content

Commit

Permalink
fix(tests): fixed tests for livesdklogic preparesigntx
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeAERGO committed Apr 26, 2024
1 parent c57dae3 commit f04da38
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 73 deletions.
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ GEM

PLATFORMS
ruby
x86_64-darwin-20

DEPENDENCIES
cocoapods (~> 1.12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,11 +803,7 @@
"$(inherited)",
" ",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -934,11 +930,7 @@
"$(inherited)",
" ",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -1009,11 +1001,7 @@
"$(inherited)",
" ",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,15 @@ describe("prepareSignTransaction", () => {
// Given
const parentAccount = createAccount("12");
const childAccount = createTokenAccount("22", "js:2:ethereum:0x012:");
const expectedResult: EvmTransaction = {
const expectedResult: Partial<EvmTransaction> = {
amount: new BigNumber("1000"),
data: Buffer.from([]),
family: "evm",
feesStrategy: "medium",
gasPrice: new BigNumber("700000"),
gasLimit: new BigNumber("1200000"),
customGasLimit: new BigNumber("1200000"),
mode: "send",
gasPrice: new BigNumber("700000"),
nonce: 8,
recipient: "0x0123456",
subAccountId: "js:2:ethereum:0x022:",
useAllAmount: false,
maxFeePerGas: undefined,
maxPriorityFeePerGas: undefined,
type: 1,
chainId: 0,
};

// When
Expand All @@ -49,7 +41,11 @@ describe("prepareSignTransaction", () => {
});

// *** UTIL FUNCTIONS ***
function createEtherumTransaction(): Partial<Transaction & { gasLimit: BigNumber }> {
function createEtherumTransaction(): Partial<
Transaction & {
gasLimit: BigNumber;
}
> {
return {
family: "evm",
amount: new BigNumber("1000"),
Expand Down Expand Up @@ -150,9 +146,18 @@ function createTokenAccount(id = "32", parentId = "whatever"): TokenAccount {
pendingOperations: [],
starred: false,
balanceHistoryCache: {
WEEK: { latestDate: null, balances: [] },
HOUR: { latestDate: null, balances: [] },
DAY: { latestDate: null, balances: [] },
WEEK: {
latestDate: null,
balances: [],
},
HOUR: {
latestDate: null,
balances: [],
},
DAY: {
latestDate: null,
balances: [],
},
},
swapHistory: [],
};
Expand Down
56 changes: 13 additions & 43 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f04da38

Please sign in to comment.