text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|> bytes32)).as[OnionRoutingPacket] /** * This codec encodes onion packets of variable sizes, and decodes the whole input byte stream into an onion packet. * When decoding, the caller must ensure that they provide only the bytes that contain the onion packet. */ val variableSizeOnionRoutingPac...
fim
ACINQ/eclair
scala
<|fim_suffix|>er))) private val amountToForward: Codec[AmountToForward] = tlvField(tmillisatoshi) private val outgoingCltv: Codec[OutgoingCltv] = tlvField(tu32.xmap(cltv => OutgoingCltv(CltvExpiry(cltv)), (c: OutgoingCltv) => c.cltv.toLong)) private val outgoingChannelId: Codec[OutgoingChannelId] = tlvField(sh...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 20<|fim_suffix|>minated[PeerStorageTlv].by(varint)) } <|fim_middle|>24 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache....
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * <|fim_suffix|>r depending on the use-case). */ case class PathId(data: ByteVector) extends RouteBlindingEncryptedDataTlv /** Path key override for the rest of the route. */ case class NextPath...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance <|fim_suffix|> .typecase(UInt64(1), networks) .typecase(UInt64(3), remoteAddress) // We use a temporary TLV while the spec is being reviewed. ....
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
java
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
java
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>Y, s"jdbcUrlFile_${UUID.randomUUID()}.tmp") jdbcUrlFile.deleteOnExit() val dbs = Databases.SqliteDatabases(connection, connection, connection, jdbcUrlFile_opt = Some(jdbcUrlFile)) dbs.copy(channels = new SqliteChannelsDbWithValidation(dbs.channels)) } override def close(): Unit =...
fim
ACINQ/eclair
scala
<|fim_suffix|>shutdownActorSystem(system) } }<|fim_prefix|>/* * Cop<|fim_middle|>yright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>}<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obt<|fim_suffix|>t64Spec extends AnyFunSuite { test("handle values from 0 to 2^64-1") { val a = UInt64(hex"0xffffffffff...
fim
ACINQ/eclair
scala
<|fim_suffix|>stem.eventStream ! EventStream.Publish(ChannelRestored(channel1.ref.toClassic, randomBytes32(), null, randomKey().publicKey, ChannelCodecsSpec.normal)) val channel2 = TestProbe[Any]() system.eventStream ! EventStream.Publish(ChannelRestored(channel2.ref.toClassic, randomBytes32(), null, randomKey(...
fim
ACINQ/eclair
scala
<|fim_prefix|>package fr.acinq.eclair.balance import fr.acinq.bitcoin.scalacompat.SatoshiLong import fr.acinq.eclair.balance.CheckBalance.{MainAndHtlcBalance, OffChainBalance} import fr.acinq.eclair.blockchain.bitcoind.ZmqWatcher.{apply => _, _} import fr.acinq.eclair.channel._ import fr.acinq.eclair.channel.publish.T...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>input txs */ def createSpendManyP2WPKH(txs: Seq[Transaction], priv: PrivateKey, to: PublicKey, fee: Satoshi, sequence: Long, lockTime: Long): Transaction = { // txs send funds to our key val pub = priv.publicKey val inputs = txs.map(tx => { val outputIndex = tx.txOut.indexWhere(_.pu...
fim
ACINQ/eclair
scala
<|fim_suffix|>.expectMsgType[OnChainBalance] } test("automatically fetch updated credentials after restart") { val sender = TestProbe() // We make a first call before restarting bitcoind to ensure we have a first set of valid credentials. val bitcoinClient = new BitcoinCoreClient(bitcoinrpcclient) ...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>package fr.acinq.eclair.blockchain.bitcoind import akka.actor.typed.scaladsl.adapter.ClassicActorSystemOps import fr.acinq.bitcoin.scalacompat.Crypto.TaprootTweak.KeyPathTweak import fr.acinq.bitcoin.scalacompa<|fim_suffix|>eq[ScriptElt]](Script.pay2tr(randomKey().xOnlyPublicKey(), KeyPathTweak)) val...
fim
ACINQ/eclair
scala
<|fim_suffix|>tor1.ref) watcher ! ListWatches(actor1.ref) assert(actor1.expectMsgType[Set[Watch[_]]].isEmpty) }) } }<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. *...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>stHeaders(BlockHeight(60000000), Set.empty, explorer.name)) } } } <|fim_prefix|>/* * Copyright 2020 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * ...
fim
ACINQ/eclair
scala
<|fim_suffix|>ray)), BlockHeaderAt(BlockHeight(630459), BlockHeader.read(hex"0000002030b5d50005fb4b56c1dbe12bc70e951779ab0d07e4ad02000000000000000000a73e505c3943437b0fc732ee69bfda59b48c58709b4543c7b62af5134200684deb8fbe5e397a111745743f34".toArray)), ) sender.expectMessage(LatestHeaders(BlockHeight(630450)...
fim
ACINQ/eclair
scala
<|fim_suffix|>eyBasedChannelKeyPath)) } } <|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-...
fim
ACINQ/eclair
scala
<|fim_suffix|> assert(ChannelTypes.fromFeatures(features) == ChannelTypes.UnsupportedChannelType(features), features) } } test("enrich channel type with optional permanent channel features") { case class TestCase(channelType: SupportedChannelType, localFeatures: Features[InitFeature], remoteFeatures: Fe...
fim
ACINQ/eclair
scala
<|fim_suffix|>mit(0, CommitmentSpec(Set.empty, FeeratePerKw(0 sat), toLocal, toRemote), randomTxId(), IndividualSignature(ByteVector64.Zeroes), Nil) val remoteCommit = RemoteCommit(0, CommitmentSpec(Set.empty, FeeratePerKw(0 sat), toRemote, toLocal), randomTxId(), randomKey().publicKey) val localFundingStatus =...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>duration._ import scala.util.Random /** * A Fuzzy [[fr.acinq.eclair.Pipe]] which randomly disconnects/reconnects peers. */ class FuzzyPipe(fuzzy: Boolean) extends Actor with Stash with ActorLogging { import scala.concurrent.ExecutionContext.Implicits.global def receive = { case (a: ActorRef, ...
fim
ACINQ/eclair
scala
<|fim_suffix|>ce: TestFSMRef[ChannelState, ChannelData, Channel] = TestFSMRef(new Channel(aliceParams, Alice.channelKeys(), wallet, bobParams.nodeId, alice2blockchain.ref, aliceRelayer, FakeTxPublisherFactory(alice2blockchain)), alicePeer.ref) val bob: TestFSMRef[ChannelState, ChannelData, Channel] = TestFSMRef(new...
fim
ACINQ/eclair
scala
<|fim_suffix|>rrevocablySpent = Map.empty ) :: RevokedCommitPublished( commitTx = tx6.tx, localOutput_opt = None, remoteOutput_opt = None, htlcOutputs = Set.empty, htlcDelayedOutputs = Set.empty, irrevocablySpent...
fim
ACINQ/eclair
scala
<|fim_prefix|>package fr.acinq.eclair.channel import akka.actor.typed.scaladsl.adapter._ import akka.actor.{ActorRef, PoisonPill} import akka.testkit.{TestActorRef, TestProbe} import fr.acinq.bitcoin.scalacompat.ByteVector32 import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey import fr.acinq.eclair._ import fr.acinq....
fim
ACINQ/eclair
scala
<|fim_suffix|>(_.relayParams.privateChannelFees.feeProportionalMillionths).setTo(2345) .modify(_.channelConf.expiryDelta).setTo(CltvExpiryDelta(147)), ) foreach { newConfig => val newAlice: TestFSMRef[ChannelState, ChannelData, Channel] = TestFSMRef(new Channel(newConfig, Alice.channelKeys(), aliceWal...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|> 1), Nil, 1) :: TxIn(OutPoint(parentTx2, 0), Nil, 2) :: Nil, TxOut(50_000 sat, Script.pay2wpkh(randomKey().publicKey)) :: Nil, 0 ) monitor ! CheckTx(probe.ref, tx, "many-relative-delays") // The first parent transaction is unconfirmed. awaitCond(bitcoinClient.hasRequest(parent...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>ed] awaitCond(alice.stateName == CLOSED) aliceOpenReplyTo.expectMsg(OpenChannelResponse.TimedOut) } } <|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>)) bobListener.expectMsgType[ChannelAborted] awaitCond(bob.stateName == CLOSED) } test("recv OpenDualFundedChannel (with liquidity ads)", Tag(ChannelStateTestsTags.DualFunding), Tag(ChannelStateTestsTags.LiquidityAds)) { f => import f._ val open = alice2bob.expectMsgType[OpenDualFund...
fim
ACINQ/eclair
scala
<|fim_suffix|>thin(30 seconds) { alice.underlying.system.eventStream.subscribe(aliceListener.ref, classOf[ChannelAborted]) bob.underlying.system.eventStream.subscribe(bobListener.ref, classOf[ChannelAborted]) alice ! channelParams.initChannelAlice(TestConstants.fundingSatoshis, dualFunded = true) ...
fim
ACINQ/eclair
scala
<|fim_suffix|>TransactionPublished].tx.txid == fundingTxId) assert(listener.expectMsgType[NewTransaction].tx.txid == fundingTxId) assert(alice2blockchain.expectMsgType[WatchPublished].txId == fundingTxId) alice2bob.expectMsgType[TxSignatures] awaitCond(alice.stateName == WAIT_FOR_DUAL_FUNDING_CONFIRMED)...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>e2blockchain.expectNoMessage(100 millis) aliceOpenReplyTo.expectMsgType[OpenChannelResponse.Created] } test("recv FundingSigned with valid signature (simple taproot channels)", Tag(ChannelStateTestsTags.OptionSimpleTaproot)) { f => import f._ val listener = TestProbe() alice.underlyin...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2022 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|> onionRoutingPacket = TestConstants.emptyOnionPacket, pathKey_opt = None, accountable = false, fundingFee_opt = None) // both parties will respond to a forbidden msg while quiescent with a warning (and disconnect) bob2alice.forward(alice, forbiddenMsg) alice2bob.expectMsg(Warning(channelId(ali...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_suffix|>} object Responder { val s = dh.generateKeyPair(hex"2121212121212121212121212121212121212121212121212121212121212121") val e = hex"2222222222222222222222222222222222222222222222222222222222222222" } val initiator = HandshakeState.initializeWriter( handshakePattern = handshak...
fim
ACINQ/eclair
scala
/* * Copyright 2025 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>d(ByteVector32(hex"0000000000000000000000000000000000000000000000000000000000000000"), 281474976710655L) == ByteVector32(hex"02a40c85b6f28da08dfdbe0926c53fab2de6d28c10301f8f7c4073d5e42e3148")) assert(ShaChain.shaChainFromSeed(ByteVector32(hex"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...
fim
ACINQ/eclair
scala
<|fim_suffix|>("this is a real ping".getBytes)), probe1.ref) probe2.expectMsg(Ping(1105, ByteVector("this is a real ping".getBytes))) initiator.tell(Ping(65532, ByteVector("this is a reply-less ping for cover traffic".getBytes)), probe1.ref) probe2.expectMsg(Ping(65532, ByteVector("this is a reply-less pin...
fim
ACINQ/eclair
scala
<|fim_suffix|>y.value == ByteVector32(hex"d09ffff62ddb2297ab000cc85bcb4283fdeb6aa052affbc9dddcf33b61078110")) } test("derivation of revocation public key from base point and per-commitment-point") { val basePoint = PublicKey(hex"036d6caac248af96f6afa7f904f550253a0f3ef3f5aa2fe6838a95b216691468e2") val commi...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|> Seq(0, 1, 2), Seq(0)) assert(error.getMessage.contains("utxo mismatch")) } { // do not provide non-witness utxo for utxo #2 val Right(psbt) = for { p0 <- new Psbt(tx).updateWitnessInput(OutPoint(utxos(0), 0), utxos(0).txOut(0), null, Script.pay2pkh(getPublicKey(0)), null...
fim
ACINQ/eclair
scala
<|fim_suffix|>reStatement("INSERT INTO transactions_published VALUES (?, ?, ?, ?, ?, ?)")) { statement => statement.setBytes(1, fundingTx.txid.value.toArray) statement.setBytes(2, channelId1.toArray) statement.setBytes(3, remoteNodeId1.value.toArray) statement.set...
fim
ACINQ/eclair
scala
<|fim_suffix|>y) db.updateChannelMeta(channel1.channelId, ChannelEvent.EventType.PaymentReceived) assert(getTimestamp(dbs, channel1.channelId, "last_payment_received_timestamp").nonEmpty) db.updateChannelMeta(channel1.channelId, ChannelEvent.EventType.Connected) assert(getTimestamp(dbs, channe...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2024 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a <|fim_suffix|>plied. * See the License for the specific language governing permissions and * limitations under the ...
fim
ACINQ/eclair
scala
<|fim_suffix|>on.execSQLQuery("SELECT * FROM network.nodes") res.next() res.getString("json").length > 100 }) assert({ val res = dbs.connection.execSQLQuery("SELECT * FROM network.public_channels WHERE channel_update_1_json IS NOT NULL") res.next() res.getString("channel_announceme...
fim
ACINQ/eclair
scala
<|fim_suffix|>.offer, None, offer1.createdAt).nonEmpty) assert(db.addOffer(offer1.offer, None, TimestampMilli(150)).isEmpty) assert(db.listOffers(onlyActive = true) == Seq(offer1)) val pathId = randomBytes32() val offer2 = OfferData(Offer(Some(15_000 msat), Some("test 2"), randomKey().publicKey,...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>2, msg1))) } } test("migrate database v1 -> current") { forAllDbs { case dbs: TestPgDatabases => migrationCheck( dbs = dbs, initializeTables = connection => { using(connection.createStatement()) { statement => statement.executeUpdate...
fim
ACINQ/eclair
scala
<|fim_prefix|>package fr.acinq.eclair.db import com.typesafe.config.{Config, ConfigFactory} import fr.acinq.eclair.db.Databases.JdbcUrlChanged import fr.acinq.eclair.db.DbEventHandler.ChannelEvent import fr.acinq.eclair.db.pg.PgUtils.ExtendedResultSet._ import fr.acinq.eclair.db.pg.PgUtils.PgLock.{LeaseLock, LockFailu...
fim
ACINQ/eclair
scala
<|fim_suffix|>} (3 to 4).foreach(i => assert(channelsDb.listHtlcInfos(channelId, i).nonEmpty)) testKit.system.eventStream ! EventStream.Publish(ForgetHtlcInfos(channelId, beforeCommitIndex = 5)) eventually { (3 to 4).foreach(i => assert(channelsDb.listHtlcInfos(channelId, i).isEmpty)) } } } <|...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0<|fim_suffix|>el.ChannelPersisted import fr.acinq.eclair.db.Databases.FileBackup import fr.acinq.eclair.db.FileBackupHandler.{BackupCompleted, BackupEvent} import fr.acinq.eclair.db.sqlite.SqliteChannelsDb import fr.acinq.e...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>se ZeroFeeCommitmentFormat => assert(revokedCommitTx.txOut.size == 7) } val outgoingHtlcExpiry = commitmentsF.latest.localCommit.spec.htlcs.collect { case OutgoingHtlc(add) => add.cltvExpiry }.max val htlcTxsF = commitmentsF.latest.htlcTxs(channelKeysF) val htlcTimeoutTxs = htlcTxsF.collec...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2019 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_prefix|>/* * Copyright 2021 ACINQ SAS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
fim
ACINQ/eclair
scala
<|fim_suffix|>) sender.send(bitcoincli, BitcoinReq("getnewaddress")) val JString(address) = sender.expectMsgType[JValue] val channels = for (i <- 0 until 242) yield { // let's generate a block every 10 txs so that we can compute short ids if (i % 10 == 0) { generateBlocks(1, Some(address...
fim
ACINQ/eclair
scala
<|fim_suffix|>: Future[PaymentSent] = Future { val sender = TestProbe() val amountMsat = 100_000.msat // first we retrieve a payment hash from B sender.send(nodes("B").paymentHandler, ReceiveStandardPayment(sender.ref.toTyped, Some(amountMsat), Left("1 coffee"))) val pr = sender.expectMsgType[Bolt11...
fim
ACINQ/eclair
scala
<|fim_suffix|>et", loadWallet = false) val thrown = intercept[BitcoinWalletDisabledException] { instantiateEclairNode("F", createConfig(wallet_opt = None)) } assert(thrown == BitcoinWalletDisabledException(e = JsonRPCError(Error(-32601, "Method not found")))) } test("wait for bitcoind to be avail...
fim
ACINQ/eclair
scala