bring examples so tests pass.
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fiatjaf/opentimestamps"
|
|
||||||
"github.com/btcsuite/btcd/rpcclient"
|
"github.com/btcsuite/btcd/rpcclient"
|
||||||
|
"github.com/fiatjaf/opentimestamps"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
@@ -56,7 +56,7 @@ func TestVerifyHelloWorld(t *testing.T) {
|
|||||||
expectedTime := "2015-05-28T15:41:18Z"
|
expectedTime := "2015-05-28T15:41:18Z"
|
||||||
|
|
||||||
helloWorld, err := opentimestamps.NewDetachedTimestampFromPath(
|
helloWorld, err := opentimestamps.NewDetachedTimestampFromPath(
|
||||||
"../../examples/hello-world.txt.ots",
|
"../examples/hello-world.txt.ots",
|
||||||
)
|
)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
ts := helloWorld.Timestamp
|
ts := helloWorld.Timestamp
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func examplePaths() []string {
|
func examplePaths() []string {
|
||||||
matches, err := filepath.Glob("../examples/*ots")
|
matches, err := filepath.Glob("./examples/*ots")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ func containsUnknownAttestation(ts *Timestamp) (res bool) {
|
|||||||
|
|
||||||
func TestDecodeHelloWorld(t *testing.T) {
|
func TestDecodeHelloWorld(t *testing.T) {
|
||||||
dts, err := NewDetachedTimestampFromPath(
|
dts, err := NewDetachedTimestampFromPath(
|
||||||
"../examples/hello-world.txt.ots",
|
"./examples/hello-world.txt.ots",
|
||||||
)
|
)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
2
examples/bad-stamp.txt
Normal file
2
examples/bad-stamp.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
The timestamp on this file is well-formatted, but will fail Bitcoin block
|
||||||
|
header validation.
|
||||||
BIN
examples/bad-stamp.txt.ots
Normal file
BIN
examples/bad-stamp.txt.ots
Normal file
Binary file not shown.
0
examples/empty
Normal file
0
examples/empty
Normal file
BIN
examples/empty.ots
Normal file
BIN
examples/empty.ots
Normal file
Binary file not shown.
1
examples/hello-world.txt
Normal file
1
examples/hello-world.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Hello World!
|
||||||
BIN
examples/hello-world.txt.ots
Normal file
BIN
examples/hello-world.txt.ots
Normal file
Binary file not shown.
1
examples/incomplete.txt
Normal file
1
examples/incomplete.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
The timestamp on this file is incomplete, and can be upgraded.
|
||||||
BIN
examples/incomplete.txt.ots
Normal file
BIN
examples/incomplete.txt.ots
Normal file
Binary file not shown.
2
examples/known-and-unknown-notary.txt
Normal file
2
examples/known-and-unknown-notary.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
This file's timestamp has two attestations, one from a known notary, and one
|
||||||
|
from an unknown notary.
|
||||||
BIN
examples/known-and-unknown-notary.txt.ots
Normal file
BIN
examples/known-and-unknown-notary.txt.ots
Normal file
Binary file not shown.
2
examples/merkle1.txt
Normal file
2
examples/merkle1.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
This file is one of three different files that have been timestamped together
|
||||||
|
with a single merkle tree. (1/3)
|
||||||
BIN
examples/merkle1.txt.ots
Normal file
BIN
examples/merkle1.txt.ots
Normal file
Binary file not shown.
2
examples/merkle2.txt
Normal file
2
examples/merkle2.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
This file is one of three different files that have been timestamped together
|
||||||
|
with a single merkle tree. (2/3)
|
||||||
BIN
examples/merkle2.txt.ots
Normal file
BIN
examples/merkle2.txt.ots
Normal file
Binary file not shown.
2
examples/merkle3.txt
Normal file
2
examples/merkle3.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
This file is one of three different files that have been timestamped together
|
||||||
|
with a single merkle tree. (3/3)
|
||||||
BIN
examples/merkle3.txt.ots
Normal file
BIN
examples/merkle3.txt.ots
Normal file
Binary file not shown.
1
examples/two-calendars.txt
Normal file
1
examples/two-calendars.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
This file has an (incomplete) timestamp with two different calendars.
|
||||||
BIN
examples/two-calendars.txt.ots
Normal file
BIN
examples/two-calendars.txt.ots
Normal file
Binary file not shown.
1
examples/unknown-notary.txt
Normal file
1
examples/unknown-notary.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
This file's timestamp has a single attestation from an unknown notary.
|
||||||
BIN
examples/unknown-notary.txt.ots
Normal file
BIN
examples/unknown-notary.txt.ots
Normal file
Binary file not shown.
@@ -34,7 +34,7 @@ func newTestDigest(in string) []byte {
|
|||||||
|
|
||||||
func TestRemoteCalendarExample(t *testing.T) {
|
func TestRemoteCalendarExample(t *testing.T) {
|
||||||
dts, err := NewDetachedTimestampFromPath(
|
dts, err := NewDetachedTimestampFromPath(
|
||||||
"../examples/two-calendars.txt.ots",
|
"./examples/two-calendars.txt.ots",
|
||||||
)
|
)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user