UNPKG

@ledgerhq/live-common

Version:
18 lines 886 B
import expect from "expect"; import { pressBoth, pressUntilTextFound, containsSubstringInEvent, getDelegateEvents, } from "../speculos"; import { DeviceLabels } from "../enum/DeviceLabels"; export async function delegateCosmos(delegatingAccount) { const events = await getDelegateEvents(delegatingAccount); const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events); expect(isAmountCorrect).toBeTruthy(); await pressBoth(); } export async function sendCosmos(tx) { const events = await pressUntilTextFound(DeviceLabels.CAPS_APPROVE); const isAmountCorrect = containsSubstringInEvent(tx.amount, events); expect(isAmountCorrect).toBeTruthy(); const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events); expect(isAddressCorrect).toBeTruthy(); await pressBoth(); } //# sourceMappingURL=cosmos.js.map