mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
get jwt proverVersion
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
jwt "github.com/appleboy/gin-jwt/v2"
|
||||
"scroll-tech/common/version"
|
||||
"time"
|
||||
|
||||
@@ -324,7 +325,8 @@ func (m *ProofReceiverLogic) checkIsTimeoutFailure(ctx context.Context, hash, pr
|
||||
}
|
||||
|
||||
func (m *ProofReceiverLogic) verifyChunkProof(c *gin.Context, proof *message.ChunkProof) (bool, error) {
|
||||
proverVersion := c.GetString(coordinatorType.ProverVersion)
|
||||
claims := jwt.ExtractClaims(c)
|
||||
proverVersion := claims[coordinatorType.ProverVersion]
|
||||
switch proverVersion {
|
||||
case version.ZkVersion:
|
||||
return m.verifier.VerifyChunkProof(proof)
|
||||
@@ -335,7 +337,8 @@ func (m *ProofReceiverLogic) verifyChunkProof(c *gin.Context, proof *message.Chu
|
||||
}
|
||||
|
||||
func (m *ProofReceiverLogic) verifyBatchProof(c *gin.Context, proof *message.BatchProof) (bool, error) {
|
||||
proverVersion := c.GetString(coordinatorType.ProverVersion)
|
||||
claims := jwt.ExtractClaims(c)
|
||||
proverVersion := claims[coordinatorType.ProverVersion]
|
||||
switch proverVersion {
|
||||
case version.ZkVersion:
|
||||
return m.verifier.VerifyBatchProof(proof)
|
||||
|
||||
@@ -108,7 +108,8 @@ func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL stri
|
||||
}
|
||||
|
||||
func setEnv(t *testing.T) {
|
||||
version.Version = "v1.2.3-aaa-bbb-ccc"
|
||||
version.Version = "v1.2.3-commit-prover-halo2"
|
||||
version.OldZkVersion = "prover_old"
|
||||
|
||||
base = docker.NewDockerApp()
|
||||
base.RunDBImage(t)
|
||||
|
||||
Reference in New Issue
Block a user