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
+2 -2
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
+2 -2
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
View File
@@ -0,0 +1,2 @@
The timestamp on this file is well-formatted, but will fail Bitcoin block
header validation.
Binary file not shown.
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
Hello World!
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
The timestamp on this file is incomplete, and can be upgraded.
Binary file not shown.
+2
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
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)
Binary file not shown.
+2
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)
Binary file not shown.
+2
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)
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
This file has an (incomplete) timestamp with two different calendars.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
This file's timestamp has a single attestation from an unknown notary.
Binary file not shown.
+1 -1
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)