Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-sectorbuilder
Commits
6c13c17b
Commit
6c13c17b
authored
Jan 30, 2020
by
Łukasz Magiera
Browse files
TestVerifyEmpty
parent
f42e16df
Changes
1
Hide whitespace changes
Inline
Side-by-side
sectorbuilder_test.go
View file @
6c13c17b
...
...
@@ -13,12 +13,13 @@ import (
"time"
ffi
"github.com/filecoin-project/filecoin-ffi"
"github.com/filecoin-project/go-address"
paramfetch
"github.com/filecoin-project/go-paramfetch"
"github.com/filecoin-project/go-sectorbuilder/fs"
"github.com/ipfs/go-datastore"
logging
"github.com/ipfs/go-log"
sectorbuilder
"github.com/filecoin-project/go-sectorbuilder"
"github.com/filecoin-project/go-sectorbuilder/fs"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
...
...
@@ -385,3 +386,34 @@ func TestAcquireID(t *testing.T) {
t
.
Error
(
err
)
}
}
// TestVerifyEmpty tests a certain assumption
func
TestVerifyEmpty
(
t
*
testing
.
T
)
{
cSeed
:=
[
32
]
byte
{
0
,
9
,
2
,
7
,
6
,
5
,
4
,
3
,
2
,
1
,
0
,
9
,
8
,
7
,
6
,
45
,
3
,
2
,
1
,
0
,
9
,
8
,
7
,
6
,
5
,
4
,
3
,
2
,
1
,
0
,
9
}
sr
:=
[
32
]
byte
{
0
,
9
,
2
,
7
,
6
,
5
,
4
,
3
,
2
,
1
,
43
,
9
,
8
,
7
,
6
,
45
,
3
,
2
,
1
,
0
,
9
,
8
,
7
,
6
,
5
,
4
,
3
,
2
,
1
,
0
,
9
}
t0101
,
err
:=
address
.
NewIDAddress
(
101
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
return
}
ok
,
err
:=
sectorbuilder
.
ProofVerifier
.
VerifyFallbackPost
(
context
.
TODO
(),
1024
,
sectorbuilder
.
NewSortedPublicSectorInfo
([]
ffi
.
PublicSectorInfo
{
{
SectorID
:
sectorSize
,
CommR
:
sr
},
{
SectorID
:
sectorSize
,
CommR
:
sr
},
}),
cSeed
[
:
],
nil
,
// 0s
nil
,
// 0s
t0101
,
2
)
//fault everything
if
err
!=
nil
{
t
.
Fatal
(
err
)
return
}
if
!
ok
{
t
.
Error
(
"proof not ok"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment