bring examples so tests pass.

This commit is contained in:
fiatjaf
2023-09-18 16:31:05 -03:00
parent 0b433cd95a
commit 5afda80c1a
23 changed files with 19 additions and 5 deletions

View File

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/fiatjaf/opentimestamps"
"github.com/btcsuite/btcd/rpcclient"
"github.com/fiatjaf/opentimestamps"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -56,7 +56,7 @@ func TestVerifyHelloWorld(t *testing.T) {
expectedTime := "2015-05-28T15:41:18Z"
helloWorld, err := opentimestamps.NewDetachedTimestampFromPath(
"../../examples/hello-world.txt.ots",
"../examples/hello-world.txt.ots",
)
require.NoError(t, err)
ts := helloWorld.Timestamp

View File

@@ -11,7 +11,7 @@ import (
)
func examplePaths() []string {
matches, err := filepath.Glob("../examples/*ots")
matches, err := filepath.Glob("./examples/*ots")
if err != nil {
panic(err)
}
@@ -31,7 +31,7 @@ func containsUnknownAttestation(ts *Timestamp) (res bool) {
func TestDecodeHelloWorld(t *testing.T) {
dts, err := NewDetachedTimestampFromPath(
"../examples/hello-world.txt.ots",
"./examples/hello-world.txt.ots",
)
assert.NoError(t, err)

2
examples/bad-stamp.txt Normal file
View 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

Binary file not shown.

0
examples/empty Normal file
View File

BIN
examples/empty.ots Normal file

Binary file not shown.

1
examples/hello-world.txt Normal file
View File

@@ -0,0 +1 @@
Hello World!

Binary file not shown.

1
examples/incomplete.txt Normal file
View File

@@ -0,0 +1 @@
The timestamp on this file is incomplete, and can be upgraded.

BIN
examples/incomplete.txt.ots Normal file

Binary file not shown.

View File

@@ -0,0 +1,2 @@
This file's timestamp has two attestations, one from a known notary, and one
from an unknown notary.

Binary file not shown.

2
examples/merkle1.txt Normal file
View 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

Binary file not shown.

2
examples/merkle2.txt Normal file
View 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

Binary file not shown.

2
examples/merkle3.txt Normal file
View 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

Binary file not shown.

View File

@@ -0,0 +1 @@
This file has an (incomplete) timestamp with two different calendars.

Binary file not shown.

View File

@@ -0,0 +1 @@
This file's timestamp has a single attestation from an unknown notary.

Binary file not shown.

View File

@@ -34,7 +34,7 @@ func newTestDigest(in string) []byte {
func TestRemoteCalendarExample(t *testing.T) {
dts, err := NewDetachedTimestampFromPath(
"../examples/two-calendars.txt.ots",
"./examples/two-calendars.txt.ots",
)
require.NoError(t, err)