mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-24 23:55:18 +00:00
v1.2.10 (#55)
This commit is contained in:
parent
c96a3b7538
commit
f8726882de
@ -678,24 +678,6 @@ func (p *PebbleClockStore) fillAggregateProofs(
|
||||
frame.Filter,
|
||||
commit,
|
||||
frame.FrameNumber,
|
||||
func(typeUrl string, data [][]byte) ([]byte, error) {
|
||||
if typeUrl == protobufs.IntrinsicExecutionOutputType {
|
||||
o := &protobufs.IntrinsicExecutionOutput{}
|
||||
copiedLeft := make([]byte, len(data[0]))
|
||||
copiedRight := make([]byte, len(data[1]))
|
||||
copy(copiedLeft, data[0])
|
||||
copy(copiedRight, data[1])
|
||||
|
||||
o.Address = copiedLeft[:32]
|
||||
o.Output = copiedLeft[32:]
|
||||
o.Proof = copiedRight
|
||||
return proto.Marshal(o)
|
||||
}
|
||||
|
||||
copied := make([]byte, len(data[0]))
|
||||
copy(copied, data[0])
|
||||
return copied, nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"go.uber.org/zap"
|
||||
"golang.org/x/crypto/sha3"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
||||
)
|
||||
|
||||
@ -89,7 +90,6 @@ func internalGetAggregateProof(
|
||||
filter []byte,
|
||||
commitment []byte,
|
||||
frameNumber uint64,
|
||||
inclusionReassembler func(typeUrl string, data [][]byte) ([]byte, error),
|
||||
) (*protobufs.InclusionAggregateProof, error) {
|
||||
value, closer, err := db.Get(dataProofMetadataKey(filter, commitment))
|
||||
if err != nil {
|
||||
@ -169,9 +169,24 @@ func internalGetAggregateProof(
|
||||
}
|
||||
}
|
||||
|
||||
inclusionCommitment.Data, err = inclusionReassembler(string(url), chunks)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "get aggregate proof")
|
||||
if string(url) == protobufs.IntrinsicExecutionOutputType {
|
||||
o := &protobufs.IntrinsicExecutionOutput{}
|
||||
copiedLeft := make([]byte, len(chunks[0]))
|
||||
copiedRight := make([]byte, len(chunks[1]))
|
||||
copy(copiedLeft, chunks[0])
|
||||
copy(copiedRight, chunks[1])
|
||||
|
||||
o.Address = copiedLeft[:32]
|
||||
o.Output = copiedLeft[32:]
|
||||
o.Proof = copiedRight
|
||||
inclusionCommitment.Data, err = proto.Marshal(o)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "get aggregate proof")
|
||||
}
|
||||
} else {
|
||||
copied := make([]byte, len(chunks[0]))
|
||||
copy(copied, chunks[0])
|
||||
inclusionCommitment.Data = copied
|
||||
}
|
||||
|
||||
aggregate.InclusionCommitments = append(
|
||||
@ -192,14 +207,12 @@ func (p *PebbleDataProofStore) GetAggregateProof(
|
||||
filter []byte,
|
||||
commitment []byte,
|
||||
frameNumber uint64,
|
||||
inclusionReassembler func(typeUrl string, data [][]byte) ([]byte, error),
|
||||
) (*protobufs.InclusionAggregateProof, error) {
|
||||
return internalGetAggregateProof(
|
||||
p.db,
|
||||
filter,
|
||||
commitment,
|
||||
frameNumber,
|
||||
inclusionReassembler,
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user