text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>nownFundingTxs(alice, bob, carol)))
carol.watcher.setAutoPilot(watcherAutopilot(knownFundingTxs(alice, bob, carol)))
openChannel(alice, bob, 100_000 sat).channelId
openChannel(bob, carol, 100_000 sat).channelId
// alice now knows about bob-carol
eventually {
val routerData = ge... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.integration.basic
import fr.acinq.bitcoin.scalacompat.{ByteVector32, SatoshiLong}
import fr.acinq.eclair.channel._
import fr.acinq.eclair.integration.basic.fixtures.MinimalNodeFixture.getPeerChannels
import fr.acinq.eclair.integration.basic.fixtures.composite.TwoNodesFixture
impor... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.integration.basic.channel
import com.softwaremill.quicklens.ModifyPimp
import fr.acinq.bitcoin.scalacompat.{ByteVector32, SatoshiLong}
import fr.acinq.eclair.channel.states.ChannelStateTestsTags
import fr.acinq.eclair.channel.{DATA_NORMAL, LocalFundingStatus, RES_SPLICE}
import fr... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclai<|fim_suffix|> | use-slf4j = false
| actor.debug.event-stream = off
| }""".stripMargin
}.withFallback(ConfigFactory.load())
.resolve()
}
<|fim_middle|>r.integration.basic.fixtures
import com.typesafe.config.{Config, ConfigFactory... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.integration.basic.fixtures
import akka.actor.typed.Behavior
import akka.actor.typed.scaladsl.Behaviors
import akka.actor.typed.scaladsl.adapter.{ClassicActorRefOps, ClassicActorSystemOps}
import akka.actor.{ActorRef, ActorSystem, typed}
import akka.testkit.{TestActor, TestProbe}
i... | fim | ACINQ/eclair | scala |
<|fim_suffix|> FixtureUtils.actorSystemConfig(testName)),
alice = MinimalNodeFixture(aliceParams, testName),
bob = MinimalNodeFixture(bobParams, testName),
carol = MinimalNodeFixture(carolParams, testName),
)
}
}<|fim_prefix|>package fr.acinq.eclair.integration.basic.fixtures.composite
import a... | fim | ACINQ/eclair | scala |
<|fim_suffix|>m)
TestKit.shutdownActorSystem(system)
}
}
object TwoNodesFixture {
def apply(aliceParams: NodeParams, bobParams: NodeParams, testName: String): TwoNodesFixture = {
TwoNodesFixture(
system = ActorSystem("system-test", FixtureUtils.actorSystemConfig(testName)),
alice = MinimalNodeF... | 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 |
package fr.acinq.eclair.integration.basic.zeroconf
import com.softwaremill.quicklens.ModifyPimp
import fr.acinq.bitcoin.scalacompat.{ByteVector32, SatoshiLong}
import fr.acinq.eclair.FeatureSupport.Optional
import fr.acinq.eclair.Features.ZeroConf
import fr.acinq.eclair.channel.ChannelTypes.AnchorOutputsZeroFeeHtlcTx
... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.integration.basic.zeroconf
import akka.actor.testkit.typed.scaladsl.TestProbe
import akka.actor.typed.scaladsl.adapter.ClassicActorSystemOps
import com.softwaremill.quicklens._
import fr.acinq.bitcoin.scalacompat.{ByteVector32, SatoshiLong}
import fr.acinq.eclair.FeatureSupport.{M... | fim | ACINQ/eclair | scala |
<|fim_suffix|> connection1: Crypto.PublicKey = randomKey().publicKey
val connection2: Crypto.PublicKey = randomKey().publicKey
override def withFixture(test: OneArgTest): Outcome = {
val nodeParams1 = nodeParams.copy(peerConnectionConf = nodeParams.peerConnectionConf.copy(maxNoChannels = 2))
val switchboar... | 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 |
/*
* 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 2023 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.io
import akka.actor.testkit.typed.scaladsl.{ScalaTestWithActorTestKit, TestProbe}
import akka.actor.typed.ActorRef
import akka.actor.typed.scaladsl.adapter.TypedActorRefOps
import com.typesafe.config.ConfigFactory
import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey
import fr.aci... | fim | ACINQ/eclair | scala |
<|fim_suffix|>)
val spliceLocked2 = SpliceLocked(channelId2, randomTxId())
transport.send(peerConnection, spliceLocked2)
transport.expectMsg(TransportHandler.ReadAck(spliceLocked2))
peer.expectMsg(spliceLocked2)
peer.expectNoMessage(100 millis)
transport.send(peerConnection, commitSigs3.last)
... | fim | ACINQ/eclair | scala |
<|fim_suffix|>er.Registered]()
val notifier2b = TestProbe[PeerReadyManager.Registered]()
// Later attempts aren't affected by previously completed attempts.
manager ! PeerReadyManager.Register(notifier2a.ref, remoteNodeId2)
assert(notifier2a.expectMessageType[PeerReadyManager.Registered].otherAttempts ... | fim | ACINQ/eclair | scala |
<|fim_suffix|>ic, remoteNodeId, null))
val request2 = switchboard.expectMessageType[Switchboard.GetPeerInfo]
request2.replyTo ! Peer.PeerInfo(peer.ref.toClassic, remoteNodeId, Peer.CONNECTED, Some(remoteFeatures), None, Set(TestProbe().ref.toClassic))
peer.expectMessageType[Peer.GetPeerChannels]
// The... | 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|> new channel requests for peers below limit are accepted after matching confirmed/closed/aborted
(peersBelowLimit :+ peerAtLimit1).foreach { peer =>
limiter ! PendingChannelsRateLimiter.AddOrRejectChannel(probe.ref, peer, randomBytes32())
router.expectMessageType[GetNode].replyTo ! PublicN... | fim | ACINQ/eclair | scala |
<|fim_suffix|>eLimiter(10)
for(_ <- 1 to 11) {
rateLimiter.tryAcquire()
}
assert(!rateLimiter.tryAcquire())
sleep(1 second)
assert(rateLimiter.tryAcquire())
}
}
<|fim_prefix|>/*
* Copyright 2022 ACINQ SAS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not ... | 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 |
package fr.acinq.eclair.io
import akka.actor.typed.scaladsl.adapter.ClassicActorRefOps
import akka.actor.{Actor, ActorContext, ActorRef, Props}
import akka.testkit.{TestActorRef, TestProbe}
import com.softwaremill.quicklens.ModifyPimp
import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey
import fr.acinq.bitcoin.scalaco... | fim | ACINQ/eclair | scala |
<|fim_suffix|> process(dave, onionForDave) match {
case ReceiveMessage(finalPayload, _) => assert(finalPayload.pathId_opt.contains(pathId))
case x => fail(x.toString)
}
case x => fail(x.toString)
}
case x => fail(x.toString)
... | fim | ACINQ/eclair | scala |
/*
* 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 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 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 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|>val f = createFixture(10 seconds, 1000 msat)
val parts = Seq(
createMultiPartHtlc(1000 msat, 600 msat, 1),
createMultiPartHtlc(1000 msat, 400 msat, 2)
)
f.parent.send(f.handler, parts.head)
f.handler.suspend()
f.handler.resume(new IllegalArgumentException("something went w... | fim | ACINQ/eclair | scala |
<|fim_suffix|>nse(Seq(route)))
childPayFsm.expectMsgType[SendPaymentToRoute]
childPayFsm.expectNoMessage(100 millis)
// B doesn't have enough liquidity on this channel.
// NB: we need a channel update with a valid signature, otherwise we'll ignore the node instead of this specific channel.
val chan... | fim | ACINQ/eclair | scala |
<|fim_suffix|>ort scala.concurrent.duration._
class PaymentHandlerSpec extends TestKitBaseClass with AnyFunSuiteLike {
test("compose payment handlers") {
val handler = system.actorOf(PaymentHandler.props(Alice.nodeParams, TestProbe().ref, TestProbe().ref))
val intHandler = new ReceiveHandler {
overri... | fim | ACINQ/eclair | scala |
<|fim_suffix|>egacy payment for 0-value invoice") { f =>
import f._
// This is disabled because it would let the trampoline node steal the whole payment (if malicious).
val routingHints = List(List(Bolt11Invoice.ExtraHop(b, channelUpdate_bc.shortChannelId, 10 msat, 100, CltvExpiryDelta(144))))
val invoi... | 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|>_d.amountMsat), paymentHash, payload_d.outgoingCltv(add_d.cltvExpiry), packet_e, None, accountable = false, None)
val Left(failure) = decrypt(add_e, priv_e.privateKey, Features.empty)
assert(failure == FinalIncorrectHtlcAmount(invalidTotalAmount))
}
test("fail to decrypt at the final trampoli... | fim | ACINQ/eclair | scala |
<|fim_suffix|>= buildHtlcIn(0, channelId_ab_1, paymentHash1, blinded = true)
val upstream = Upstream.Cold.Channel(htlc_ab.add, a)
val htlc_bc = buildHtlcOut(6, channelId_bc_1, paymentHash1, blinded = true)
val data_ab = ChannelCodecsSpec.makeChannelDataNormal(Seq(htlc_ab), Map.empty)
val data_bc = Chann... | fim | ACINQ/eclair | scala |
<|fim_suffix|>chainHash)
offerManager ! RegisterOffer(offer, Some(nodeParams.privateKey), None, handler.ref)
// Request invoice.
val payerKey = randomKey()
requestInvoice(payerKey, offer, nodeParams.privateKey, amount, offerManager, postman.ref)
val invoice = receiveInvoice(f, amount, payerKey, node... | fim | ACINQ/eclair | scala |
<|fim_suffix|>tStream.Subscribe(probe.ref)
val purger = testKit.spawn(InvoicePurger(db, interval), name = "purge-expired-invoices")
// check that the initial purge scanned the entire database
probe.expectMessage(10 seconds, PurgeCompleted)
probe.expectNoMessage()
assert(db.listExpiredIncomingPayme... | fim | ACINQ/eclair | scala |
<|fim_suffix|>ckHeight(100)))
probe.expectMessage(AsyncPaymentTimeout)
// Second watch succeeds
system.eventStream ! EventStream.Publish(PeerConnected(peer.ref.toClassic, remoteNodeId, null))
val request2 = switchboard.expectMessageType[Switchboard.GetPeerInfo]
request2.replyTo ! Peer.PeerInfo(peer... | fim | ACINQ/eclair | scala |
<|fim_suffix|>n = false)
val r = createValidIncomingPacket(payload, outgoingAmount + u.channelUpdate.feeBaseMsat, outgoingExpiry + u.channelUpdate.cltvExpiryDelta)
channelRelayer ! Relay(r, TestConstants.Alice.nodeParams.nodeId, 0.1)
// We try to wake-up the next node.
peerReadyManager.expectMessageTy... | fim | ACINQ/eclair | scala |
<|fim_suffix|>eReason.LocalFailure(IncorrectOrUnknownPaymentDetails(extra.add.amountMsat, nodeParams.currentBlockHeight))
assert(fwd.message == CMD_FAIL_HTLC(extra.add.id, failure, Some(FailureAttributionData(extraReceivedAt, None)), commit = true))
register.expectNoMessage(100 millis)
}
test("fail all ad... | fim | ACINQ/eclair | scala |
<|fim_suffix|>millis)
}
test("stop when disconnecting without pending proposals") { f =>
import f._
connect(peer)
probe.watch(peer.ref)
disconnect()
probe.expectTerminated(peer.ref)
}
test("stop when disconnecting with non-funded pending proposals") { f =>
import f._
connect(peer... | fim | ACINQ/eclair | scala |
<|fim_suffix|>iv_a.publicKey, add_bc, HtlcResult.OnChainFulfill(randomBytes32())),
RES_ADD_SETTLED(trampolineOrigin, priv_a.publicKey, add_bc, HtlcResult.RemoteFulfill(UpdateFulfillHtlc(add_bc.channelId, add_bc.id, randomBytes32()))),
RES_ADD_SETTLED(trampolineOrigin, priv_a.publicKey, add_bc, HtlcResult.On... | 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 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 2023 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.profit
import akka.actor.testkit.typed.scaladsl.{ScalaTestWithActorTestKit, TestProbe}
import akka.actor.typed.ActorRef
import akka.actor.typed.scaladsl.adapter.TypedActorRefOps
import com.typesafe.config.ConfigFactory
import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey
import fr... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.profit
import akka.actor.ActorRef
import akka.actor.testkit.typed.scaladsl.{ScalaTestWithActorTestKit, TestProbe}
import com.typesafe.config.ConfigFactory
import fr.acinq.bitcoin.scalacompat.Crypto.{PrivateKey, PublicKey}
import fr.acinq.bitcoin.scalacompat.{Block, BtcAmount, BtcD... | fim | ACINQ/eclair | scala |
<|fim_suffix|>on.NoRelatedChannel => ()
case _: GossipDecision.RelatedChannelPruned => ()
// NB: if a new gossip decision is added, this pattern matching will fail
// this serves as a reminder that a new codec is to be added in EclairInternalsSerializer.codec
}
}
}
<|fim_prefix|>/*
* Copyrigh... | fim | ACINQ/eclair | scala |
<|fim_suffix|>ed =
OutgoingHtlcFulfilled(UpdateFulfillHtlc(add.channelId, add.id, randomBytes32(), TlvStream.empty))
def makeOutgoingHtlcFailed(add: UpdateAddHtlc): OutgoingHtlcFailed =
OutgoingHtlcFailed(UpdateFailHtlc(add.channelId, add.id, randomBytes(100), TlvStream.empty))
test("channel relay") { f =... | fim | ACINQ/eclair | scala |
<|fim_suffix|>endingHtlc(HtlcId(add4), isSuccess = false, TimestampMilli(0) + 2.minutes)
assert(r.getConfidence(1 msat, 0, BlockHeight(0), CltvExpiry(1), TimestampMilli(0) + 2.minutes) === 0.1 +- 0.01)
assert(r.getConfidence(1 msat, 1, BlockHeight(0), CltvExpiry(1), TimestampMilli(0) + 2.minutes) === 0.5 +- 0.0... | 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|>'t matter which edge is selected, the balance estimation takes all existing edges into account.
val edge_ab = makeEdge(a, b, 1, 10 sat)
val edge_ba = makeEdge(b, a, 1, 10 sat)
val edge_bc = makeEdge(b, c, 6, 10 sat)
assert(graphWithBalances.balances.get(edge_ab).canSend(27500 msat, now) ==... | fim | ACINQ/eclair | scala |
<|fim_suffix|>eatureSupport.Optional,
)
val offer = Offer(None, Some("Bolt12 r0cks"), recipientKey.publicKey, features, Block.RegtestGenesisBlock.hash)
val invoiceRequest = InvoiceRequest(offer, amount, 1, features, randomKey(), Block.RegtestGenesisBlock.hash)
val blindedRoutes = paths.map(hops => {
... | 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_suffix|>r).foreach { case (b, a) => validate(b, a) }
}
// empty chunk
{
val chunks = makeChunk(0, 0) :: Nil
assert(enforceMaximumSize(chunks) == chunks)
}
// chunks are just below the limit
{
val chunks = makeChunk(0, Sync.MAXIMUM_CHUNK_SIZE) :: makeChunk(Sync.MAXIMUM_C... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.router
import akka.Done
import akka.actor.ActorSystem
import akka.testkit.{TestFSMRef, TestProbe}
import fr.acinq.bitcoin.scalacompat.{SatoshiLong, Script, Transaction, TxOut}
import fr.acinq.eclair.blockchain.bitcoind.ZmqWatcher._
import fr.acinq.eclair.channel.states.{ChannelSta... | 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|>t.isEmpty)
}
test("routes found (with pending payments)") { fixture =>
import fixture._
val sender = TypedProbe[PaymentRouteResponse]()(system.toTyped)
val routeParams = DEFAULT_ROUTE_PARAMS.copy(boundaries = SearchBoundaries(15 msat, 0.0, 6, CltvExpiryDelta(1008)))
val recipient = Cl... | 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|>uites.toList.sortBy(-_._2).take(20).foreach { case (name, duration) => println(s" ${duration}ms\t${name} ") }
case _ =>
()
}
}
<|fim_prefix|>package fr.acinq.eclair.testutils
import org.scalatest.Reporter
import org.scalatest.events.{Event, RunCompleted, SuiteCompleted, TestSucceeded}
/**
... | fim | ACINQ/eclair | scala |
/*
* 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 or agreed to in... | fim | ACINQ/eclair | scala |
<|fim_suffix|>= synchronized {
buffer = Vector.empty
}
}
<|fim_prefix|>package fr.acinq.eclair.testutils
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logba<|fim_middle|>ck.core.AppenderBase
/**
* Heavily inspired by [[akka.actor.testkit.typed.intern... | fim | ACINQ/eclair | scala |
<|fim_suffix|>ack.ContextSelector=fr.acinq.eclair.testutils.MyContextSelector}}}
* But relying on system properties is not convenient because intellij ignore
* values set in pom.xml, so we must set them manually when running tests within
* the IDE.
*/
val Singleton: MyContextSelector = new MyContextSelect... | fim | ACINQ/eclair | scala |
package fr.acinq.eclair.testutils
import akka.actor.{Actor, ExtendedActorSystem}
import akka.dispatch.RequiresMessageQueue
import akka.event.Logging.{Debug, Error, Info, InitializeLogger, LogEvent, LogEventWithCause, LogEventWithMarker, LoggerInitialized, Warning}
import akka.event.slf4j.{SLF4JLogging, Slf4jLogMarker}... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.testutils
import akka.testkit.TestProbe
import fr.acinq.bitcoin.scalacompat.{OutPoint, Satoshi, TxId}
import fr.acinq.eclair.MilliSatoshi
import fr.acinq.eclair.blockchain.bitcoind.ZmqWatcher._
import fr.acinq.eclair.blockchain.fee.ConfirmationTarget
import fr.acinq.eclair.channel... | fim | ACINQ/eclair | scala |
<|fim_suffix|>roxyAddress(
address = NodeAddress.fromParts("[fc92:97a3:e057:b290:abd8:9bd6:135d:7e7]", 9735).get,
proxyParams = Socks5ProxyParams(address = proxyAddress, credentials_opt = None, randomizeCredentials = false, useForIPv4 = true, useForIPv6 = false, useForTor = true, useForWatchdogs = true, use... | fim | ACINQ/eclair | scala |
<|fim_suffix|>c264903346e05d1675e77795529e22ca90918dee7\r\n"
)
expectMsg(ByteString("AUTHENTICATE 0ddcab5deb39876cdef7af7860a1c738953395349f43b99f4e5e0f131b0515df\r\n"))
protocolHandler ! ByteString(
"250 OK\r\n"
)
expectMsg(ByteString("ADD_ONION NEW:ED25519-V3 Port=9999,9999\r\n"))
prot... | fim | ACINQ/eclair | scala |
<|fim_prefix|>/*
* Copyright<|fim_suffix|> CltvExpiry(400), TestConstants.emptyOnionPacket, None, accountable = false, None)
val spec2 = CommitmentSpec.reduce(spec1, add2 :: Nil, Nil)
assert(spec2 == spec1.copy(htlcs = Set(OutgoingHtlc(add1), OutgoingHtlc(add2)), toLocal = 2000000 msat))
val ful1 = Update... | fim | ACINQ/eclair | scala |
<|fim_suffix|>]) {
val commitmentFormat: CommitmentFormat = ZeroFeeCommitmentFormat
val localFundingPriv: PrivateKey = PrivateKey(ByteVector.fromValidHex(local_funding_priv))
val remoteFundingPriv: PrivateKey = PrivateKey(ByteVector.fromValidHex(remote_funding_priv))
val fundingOutput: OutPoint = OutPoi... | fim | ACINQ/eclair | scala |
<|fim_suffix|>.copy(toRemote = belowDustWithFeeAndAnchors)
val outputs = makeCommitTxOutputs(localFundingPriv.publicKey, remoteFundingPriv.publicKey, commitInput, localKeys.publicKeys, payCommitTxFees = false, localDustLimit, toLocalDelay, toRemoteFunderBelowDust, UnsafeLegacyAnchorOutputsCommitmentFormat)
... | 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 |
/*
* 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|>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 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|>hecksums(List(Checksums(1, 1), Checksums(2, 2), Checksums(3, 3)))
),
Set(GenericTlv(UInt64(7), ByteVector.fromValidHex("deadbeef")))
)
)
val encoded = replyChannelRangeCodec.encode(replyChannelRange).require
val decoded = replyChannelRangeCodec.decode(encoded).require.va... | 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|> Left(failure))
case None => assert(result.isRight)
}
}
}
}
<|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 copy of the Licens... | fim | ACINQ/eclair | scala |
package fr.acinq.eclair.wire.protocol
import fr.acinq.bitcoin.scalacompat.Crypto.{PrivateKey, PublicKey}
import fr.acinq.bitcoin.scalacompat.{Block, ByteVector32}
import fr.acinq.eclair.crypto.Sphinx
import fr.acinq.eclair.crypto.Sphinx.RouteBlinding
import fr.acinq.eclair.payment.{Bolt12Invoice, PaymentBlindedRoute}
... | 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 |
package fr.acinq.eclair.wire.protocol
import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey
import fr.acinq.eclair.crypto.Sphinx
import fr.acinq.eclair.crypto.Sphinx.RouteBlinding.BlindedRouteDetails
import fr.acinq.eclair.wire.protocol.OnionRoutingCodecs.{ForbiddenTlv, MissingRequiredTlv}
import fr.acinq.eclair.wire.p... | 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|>.selfMember) {
log.info("we have joined the cluster")
frontJoinedCluster.success(Done)
}
case MemberLeft(member) => maybeShutdown(member)
case MemberDowned(member) => maybeShutdown(member)
case UnreachableMember(member) => maybeShutdown(member)
}
private def maybeShu... | fim | ACINQ/eclair | scala |
<|fim_suffix|>ps(routerConf, remoteRouter, Some(frontRouterInitialized)), "front-router", SupervisorStrategy.Resume))
_ <- frontRouterInitialized.future
clientSpawner = system.actorOf(Props(new ClientSpawner(keyPair, socks5ProxyParams_opt, peerConnectionConf, remoteSwitchboard, frontRouter)), name = "clien... | fim | ACINQ/eclair | scala |
<|fim_suffix|>gin =>
log.debug("acking msg={} for origin={}", rejected.ann, origin)
origin.peerConnection ! TransportHandler.ReadAck(rejected.ann)
origin.peerConnection ! rejected
}
case None => ()
}
stay() using d.copy(processing = d.processing - rejected.ann)
... | fim | ACINQ/eclair | scala |
<|fim_suffix|>ab))
peerConnection1b.expectMsg(GossipDecision.Accepted(channelUpdate_ab))
peerConnection3a.send(front3, PeerRoutingMessage(peerConnection3a.ref, origin3a.nodeId, ann_b))
peerConnection3a.expectMsg(TransportHandler.ReadAck(ann_b))
peerConnection3a.expectMsg(GossipDecision.Accepted(ann_b))... | fim | ACINQ/eclair | scala |
<|fim_suffix|>data, PERM | 22)
@FuzzTest(maxDuration = "")
def fuzzInvalidOnionBlinding(data: FuzzedDataProvider): Unit =
failureRoundTrip(data, BADONION | PERM | 24)
}
<|fim_prefix|>package fr.acinq.eclair.wire.protocol
import com.code_intelligence.jazzer.api.FuzzedDataProvider
import com.code_intelligence.j... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.wire.protocol
import com.code_intelligence.jazzer.api.FuzzedDataProvider
import com.code_intelligence.jazzer.junit.FuzzTest
import fr.acinq.bitcoin.scalacompat.Protocol
import fr.acinq.eclair.wire.protocol.LightningMessageCodecs.lightningMessageCodec
import scodec.bits.ByteVector
... | fim | ACINQ/eclair | scala |
<|fim_prefix|>package fr.acinq.eclair.wire.protocol
import com.code_intelligence.jazzer.api.FuzzedDataProvider
import com.code_intelligence.jazzer.junit.FuzzTest
import scodec.bits.ByteVector
/**
* Fuzz tests for onion payload codecs.
*/
c<|fim_suffix|>nsumeRemainingAsBytes())
val decoded = PaymentOnionCodecs.p... | fim | ACINQ/eclair | scala |
<|fim_suffix|>its)
if (decoded.isFailure) return
val encoded1 = blindedRouteDataCodec.encode(decoded.require.value).require
val encoded2 = blindedRouteDataCodec.encode(blindedRouteDataCodec.decode(encoded1).require.value).require
assert(encoded1 == encoded2)
}
}
<|fim_prefix|>package fr.acinq.eclair.... | 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<|fim_suffix|>ves: 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|>
import akka.http.scaladsl.server.Directive0
import akka.http.scaladsl.server.directives.Credentials
import fr.acinq.eclair.api.Service
import scala.concurrent.Future
import scala.concurrent.duration.DurationInt
trait AuthDirective {
this: Service with EclairDirectives =>
/**
* A directive0 tha... | 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 <|fim_suffix|>t-Type, Authorization") ::
`Access-Control-Allow-Methods`(POST) ::
`Cache-Control`(... | 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_suffix|>)).toList.flatten
val shortChannelId: List[ChannelIdentifier] = shortChannelId_opt.map(scid => Right(scid)).toList
val shortChannelIds: List[ChannelIdentifier] = shortChannelIds_opt.map(_.map(scid => Right(scid))).toList.flatten
provide((channelId ++ channelIds ++ shortChannelId ++ short... | fim | ACINQ/eclair | scala |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.