2019-04-16 12:33:30 +03:00
|
|
|
package contractcourt
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
2019-08-26 15:06:57 +03:00
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
2019-04-16 12:33:30 +03:00
|
|
|
"testing"
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
sphinx "github.com/lightningnetwork/lightning-onion"
|
2020-07-07 20:49:50 +03:00
|
|
|
"github.com/lightningnetwork/lnd/chainntnfs"
|
2019-04-16 12:33:30 +03:00
|
|
|
"github.com/lightningnetwork/lnd/channeldb"
|
2020-07-07 20:49:50 +03:00
|
|
|
"github.com/lightningnetwork/lnd/channeldb/kvdb"
|
2019-08-26 15:06:57 +03:00
|
|
|
"github.com/lightningnetwork/lnd/htlcswitch/hop"
|
2019-04-16 12:33:30 +03:00
|
|
|
"github.com/lightningnetwork/lnd/invoices"
|
2020-08-27 22:34:55 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lntest/mock"
|
2019-04-16 12:33:30 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lntypes"
|
2020-07-07 20:49:50 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lnwallet"
|
2020-07-07 20:49:54 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lnwire"
|
2019-04-16 12:33:30 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
testInitialBlockHeight = 100
|
|
|
|
testHtlcExpiry = 150
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2019-12-20 13:25:07 +03:00
|
|
|
testResPreimage = lntypes.Preimage{1, 2, 3}
|
|
|
|
testResHash = testResPreimage.Hash()
|
|
|
|
testResCircuitKey = channeldb.CircuitKey{}
|
|
|
|
testOnionBlob = []byte{4, 5, 6}
|
|
|
|
testAcceptHeight int32 = 1234
|
2020-07-07 20:49:54 +03:00
|
|
|
testHtlcAmount = 2300
|
2019-04-16 12:33:30 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverFwdPreimageKnown tests resolution of a forwarded htlc
|
|
|
|
// for which the preimage is already known initially.
|
|
|
|
func TestHtlcIncomingResolverFwdPreimageKnown(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, false)
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.witnessBeacon.lookupPreimage[testResHash] = testResPreimage
|
|
|
|
ctx.resolve()
|
|
|
|
ctx.waitForResult(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverFwdContestedSuccess tests resolution of a forwarded
|
|
|
|
// htlc for which the preimage becomes known after the resolver has been
|
|
|
|
// started.
|
|
|
|
func TestHtlcIncomingResolverFwdContestedSuccess(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, false)
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.resolve()
|
|
|
|
|
|
|
|
// Simulate a new block coming in. HTLC is not yet expired.
|
|
|
|
ctx.notifyEpoch(testInitialBlockHeight + 1)
|
|
|
|
|
|
|
|
ctx.witnessBeacon.preImageUpdates <- testResPreimage
|
|
|
|
ctx.waitForResult(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverFwdContestedTimeout tests resolution of a forwarded
|
|
|
|
// htlc that times out after the resolver has been started.
|
|
|
|
func TestHtlcIncomingResolverFwdContestedTimeout(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, false)
|
|
|
|
|
|
|
|
// Replace our checkpoint with one which will push reports into a
|
|
|
|
// channel for us to consume. We replace this function on the resolver
|
|
|
|
// itself because it is created by the test context.
|
|
|
|
reportChan := make(chan *channeldb.ResolverReport)
|
|
|
|
ctx.resolver.Checkpoint = func(_ ContractResolver,
|
|
|
|
reports ...*channeldb.ResolverReport) error {
|
|
|
|
|
|
|
|
// Send all of our reports into the channel.
|
|
|
|
for _, report := range reports {
|
|
|
|
reportChan <- report
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.resolve()
|
|
|
|
|
|
|
|
// Simulate a new block coming in. HTLC expires.
|
|
|
|
ctx.notifyEpoch(testHtlcExpiry)
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
// Assert that we have a failure resolution because our invoice was
|
|
|
|
// cancelled.
|
|
|
|
assertResolverReport(t, reportChan, &channeldb.ResolverReport{
|
|
|
|
Amount: lnwire.MilliSatoshi(testHtlcAmount).ToSatoshis(),
|
|
|
|
ResolverType: channeldb.ResolverTypeIncomingHtlc,
|
|
|
|
ResolverOutcome: channeldb.ResolverOutcomeTimeout,
|
|
|
|
})
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.waitForResult(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverFwdTimeout tests resolution of a forwarded htlc that
|
|
|
|
// has already expired when the resolver starts.
|
|
|
|
func TestHtlcIncomingResolverFwdTimeout(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, true)
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.witnessBeacon.lookupPreimage[testResHash] = testResPreimage
|
|
|
|
ctx.resolver.htlcExpiry = 90
|
|
|
|
ctx.resolve()
|
|
|
|
ctx.waitForResult(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverExitSettle tests resolution of an exit hop htlc for
|
|
|
|
// which the invoice has already been settled when the resolver starts.
|
|
|
|
func TestHtlcIncomingResolverExitSettle(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, true)
|
2019-12-20 13:25:07 +03:00
|
|
|
ctx.registry.notifyResolution = invoices.NewSettleResolution(
|
|
|
|
testResPreimage, testResCircuitKey, testAcceptHeight,
|
2019-12-20 13:25:07 +03:00
|
|
|
invoices.ResultReplayToSettled,
|
2019-12-20 13:25:07 +03:00
|
|
|
)
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.resolve()
|
|
|
|
|
|
|
|
data := <-ctx.registry.notifyChan
|
|
|
|
if data.expiry != testHtlcExpiry {
|
|
|
|
t.Fatal("incorrect expiry")
|
|
|
|
}
|
|
|
|
if data.currentHeight != testInitialBlockHeight {
|
|
|
|
t.Fatal("incorrect block height")
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx.waitForResult(true)
|
2019-08-26 15:06:57 +03:00
|
|
|
|
|
|
|
if !bytes.Equal(
|
|
|
|
ctx.onionProcessor.offeredOnionBlob, testOnionBlob,
|
|
|
|
) {
|
|
|
|
t.Fatal("unexpected onion blob")
|
|
|
|
}
|
2019-04-16 12:33:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverExitCancel tests resolution of an exit hop htlc for
|
|
|
|
// an invoice that is already canceled when the resolver starts.
|
|
|
|
func TestHtlcIncomingResolverExitCancel(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, true)
|
2020-02-06 20:35:10 +03:00
|
|
|
ctx.registry.notifyResolution = invoices.NewFailResolution(
|
2019-12-20 13:25:07 +03:00
|
|
|
testResCircuitKey, testAcceptHeight,
|
2019-12-20 13:25:07 +03:00
|
|
|
invoices.ResultInvoiceAlreadyCanceled,
|
2019-12-20 13:25:07 +03:00
|
|
|
)
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.resolve()
|
|
|
|
ctx.waitForResult(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverExitSettleHodl tests resolution of an exit hop htlc
|
|
|
|
// for a hodl invoice that is settled after the resolver has started.
|
|
|
|
func TestHtlcIncomingResolverExitSettleHodl(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, true)
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.resolve()
|
|
|
|
|
|
|
|
notifyData := <-ctx.registry.notifyChan
|
2020-02-06 20:35:10 +03:00
|
|
|
notifyData.hodlChan <- invoices.NewSettleResolution(
|
2019-12-20 13:25:07 +03:00
|
|
|
testResPreimage, testResCircuitKey, testAcceptHeight,
|
2019-12-20 13:25:07 +03:00
|
|
|
invoices.ResultSettled,
|
2019-12-20 13:25:07 +03:00
|
|
|
)
|
2019-04-16 12:33:30 +03:00
|
|
|
|
|
|
|
ctx.waitForResult(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverExitTimeoutHodl tests resolution of an exit hop htlc
|
|
|
|
// for a hodl invoice that times out.
|
|
|
|
func TestHtlcIncomingResolverExitTimeoutHodl(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, true)
|
|
|
|
|
|
|
|
// Replace our checkpoint with one which will push reports into a
|
|
|
|
// channel for us to consume. We replace this function on the resolver
|
|
|
|
// itself because it is created by the test context.
|
|
|
|
reportChan := make(chan *channeldb.ResolverReport)
|
|
|
|
ctx.resolver.Checkpoint = func(_ ContractResolver,
|
|
|
|
reports ...*channeldb.ResolverReport) error {
|
|
|
|
|
|
|
|
// Send all of our reports into the channel.
|
|
|
|
for _, report := range reports {
|
|
|
|
reportChan <- report
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.resolve()
|
|
|
|
ctx.notifyEpoch(testHtlcExpiry)
|
2020-07-07 20:49:54 +03:00
|
|
|
|
|
|
|
// Assert that we have a failure resolution because our invoice was
|
|
|
|
// cancelled.
|
|
|
|
assertResolverReport(t, reportChan, &channeldb.ResolverReport{
|
|
|
|
Amount: lnwire.MilliSatoshi(testHtlcAmount).ToSatoshis(),
|
|
|
|
ResolverType: channeldb.ResolverTypeIncomingHtlc,
|
|
|
|
ResolverOutcome: channeldb.ResolverOutcomeTimeout,
|
|
|
|
})
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.waitForResult(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
// TestHtlcIncomingResolverExitCancelHodl tests resolution of an exit hop htlc
|
|
|
|
// for a hodl invoice that is canceled after the resolver has started.
|
|
|
|
func TestHtlcIncomingResolverExitCancelHodl(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
defer timeout(t)()
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
ctx := newIncomingResolverTestContext(t, true)
|
|
|
|
|
|
|
|
// Replace our checkpoint with one which will push reports into a
|
|
|
|
// channel for us to consume. We replace this function on the resolver
|
|
|
|
// itself because it is created by the test context.
|
|
|
|
reportChan := make(chan *channeldb.ResolverReport)
|
|
|
|
ctx.resolver.Checkpoint = func(_ ContractResolver,
|
|
|
|
reports ...*channeldb.ResolverReport) error {
|
|
|
|
|
|
|
|
// Send all of our reports into the channel.
|
|
|
|
for _, report := range reports {
|
|
|
|
reportChan <- report
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.resolve()
|
|
|
|
notifyData := <-ctx.registry.notifyChan
|
2020-02-06 20:35:10 +03:00
|
|
|
notifyData.hodlChan <- invoices.NewFailResolution(
|
2019-12-20 13:25:07 +03:00
|
|
|
testResCircuitKey, testAcceptHeight, invoices.ResultCanceled,
|
2019-12-20 13:25:07 +03:00
|
|
|
)
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
// Assert that we have a failure resolution because our invoice was
|
|
|
|
// cancelled.
|
|
|
|
assertResolverReport(t, reportChan, &channeldb.ResolverReport{
|
|
|
|
Amount: lnwire.MilliSatoshi(testHtlcAmount).ToSatoshis(),
|
|
|
|
ResolverType: channeldb.ResolverTypeIncomingHtlc,
|
|
|
|
ResolverOutcome: channeldb.ResolverOutcomeAbandoned,
|
|
|
|
})
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
ctx.waitForResult(false)
|
|
|
|
}
|
|
|
|
|
2019-08-26 15:06:57 +03:00
|
|
|
type mockHopIterator struct {
|
2020-07-07 20:49:54 +03:00
|
|
|
isExit bool
|
2019-08-26 15:06:57 +03:00
|
|
|
hop.Iterator
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *mockHopIterator) HopPayload() (*hop.Payload, error) {
|
2020-07-07 20:49:54 +03:00
|
|
|
var nextAddress [8]byte
|
|
|
|
if !h.isExit {
|
|
|
|
nextAddress = [8]byte{0x01}
|
|
|
|
}
|
|
|
|
|
|
|
|
return hop.NewLegacyPayload(&sphinx.HopData{
|
|
|
|
Realm: [1]byte{},
|
|
|
|
NextAddress: nextAddress,
|
|
|
|
ForwardAmount: 100,
|
|
|
|
OutgoingCltv: 40,
|
|
|
|
ExtraBytes: [12]byte{},
|
|
|
|
}), nil
|
2019-08-26 15:06:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type mockOnionProcessor struct {
|
2020-07-07 20:49:54 +03:00
|
|
|
isExit bool
|
2019-08-26 15:06:57 +03:00
|
|
|
offeredOnionBlob []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *mockOnionProcessor) ReconstructHopIterator(r io.Reader, rHash []byte) (
|
|
|
|
hop.Iterator, error) {
|
|
|
|
|
|
|
|
data, err := ioutil.ReadAll(r)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
o.offeredOnionBlob = data
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
return &mockHopIterator{isExit: o.isExit}, nil
|
2019-08-26 15:06:57 +03:00
|
|
|
}
|
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
type incomingResolverTestContext struct {
|
2019-08-26 15:06:57 +03:00
|
|
|
registry *mockRegistry
|
|
|
|
witnessBeacon *mockWitnessBeacon
|
|
|
|
resolver *htlcIncomingContestResolver
|
2020-08-27 22:34:55 +03:00
|
|
|
notifier *mock.ChainNotifier
|
2019-08-26 15:06:57 +03:00
|
|
|
onionProcessor *mockOnionProcessor
|
|
|
|
resolveErr chan error
|
|
|
|
nextResolver ContractResolver
|
|
|
|
t *testing.T
|
2019-04-16 12:33:30 +03:00
|
|
|
}
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
func newIncomingResolverTestContext(t *testing.T, isExit bool) *incomingResolverTestContext {
|
2020-08-27 22:34:55 +03:00
|
|
|
notifier := &mock.ChainNotifier{
|
|
|
|
EpochChan: make(chan *chainntnfs.BlockEpoch),
|
|
|
|
SpendChan: make(chan *chainntnfs.SpendDetail),
|
|
|
|
ConfChan: make(chan *chainntnfs.TxConfirmation),
|
2019-04-16 12:33:30 +03:00
|
|
|
}
|
|
|
|
witnessBeacon := newMockWitnessBeacon()
|
|
|
|
registry := &mockRegistry{
|
|
|
|
notifyChan: make(chan notifyExitHopData, 1),
|
|
|
|
}
|
|
|
|
|
2020-07-07 20:49:54 +03:00
|
|
|
onionProcessor := &mockOnionProcessor{isExit: isExit}
|
2019-08-26 15:06:57 +03:00
|
|
|
|
2019-04-16 12:33:30 +03:00
|
|
|
checkPointChan := make(chan struct{}, 1)
|
|
|
|
|
|
|
|
chainCfg := ChannelArbitratorConfig{
|
|
|
|
ChainArbitratorConfig: ChainArbitratorConfig{
|
2019-08-26 15:06:57 +03:00
|
|
|
Notifier: notifier,
|
|
|
|
PreimageDB: witnessBeacon,
|
|
|
|
Registry: registry,
|
|
|
|
OnionProcessor: onionProcessor,
|
2019-04-16 12:33:30 +03:00
|
|
|
},
|
2020-07-07 20:49:50 +03:00
|
|
|
PutResolverReport: func(_ kvdb.RwTx,
|
|
|
|
_ *channeldb.ResolverReport) error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
},
|
2019-04-16 12:33:30 +03:00
|
|
|
}
|
|
|
|
|
2019-11-06 15:16:50 +03:00
|
|
|
cfg := ResolverConfig{
|
|
|
|
ChannelArbitratorConfig: chainCfg,
|
2020-07-07 20:49:51 +03:00
|
|
|
Checkpoint: func(_ ContractResolver,
|
|
|
|
_ ...*channeldb.ResolverReport) error {
|
|
|
|
|
2019-11-06 15:16:50 +03:00
|
|
|
checkPointChan <- struct{}{}
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|
2019-04-16 12:33:30 +03:00
|
|
|
resolver := &htlcIncomingContestResolver{
|
2020-12-09 14:24:02 +03:00
|
|
|
htlcSuccessResolver: &htlcSuccessResolver{
|
2019-11-06 15:16:50 +03:00
|
|
|
contractResolverKit: *newContractResolverKit(cfg),
|
|
|
|
htlcResolution: lnwallet.IncomingHtlcResolution{},
|
2019-11-05 16:23:15 +03:00
|
|
|
htlc: channeldb.HTLC{
|
2020-07-07 20:49:54 +03:00
|
|
|
Amt: lnwire.MilliSatoshi(testHtlcAmount),
|
2019-08-26 15:06:57 +03:00
|
|
|
RHash: testResHash,
|
|
|
|
OnionBlob: testOnionBlob,
|
2019-11-05 16:23:15 +03:00
|
|
|
},
|
2019-04-16 12:33:30 +03:00
|
|
|
},
|
|
|
|
htlcExpiry: testHtlcExpiry,
|
|
|
|
}
|
|
|
|
|
|
|
|
return &incomingResolverTestContext{
|
2019-08-26 15:06:57 +03:00
|
|
|
registry: registry,
|
|
|
|
witnessBeacon: witnessBeacon,
|
|
|
|
resolver: resolver,
|
|
|
|
notifier: notifier,
|
|
|
|
onionProcessor: onionProcessor,
|
|
|
|
t: t,
|
2019-04-16 12:33:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *incomingResolverTestContext) resolve() {
|
|
|
|
// Start resolver.
|
|
|
|
i.resolveErr = make(chan error, 1)
|
|
|
|
go func() {
|
|
|
|
var err error
|
|
|
|
i.nextResolver, err = i.resolver.Resolve()
|
|
|
|
i.resolveErr <- err
|
|
|
|
}()
|
|
|
|
|
|
|
|
// Notify initial block height.
|
|
|
|
i.notifyEpoch(testInitialBlockHeight)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *incomingResolverTestContext) notifyEpoch(height int32) {
|
2020-08-27 22:34:55 +03:00
|
|
|
i.notifier.EpochChan <- &chainntnfs.BlockEpoch{
|
2019-04-16 12:33:30 +03:00
|
|
|
Height: height,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *incomingResolverTestContext) waitForResult(expectSuccessRes bool) {
|
|
|
|
i.t.Helper()
|
|
|
|
|
|
|
|
err := <-i.resolveErr
|
|
|
|
if err != nil {
|
|
|
|
i.t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if !expectSuccessRes {
|
2019-10-31 14:59:15 +03:00
|
|
|
if i.nextResolver != nil {
|
2019-04-16 12:33:30 +03:00
|
|
|
i.t.Fatal("expected no next resolver")
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
successResolver, ok := i.nextResolver.(*htlcSuccessResolver)
|
|
|
|
if !ok {
|
|
|
|
i.t.Fatal("expected htlcSuccessResolver")
|
|
|
|
}
|
|
|
|
|
|
|
|
if successResolver.htlcResolution.Preimage != testResPreimage {
|
|
|
|
i.t.Fatal("invalid preimage")
|
|
|
|
}
|
|
|
|
|
|
|
|
successTx := successResolver.htlcResolution.SignedSuccessTx
|
|
|
|
if successTx != nil &&
|
|
|
|
!bytes.Equal(successTx.TxIn[0].Witness[3], testResPreimage[:]) {
|
|
|
|
|
|
|
|
i.t.Fatal("invalid preimage")
|
|
|
|
}
|
|
|
|
}
|