forked from scroll-tech/scroll
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mock.go
45 lines (36 loc) · 1.13 KB
/
mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//go:build mock_prover
package core
import (
"math/big"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/core/types"
"scroll-tech/common/types/message"
"scroll-tech/prover/config"
)
// ProverCore sends block-traces to rust-prover through socket and get back the zk-proof.
type ProverCore struct {
cfg *config.ProverCoreConfig
VK string
}
// NewProverCore inits a ProverCore object.
func NewProverCore(cfg *config.ProverCoreConfig) (*ProverCore, error) {
return &ProverCore{cfg: cfg}, nil
}
func (p *ProverCore) ProveChunk(taskID string, traces []*types.BlockTrace) (*message.ChunkProof, error) {
_empty := common.BigToHash(big.NewInt(0))
return &message.ChunkProof{
StorageTrace: _empty[:],
Protocol: _empty[:],
Proof: _empty[:],
Instances: _empty[:],
Vk: _empty[:],
}, nil
}
func (p *ProverCore) ProveBatch(taskID string, chunkInfos []*message.ChunkInfo, chunkProofs []*message.ChunkProof) (*message.BatchProof, error) {
_empty := common.BigToHash(big.NewInt(0))
return &message.BatchProof{
Proof: _empty[:],
Instances: _empty[:],
Vk: _empty[:],
}, nil
}