Skip to content

Commit 28b0e4e

Browse files
committed
format ciphertext output after encrypt and register
1 parent 248aea3 commit 28b0e4e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

bls-bn254-js/scripts/ibe-encrypt-and-bid.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,20 @@ async function encryptAndRegister(
112112
iface.getEvent("NewBid"),
113113
);
114114

115+
const u: { x: [bigint, bigint], y: [bigint, bigint] } = {
116+
x: [ct.U.x.c0, ct.U.x.c1],
117+
y: [ct.U.y.c0, ct.U.y.c1]
118+
}
119+
120+
const ciphertextObj = {
121+
U: u,
122+
V: `0x${ct.V.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '')}`,
123+
W: `0x${ct.W.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '')}`
124+
}
125+
115126
console.log(`Bid id and timelock request id: ${bidID}`)
116-
console.log(`Bid transaction receipt: ${JSON.stringify(receipt, null, 2)}`)
117-
console.log(`Ciphertext: ${JSON.stringify(ct, null, 2)}`)
127+
console.log(`Bid transaction hash: ${receipt.hash}`)
128+
console.log("Ciphertext:", ciphertextObj)
118129

119130
return {
120131
id: bidID.toString(),

0 commit comments

Comments
 (0)