Skip to content

Commit f652172

Browse files
committed
oops, fixed SDK DST issue and update README
1 parent a6f4257 commit f652172

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

confidential-assets/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pnpm test tests/e2e/
9494
9595
pnpm test decryption
9696
97-
pnpm jest tests/e2e/confidentialAsset.test.ts -t "rotate Alice" --runInBand
97+
pnpm test tests/e2e/confidentialAsset.test.ts -t "rotate Alice" --runInBand
9898
```
9999

100100
Or, run all tests:
@@ -107,11 +107,11 @@ pnpm test
107107
### Discrete log / decryption benchmarks
108108

109109
```bash
110-
pnpm jest tests/units/discrete-log.test.ts
110+
pnpm test tests/units/discrete-log.test.ts
111111
```
112112

113113
### Range proof tests
114114

115115
```bash
116-
pnpm jest tests/units/confidentialProofs.test.ts
116+
pnpm test tests/units/confidentialProofs.test.ts
117117
```

confidential-assets/src/crypto/sigmaProtocolWithdraw.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,20 @@ const TYPE_NAME = "0x7::sigma_protocol_withdraw::Withdrawal";
4747
/**
4848
* BCS-serialize a WithdrawSession matching the Move struct:
4949
* ```move
50-
* struct WithdrawSession { sender: address, asset_type: Object<Metadata>, num_chunks: u64 }
50+
* struct WithdrawSession { sender: address, asset_type: Object<Metadata>, num_chunks: u64, has_auditor: bool }
5151
* ```
5252
*/
5353
export function bcsSerializeWithdrawSession(
5454
senderAddress: Uint8Array,
5555
tokenTypeAddress: Uint8Array,
5656
numChunks: number,
57+
hasAuditor: boolean,
5758
): Uint8Array {
5859
const serializer = new Serializer();
5960
serializer.serialize(new FixedBytes(senderAddress));
6061
serializer.serialize(new FixedBytes(tokenTypeAddress));
6162
serializer.serialize(new U64(numChunks));
63+
serializer.serializeBool(hasAuditor);
6264
return serializer.toUint8Array();
6365
}
6466

@@ -336,7 +338,7 @@ function proveWithdrawInternal(
336338
const witness: bigint[] = [dkBigint, ...newAmountChunks, ...newRandomness];
337339

338340
// Build domain separator
339-
const sessionId = bcsSerializeWithdrawSession(senderAddress, tokenAddress, ell);
341+
const sessionId = bcsSerializeWithdrawSession(senderAddress, tokenAddress, ell, hasAuditor);
340342
const dst: DomainSeparator = {
341343
contractAddress: APTOS_EXPERIMENTAL_ADDRESS,
342344
chainId,
@@ -481,7 +483,7 @@ function verifyWithdrawInternal(
481483
scalars: [vScalar],
482484
};
483485

484-
const sessionId = bcsSerializeWithdrawSession(senderAddress, tokenAddress, ell);
486+
const sessionId = bcsSerializeWithdrawSession(senderAddress, tokenAddress, ell, hasAuditor);
485487
const dst: DomainSeparator = {
486488
contractAddress: APTOS_EXPERIMENTAL_ADDRESS,
487489
chainId,

confidential-assets/vitest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export default defineConfig({
66
globals: true,
77
environment: "node",
88
setupFiles: [path.resolve(__dirname, "../tests/setupDotenv.ts")],
9+
// NOTE: We typically test confidential assets after making changes to the
10+
// Aptos framework, which require a manual localnet re-deployment. So this
11+
// automatic deployment before every test is disabled, as a result.
912
//globalSetup: [path.resolve(__dirname, "../tests/preTest.ts")],
1013
include: ["tests/**/*.test.ts"],
1114
exclude: ["tests/units/api/**"],

0 commit comments

Comments
 (0)