type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
value => value !== undefined
Embodimentgeniuslm3/carbon-for-ibm-dotcom
packages/web-components/src/components/masthead/masthead-container.ts
TypeScript
ClassDeclaration
/** * Container component for masthead. * * @element dds-masthead-container */ @customElement(`${ddsPrefix}-masthead-container`) class DDSMastheadContainer extends ConnectMixin< MastheadContainerState, LocaleAPIActions | TranslateAPIActions | ProfileAPIActions, MastheadContainerStateProps, ActionCreatorsMap...
Embodimentgeniuslm3/carbon-for-ibm-dotcom
packages/web-components/src/components/masthead/masthead-container.ts
TypeScript
InterfaceDeclaration
/** * The Redux state used for `<dds-masthead-container>`. */ export interface MastheadContainerState { /** * The Redux state for `LocaleAPI`. */ localeAPI?: LocaleAPIState; /** * The Redux state for `TranslateAPI`. */ translateAPI?: TranslateAPIState; /** * The Redux state for `ProfileAPI`...
Embodimentgeniuslm3/carbon-for-ibm-dotcom
packages/web-components/src/components/masthead/masthead-container.ts
TypeScript
InterfaceDeclaration
/** * The properties for `<dds-masthead-container>` from Redux state. */ export interface MastheadContainerStateProps { /** * The nav links. */ navLinks?: MastheadLink[]; /** * The user authentication status. */ userStatus?: string; }
Embodimentgeniuslm3/carbon-for-ibm-dotcom
packages/web-components/src/components/masthead/masthead-container.ts
TypeScript
TypeAliasDeclaration
/** * The Redux actions used for `<dds-masthead-container>. */ export type MastheadContainerActions = | ReturnType<typeof loadLanguage> | ReturnType<typeof setLanguage> | ReturnType<typeof loadTranslation> | ReturnType<typeof loadUserStatus>;
Embodimentgeniuslm3/carbon-for-ibm-dotcom
packages/web-components/src/components/masthead/masthead-container.ts
TypeScript
ArrowFunction
() => { let component: AddKidComponent; let fixture: ComponentFixture<AddKidComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AddKidComponent ] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(AddKidComponent); ...
iliangogov/KidsTracker
KidsTracker/src/app/page-components/add-kid/add-kid.component.spec.ts
TypeScript
ArrowFunction
() => { TestBed.configureTestingModule({ declarations: [ AddKidComponent ] }) .compileComponents(); }
iliangogov/KidsTracker
KidsTracker/src/app/page-components/add-kid/add-kid.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(AddKidComponent); component = fixture.componentInstance; fixture.detectChanges(); }
iliangogov/KidsTracker
KidsTracker/src/app/page-components/add-kid/add-kid.component.spec.ts
TypeScript
ArrowFunction
() => { originalProxyConfig = [ global.hasOwnProperty('PROXY_CONFIG'), (global as any).PROXY_CONFIG, ]; originalHttpProxy = [ process.env.hasOwnProperty('HTTP_PROXY'), process.env.HTTP_PROXY, ]; originalHttpsProxy = [ process.env.hasOwnProperty('HTTPS_PROXY'), process.env.HTTPS_PROXY, ]; ...
rcitterio/balena-cli
tests/utils/helpers.spec.ts
TypeScript
ArrowFunction
() => { if (originalProxyConfig[0]) { (global as any).PROXY_CONFIG = originalProxyConfig[1]; } if (originalHttpProxy[0]) { process.env.HTTP_PROXY = originalHttpProxy[1]; } if (originalHttpsProxy[0]) { process.env.HTTPS_PROXY = originalHttpsProxy[1]; } }
rcitterio/balena-cli
tests/utils/helpers.spec.ts
TypeScript
ArrowFunction
() => { (global as any).PROXY_CONFIG = { host: '127.0.0.1', port: 8080, proxyAuth: 'bob:secret', protocol: 'http:', connect: 'https', }; const expectedProxyConfig = { host: '127.0.0.1', port: '8080', proxyAuth: 'bob:secret', username: 'bob', password: 'secret', }; expect(getProx...
rcitterio/balena-cli
tests/utils/helpers.spec.ts
TypeScript
ArrowFunction
() => { process.env.HTTPS_PROXY = 'http://bob:secret@proxy.company.com:12345'; process.env.HTTP_PROXY = 'http://my.net:8080'; const expectedProxyConfig = { host: 'proxy.company.com', port: '12345', proxyAuth: 'bob:secret', username: 'bob', password: 'secret', }; expect(getProxyConfig()).to.dee...
rcitterio/balena-cli
tests/utils/helpers.spec.ts
TypeScript
FunctionDeclaration
function CredentialsScreen() { const [credentials, setCredentials] = useState([]); var selectSecondFactorResolution, selectSecondFactorRejection; async function deleteCredential(id) { try { await GallagherMobileAccess.deleteCredential(id); const creds = await GallagherMob...
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
FunctionDeclaration
async function deleteCredential(id) { try { await GallagherMobileAccess.deleteCredential(id); const creds = await GallagherMobileAccess.getCredentials(); setCredentials(creds); } catch(err) { console.log(err); } }
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
FunctionDeclaration
async function registerCredential(invitationCode, cloudUrl, navigation) { try { const url = await GallagherMobileAccess.resolveInvitationUrl(cloudUrl, invitationCode); const response = await GallagherMobileAccess.registerCredential(url); if(!response.completed && "continuat...
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
FunctionDeclaration
function AddCredential({ navigation }) { // Normally, as a third party app developer, you would do the following: // 1: Somehow your backend will create a mobile credential, by PATCHing a cardholder, or creating a new one. // 2: The Command Centre REST api will give you back an invitation URL, ...
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
FunctionDeclaration
function SelectSecondFactorType() { // At this point it would be a good idea to query the system and ask it what methods it has available. // for example, does this phone have Fingerprint/Face ID (the user may not have configured them, or a low-end android phone may not have a fingerprint scanner) ...
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
(resolve, reject) => { // hoist the resolver out into component level scope so the SelectSecondFactorType component can see it too selectSecondFactorResolution = resolve; selectSecondFactorRejection = reject; }
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
({ title, id }) => ( <View style={styles.listItem}> <Text style
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
async () => { try { const creds = await GallagherMobileAccess.getCredentials(); console.log("got creds " + JSON.stringify(creds)) setCredentials(creds); } catch (err) { console.log("getCredentials failed! " + err); } }
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
({ item }) => { return <CredentialListItem id={item.id} title={item.facilityName} /> }
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
({ navigation }) => { React.useLayoutEffect(() => { navigation.setOptions({ headerRight: () => ( <Button onPress={()
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
() => { navigation.setOptions({ headerRight: () => ( <Button onPress={()
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
() => ( <Button onPress={()
thinkdigitalcloud/mobileconnectsdk-react-native-bindings
example/src/CredentialsScreen.tsx
TypeScript
ArrowFunction
(type) => metatype === type
sulakin/auth-server
src/shared/validation.pipe.ts
TypeScript
ArrowFunction
(error) => { for (const property in error.constraints) { return error.constraints[property]; } }
sulakin/auth-server
src/shared/validation.pipe.ts
TypeScript
ClassDeclaration
@Injectable() export class ValidationPipe implements PipeTransform { async transform(value: any, metadata: ArgumentMetadata) { if (value instanceof Object && this.isEmpty(value)) { throw new HttpException( ['Server error, try later', 'Ошибка сервера, попробуйте позже'], HttpStatus.BAD_REQUE...
sulakin/auth-server
src/shared/validation.pipe.ts
TypeScript
MethodDeclaration
async transform(value: any, metadata: ArgumentMetadata) { if (value instanceof Object && this.isEmpty(value)) { throw new HttpException( ['Server error, try later', 'Ошибка сервера, попробуйте позже'], HttpStatus.BAD_REQUEST, ); } const { metatype } = metadata; if (!metatyp...
sulakin/auth-server
src/shared/validation.pipe.ts
TypeScript
MethodDeclaration
private toValidate(metatype): boolean { const types = [String, Boolean, Number, Array, Object]; return !types.find((type) => metatype === type); }
sulakin/auth-server
src/shared/validation.pipe.ts
TypeScript
MethodDeclaration
private formatErrors(errors: any[]) { return errors .map((error) => { for (const property in error.constraints) { return error.constraints[property]; } }) .join('%errors%'); }
sulakin/auth-server
src/shared/validation.pipe.ts
TypeScript
MethodDeclaration
private isEmpty(value: any) { if (Object.keys(value).length > 0) { return false; } return true; }
sulakin/auth-server
src/shared/validation.pipe.ts
TypeScript
InterfaceDeclaration
export interface DaffNavigationServiceInterface<T extends DaffGenericNavigationTree<T>> { get(categoryId: T['id']): Observable<T>; }
coresh/daffodil
libs/navigation/driver/src/interfaces/navigation-service.interface.ts
TypeScript
FunctionDeclaration
function f1(): boolean { return true; }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
FunctionDeclaration
function TestAnimatedAPI() { // Value const v1 = new Animated.Value(0); const v2 = new Animated.Value(0); // Ref const AnimatedViewRef = React.useRef<View>(null); AnimatedViewRef.current && AnimatedViewRef.current.measure(() => { return; }); const AnimatedComp...
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
ArrowFunction
({ width }, ref) => { function f1(): boolean { return true; } return <View ref={ref} style={{ width }}
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
ArrowFunction
({ key, // $ExpectType string | number | null | undefined || Key | null | undefined ...props }) => <Animated.Text {...props} />
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
ArrowFunction
() => { return; }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
ArrowFunction
e => { const n: number = e.value; }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
ArrowFunction
v => v
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
ArrowFunction
(e?: NativeSyntheticEvent<NativeScrollEvent>) => { if (e) { console.warn(e.nativeEvent.contentOffset.y); } }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
ClassDeclaration
class Comp extends React.Component<CompProps> { f1: () => boolean = () => true; render() { const { width } = this.props; return <View style={{ width }} />; } }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
InterfaceDeclaration
interface CompProps { width: number; }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
TypeAliasDeclaration
type X = React.PropsWithoutRef<React.ComponentProps<typeof ForwardComp>>;
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
TypeAliasDeclaration
type Props = React.ComponentPropsWithRef<typeof Animated.Text>;
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
MethodDeclaration
render() { const { width } = this.props; return <View style={{ width }} />; }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
MethodDeclaration
ReadonlyArray<number>
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
MethodDeclaration
SectionListData<number, { title: string }
0-Captain/DefinitelyTyped
types/react-native/v0.63/test/animated.tsx
TypeScript
FunctionDeclaration
function LoginUser() { var loginstatus:string = ''; var logintoken:any = ''; var loginid:any = ''; let navigate = useNavigate(); const [pending, setPending] = useState(false); function handleClick() { setPending(true); } const [state, dispatch] = useReducer(reducer, initialState); useEffe...
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
FunctionDeclaration
function handleClick() { setPending(true); }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
FunctionDeclaration
// we will use async/await to fetch this data async function getData() { axios.post('https://ediscovery.inabia.ai/api/login?email='+ email + '&password='+ password +'') .then(res => { console.log(res.data.Response); loginstatus = res.data.Response.Data; logintoken = res.data.Respo...
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
(state: State, action: Action): State => { switch (action.type) { case 'setemail': return { ...state, email: action.payload }; case 'setPassword': return { ...state, password: action.payload }; case 'setIsButtonDisabled': return { ....
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
() => { if (state.email.trim() && state.password.trim()) { dispatch({ type: 'setIsButtonDisabled', payload: false }); } else { dispatch({ type: 'setIsButtonDisabled', payload: true }); } }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
() => { const email = state.email; const password = state.password; if (email == '' || password == '') { dispatch({ type: 'loginFailed', payload: 'Please filled the required fields', }); return false; } //API Call getData(); ...
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
res => { console.log(res.data.Response); loginstatus = res.data.Response.Data; logintoken = res.data.Response.Token; loginid = res.data.Response.userId; enum status { success = 'Success', } if(loginstatus !== status.success) { dispa...
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
(event: React.KeyboardEvent) => { if (event.keyCode === 13 || event.which === 13) { state.isButtonDisabled || handleLogin(); } }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
(event) => { dispatch({ type: 'setemail', payload: event.target.value }); }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
(event) => { dispatch({ type: 'setPassword', payload: event.target.value }); }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
() => { alert('Google'); }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
() => { alert('Facebook'); }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ArrowFunction
() => { alert('Linkedin'); }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
EnumDeclaration
enum status { success = 'Success', }
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
TypeAliasDeclaration
//state type // eslint -- enforce coding stand type State = { email: string password: string isButtonDisabled: boolean helperText: string isError: boolean };
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
TypeAliasDeclaration
type Action = { type: 'setemail' | 'setPassword' | 'loginSuccess' | 'loginFailed', payload: string } | { type: 'setIsButtonDisabled' | 'setIsError', payload: boolean };
yaamin6236/ediscovery-React
src/content/authentication/login/index.tsx
TypeScript
ClassDeclaration
export class SkillTypeDto { name: string; @Min(1) @Max(5) level: number; }
Guzik98/SerwisOgloszeniowyBackend
src/offer/dto/nested/skill_type.dto.ts
TypeScript
ClassDeclaration
export class TransactionQuoteRequest implements ITransactionQuoteRequest { private _sender: string; private _to: string; private _amount: string; private _method: string; private _parameters: ITransactionQuoteParameter[]; private _callback: string; get payload(): ITransactionQuoteRequest { return { ...
Opdex/opdex-v1-ui
src/app/models/platform-api/requests/transactions/transaction-quote-request.ts
TypeScript
InterfaceDeclaration
export interface ITransactionQuoteRequest { sender: string; to: string; amount: string; method: string; parameters: ITransactionQuoteParameter[]; callback: string; }
Opdex/opdex-v1-ui
src/app/models/platform-api/requests/transactions/transaction-quote-request.ts
TypeScript
InterfaceDeclaration
export interface ITransactionQuoteParameter { label: string; value: string; }
Opdex/opdex-v1-ui
src/app/models/platform-api/requests/transactions/transaction-quote-request.ts
TypeScript
FunctionDeclaration
function createValidLockRedeemScript (lockUntilBlock: number, targetWalletAddress: Address): Script { const lockUntilBlockBuffer = Buffer.alloc(3); lockUntilBlockBuffer.writeIntLE(lockUntilBlock, 0, 3); return Script.empty() .add(lockUntilBlockBuffer) .add(177) // OP_CLTV ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
FunctionDeclaration
function createLockScriptVerifyResult (isScriptValid: boolean, owner: string | undefined, unlockAtBlock: number | undefined): any { return { isScriptValid: isScriptValid, publicKeyHash: owner, unlockAtBlock: unlockAtBlock }; }
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { let bitcoinClient = new BitcoinClient('uri:test', 'u', 'p', validTestWalletImportString, 10, 1, 0); const mongoQuantileStore = new MockSlidingWindowQuantileStore(); const sidetreeTxnParser = new SidetreeTransactionParser(bitcoinClient, 'sidetree'); const normalizedFeeCalculator = new Norm...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { it('should deserialize the identifier and call the other function', async (done) => { const mockLockIdentifier: LockIdentifierModel = { redeemScriptAsHex: 'redeem script as hex', transactionId: 'transaction id' }; const deserializeSpy = spyOn(LockIdentifierSerializ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async (done) => { const mockLockIdentifier: LockIdentifierModel = { redeemScriptAsHex: 'redeem script as hex', transactionId: 'transaction id' }; const deserializeSpy = spyOn(LockIdentifierSerializer, 'deserialize').and.returnValue(mockLockIdentifier); const mockLockSt...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const lockBlockInput = 1665191; const validScript = createValidLockRedeemScript(lockBlockInput, validTestWalletAddress); const mockLockIdentifier: LockIdentifierModel = { transactionId: 'some transactoin id', redeemScriptAsHex: validScript.toHex() }; ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const mockLockIdentifier: LockIdentifierModel = { transactionId: 'some transactoin id', redeemScriptAsHex: 'some mock script as hex' }; const mockLockScriptVerifyResult = createLockScriptVerifyResult(false, undefined, undefined); const getTxnSpy = spyOn...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => lockResolver.resolveLockIdentifierAndThrowOnError(mockLockIdentifier)
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const mockLockIdentifier: LockIdentifierModel = { transactionId: 'some transactoin id', redeemScriptAsHex: 'validScript to - Hex' }; const mockTransaction: BitcoinTransactionModel = { id: 'some transaction id', blockHash: 'block hash', ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const mockLockIdentifier: LockIdentifierModel = { transactionId: 'some transactoin id', redeemScriptAsHex: 'validScript to - Hex' }; const mockTransaction: BitcoinTransactionModel = { id: 'some transaction id', blockHash: 'block hash', ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const mockLockIdentifier: LockIdentifierModel = { transactionId: 'some transactoin id', redeemScriptAsHex: 'validScript to - Hex' }; const mockTransaction: BitcoinTransactionModel = { id: 'some transaction id', blockHash: 'block hash', ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { it('should validate and return the correct block if the script is valid.', async () => { const lockBlockInput = 1665191; const validScript = createValidLockRedeemScript(lockBlockInput, validTestWalletAddress); const expectedOutput = createLockScriptVerifyResult(true, validPublicKe...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const lockBlockInput = 1665191; const validScript = createValidLockRedeemScript(lockBlockInput, validTestWalletAddress); const expectedOutput = createLockScriptVerifyResult(true, validPublicKeyHashOutString, lockBlockInput); const actual = LockResolver['isRedeemScriptALo...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const validScript = createValidLockRedeemScript(1234, validTestWalletAddress); const invalidScript = validScript.add(114); // add an invalid op code const expectedOutput = createLockScriptVerifyResult(false, undefined, undefined); const actual = LockResolver['isRedeemScrip...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { it('should return true if the output is paying to the target script.', async () => { const validScript = createValidLockRedeemScript(4758759, validTestWalletAddress); const validScriptAsPayToScriptHashOut = Script.buildScriptHashOut(validScript); const mockOutput: BitcoinOutputModel...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const validScript = createValidLockRedeemScript(4758759, validTestWalletAddress); const validScriptAsPayToScriptHashOut = Script.buildScriptHashOut(validScript); const mockOutput: BitcoinOutputModel = { satoshis: 1000, scriptAsmAsString: validScriptAsPayToScriptHashOut.toA...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const validScript = createValidLockRedeemScript(4758759, validTestWalletAddress); const validScript2 = createValidLockRedeemScript(987654, validTestWalletAddress); const mockOutput: BitcoinOutputModel = { satoshis: 1000, scriptAsmAsString: validScript2.toASM() }; ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { it('should return script from the hex.', async () => { const validScript = createValidLockRedeemScript(12345, validTestWalletAddress); validScript.add(114); const actual = LockResolver['createScript'](validScript.toHex()); expect(actual.toASM()).toEqual(validScript.toASM())...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const validScript = createValidLockRedeemScript(12345, validTestWalletAddress); validScript.add(114); const actual = LockResolver['createScript'](validScript.toHex()); expect(actual.toASM()).toEqual(validScript.toASM()); }
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { spyOn(Buffer,'from').and.throwError('som error'); JasmineSidetreeErrorValidator.expectSidetreeErrorToBeThrown( () => LockResolver['createScript']('some input'), ErrorCode.LockResolverRedeemScriptIsInvalid); }
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => LockResolver['createScript']('some input')
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { it('should return true if the bitcoin client returns the transaction', async () => { const mockTxn: BitcoinTransactionModel = { id: 'id', blockHash: 'block hash', confirmations: 5, inputs: [], outputs: [] }; spyOn(lockResolver['bitcoinClient'], 'getRawTransaction').and.returnValue(Promise.re...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { const mockTxn: BitcoinTransactionModel = { id: 'id', blockHash: 'block hash', confirmations: 5, inputs: [], outputs: [] }; spyOn(lockResolver['bitcoinClient'], 'getRawTransaction').and.returnValue(Promise.resolve(mockTxn)); const actual = await lockResolver['getTransaction']('input...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async () => { spyOn(lockResolver['bitcoinClient'], 'getRawTransaction').and.throwError('not found custom error.'); await JasmineSidetreeErrorValidator.expectSidetreeErrorToBeThrownAsync( () => lockResolver['getTransaction']('input id'), ErrorCode.LockResolverTransactionNotFound); }
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => lockResolver['getTransaction']('input id')
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { it('should calculate the correct starting block', async (done) => { const mockTransaction: BitcoinTransactionModel = { id: 'some id', blockHash: 'block hash', confirmations: 23, inputs: [], outputs: [] }; const mockBlockInfo: IBlockInfo =...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async (done) => { const mockTransaction: BitcoinTransactionModel = { id: 'some id', blockHash: 'block hash', confirmations: 23, inputs: [], outputs: [] }; const mockBlockInfo: IBlockInfo = { hash: 'some hash', height: 989347, ...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async (done) => { const mockTransaction: BitcoinTransactionModel = { id: 'some id', blockHash: 'block hash', confirmations: -2, inputs: [], outputs: [] }; await JasmineSidetreeErrorValidator.expectSidetreeErrorToBeThrownAsync( () => lockResol...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => lockResolver['calculateLockStartingBlock'](mockTransaction)
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
async (done) => { const mockTransaction: BitcoinTransactionModel = { id: 'some id', blockHash: 'block hash', confirmations: 0, inputs: [], outputs: [] }; await JasmineSidetreeErrorValidator.expectSidetreeErrorToBeThrownAsync( () => lockResolv...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { it('should return true if the lock duration is exactly on the min limit.', () => { const startBlock = 100; const unlockBlock = startBlock + lockResolver['minimumLockDurationInBlocks']; const actual = lockResolver['isLockDurationValid'](startBlock, unlockBlock); expect(actual)...
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { const startBlock = 100; const unlockBlock = startBlock + lockResolver['minimumLockDurationInBlocks']; const actual = lockResolver['isLockDurationValid'](startBlock, unlockBlock); expect(actual).toBeTruthy(); }
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript
ArrowFunction
() => { const startBlock = 100; const unlockBlock = startBlock + lockResolver['maximumLockDurationInBlocks']; const actual = lockResolver['isLockDurationValid'](startBlock, unlockBlock); expect(actual).toBeTruthy(); }
wesleyh-dev/sidetree
tests/bitcoin/lock/LockResolver.spec.ts
TypeScript