diff --git a/cmd/waku/rlngenerate/command_rln.go b/cmd/waku/rlngenerate/command_rln.go index c88767f8..19f31632 100644 --- a/cmd/waku/rlngenerate/command_rln.go +++ b/cmd/waku/rlngenerate/command_rln.go @@ -75,17 +75,23 @@ func execute(ctx context.Context) error { return err } - if logger.Level() == zap.DebugLevel { - logger.Info("registered credentials into the membership contract", - logging.HexBytes("IDCommitment", identityCredential.IDCommitment[:]), - logging.HexBytes("IDNullifier", identityCredential.IDNullifier[:]), - logging.HexBytes("IDSecretHash", identityCredential.IDSecretHash[:]), - logging.HexBytes("IDTrapDoor", identityCredential.IDTrapdoor[:]), - zap.Uint("index", membershipIndex), - ) - } else { - logger.Info("registered credentials into the membership contract", logging.HexBytes("idCommitment", identityCredential.IDCommitment[:]), zap.Uint("index", membershipIndex)) - } + //if logger.Level() == zap.DebugLevel { + // Not meant for production use + logger.Info("registered credentials into the membership contract", + logging.HexBytes("IDCommitment", identityCredential.IDCommitment[:]), + logging.HexBytes("IDNullifier", identityCredential.IDNullifier[:]), + logging.HexBytes("IDSecretHash", identityCredential.IDSecretHash[:]), + logging.HexBytes("IDTrapDoor", identityCredential.IDTrapdoor[:]), + zap.Uint("index", membershipIndex), + ) + + fmt.Println("IDCommitment: ", identityCredential.IDCommitment) + fmt.Println("IDNullifier: ", identityCredential.IDNullifier) + fmt.Println("IDSecretHash: ", identityCredential.IDSecretHash) + fmt.Println("IDTrapDoor: ", identityCredential.IDTrapdoor) + //} else { + // logger.Info("registered credentials into the membership contract", logging.HexBytes("idCommitment", identityCredential.IDCommitment[:]), zap.Uint("index", membershipIndex)) + //} web3Config.ETHClient.Close() diff --git a/cmd/waku/server/rest/debug.go b/cmd/waku/server/rest/debug.go index 28333988..68b223be 100644 --- a/cmd/waku/server/rest/debug.go +++ b/cmd/waku/server/rest/debug.go @@ -67,7 +67,7 @@ func (d *DebugService) getV1Version(w http.ResponseWriter, req *http.Request) { type MerkleProofResponse struct { MerkleRoot string `json:"root"` MerkePathElements []string `json:"pathElements"` - MerkePathIndexes []uint `json:"pathIndexes"` + MerkePathIndexes []uint8 `json:"pathIndexes"` LeafIndex uint64 `json:"leafIndex"` CommitmentId string `json:"commitmentId"` } @@ -134,14 +134,14 @@ func (d *DebugService) getV1MerkleProof(w http.ResponseWriter, req *http.Request } elementsStr := make([]string, 0) - indexesStr := make([]uint, 0) + indexesStr := make([]uint8, 0) for _, path := range merkleProof.PathElements { fmt.Println("path: ", path) - elementsStr = append(elementsStr, "0x"+hex.EncodeToString(path[:])) + elementsStr = append(elementsStr, hex.EncodeToString(path[:])) } for _, index := range merkleProof.PathIndexes { - indexesStr = append(indexesStr, uint(index)) + indexesStr = append(indexesStr, uint8(index)) } // TODO: Not nide to get proof and root in different non atomic calls. In an unlikely edge case the tree can change between the two calls @@ -155,7 +155,7 @@ func (d *DebugService) getV1MerkleProof(w http.ResponseWriter, req *http.Request fmt.Println("merkleRoot: ", merkleRoot) writeErrOrResponse(w, nil, MerkleProofResponse{ - MerkleRoot: "0x" + hex.EncodeToString(merkleRoot[:]), + MerkleRoot: hex.EncodeToString(merkleRoot[:]), MerkePathElements: elementsStr, MerkePathIndexes: indexesStr, LeafIndex: uint64(membershipIndex),