Skip to content

Commit

Permalink
add more checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni committed Jun 6, 2024
1 parent 748186f commit 729b225
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 40 deletions.
50 changes: 26 additions & 24 deletions tests_zemu/tests/txs_advanced.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('End to end transactions', function () {

// The builder adds the spend to its state.
const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

// Repeat the process for the second spend.
const req3 = await app.extractSpendData()
Expand All @@ -145,7 +145,7 @@ describe('End to end transactions', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req4 = await app.extractOutputData()
Expand Down Expand Up @@ -303,7 +303,7 @@ describe('End to end transactions', function () {

// Now we start building the transaction using the builder.

// To add transparent inputs to the builder, we dont need fresh information from the ledger.
// To add transparent inputs to the builder, we do not need fresh information from the ledger.
// The builder does need the secp256k1 public key belonging to the address.
// The builder also need outpoint from the blockchain.

Expand All @@ -321,7 +321,7 @@ describe('End to end transactions', function () {
// - the proof generation key belonging to the spend address (proofkey)
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the random verification key (alpha)
// All this is retrieved from the ledger using a extractspenddata call with no inputs.
// All this is retrieved from the ledger using an extractspenddata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req2 = await app.extractSpendData()
Expand All @@ -347,7 +347,7 @@ describe('End to end transactions', function () {
// The builder adds the spend to its state.

const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

// At this point we added all spends.
// We cannot get more spend data from the ledger.
Expand All @@ -357,7 +357,7 @@ describe('End to end transactions', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req4 = await app.extractOutputData()
Expand Down Expand Up @@ -546,7 +546,7 @@ describe('End to end transactions', function () {
- the proof generation key belonging to the spend address (proofkey)
- the randomness needed for the value commitment (rcv)
- the randomness needed for the random verification key (alpha)
All this is retrieved from the ledger using a extractspenddata call with no inputs.
All this is retrieved from the ledger using an extractspenddata call with no inputs.
The ledger already knows how much data it needs to send after the inittx call.
*/

Expand Down Expand Up @@ -578,7 +578,7 @@ describe('End to end transactions', function () {
*/

const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

/*
At this point we added all spends.
Expand All @@ -591,7 +591,7 @@ describe('End to end transactions', function () {
- the randomness needed for the value commitment (rcv)
- the randomness needed for the note commitment (rcm)
- the randomness needed for the random encryption key (esk)
All this is retrieved from the ledger using a extractoutputdata call with no inputs.
All this is retrieved from the ledger using an extractoutputdata call with no inputs.
The ledger already knows how much data it needs to send after the inittx call.
*/

Expand Down Expand Up @@ -751,6 +751,7 @@ describe('End to end transactions', function () {
const testname = `${m.prefix.toLowerCase()}-1-tr-in-1-tr-out-1-spend-2-sh-out`
const last_index = await sim.navigateUntilText('.', testname, sim.startOptions.approveKeyword)
await sim.deleteEvents()
expect(last_index).toEqual(1)

const req = await reqinit

Expand Down Expand Up @@ -794,7 +795,7 @@ describe('End to end transactions', function () {
// - the proof generation key belonging to the spend address (proofkey)
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the random verification key (alpha)
// All this is retrieved from the ledger using a extractspenddata call with no inputs.
// All this is retrieved from the ledger using an extractspenddata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req2 = await app.extractSpendData()
Expand All @@ -820,7 +821,7 @@ describe('End to end transactions', function () {
// The builder adds the spend to its state.

const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

// At this point we added all spends.
// We cannot get more spend data from the ledger.
Expand All @@ -830,7 +831,7 @@ describe('End to end transactions', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req4 = await app.extractOutputData()
Expand Down Expand Up @@ -1209,7 +1210,7 @@ describe('Failing transactions', function () {
// - the proof generation key belonging to the spend address (proofkey)
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the random verification key (alpha)
// All this is retrieved from the ledger using a extractspenddata call with no inputs.
// All this is retrieved from the ledger using an extractspenddata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req2 = await app.extractSpendData()
Expand Down Expand Up @@ -1237,7 +1238,7 @@ describe('Failing transactions', function () {
// The builder adds the spend to its state.

const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

// At this point we added all spends.
// We cannot get more spend data from the ledger.
Expand All @@ -1247,7 +1248,7 @@ describe('Failing transactions', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req4 = await app.extractOutputData()
Expand Down Expand Up @@ -1414,7 +1415,7 @@ describe('Failing transactions', function () {
// - the proof generation key belonging to the spend address (proofkey)
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the random verification key (alpha)
// All this is retrieved from the ledger using a extractspenddata call with no inputs.
// All this is retrieved from the ledger using an extractspenddata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req2 = await app.extractSpendData()
Expand All @@ -1441,7 +1442,7 @@ describe('Failing transactions', function () {
// The builder adds the spend to its state.

const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

// At this point we added all spends.
// We cannot get more spend data from the ledger.
Expand All @@ -1451,7 +1452,7 @@ describe('Failing transactions', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req4 = await app.extractOutputData()
Expand Down Expand Up @@ -1567,7 +1568,7 @@ describe('Failing transactions', function () {
// Now we start building the transaction using the builder.
//

// To add transparent inputs to the builder, we dont need fresh information from the ledger.
// To add transparent inputs to the builder, we do not need fresh information from the ledger.
// The builder does need the secp256k1 public key belonging to the address.
// The builder also need outpoint from the blockchain.

Expand All @@ -1590,7 +1591,7 @@ describe('Failing transactions', function () {
// - the proof generation key belonging to the spend address (proofkey)
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the random verification key (alpha)
// All this is retrieved from the ledger using a extractspenddata call with no inputs.
// All this is retrieved from the ledger using an extractspenddata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req2 = await app.extractSpendData()
Expand Down Expand Up @@ -1618,7 +1619,7 @@ describe('Failing transactions', function () {
// The builder adds the spend to its state.

const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

// At this point we added all spends.
// We cannot get more spend data from the ledger.
Expand All @@ -1629,7 +1630,7 @@ describe('Failing transactions', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req4 = await app.extractOutputData()
Expand Down Expand Up @@ -1824,7 +1825,7 @@ describe('Failing transactions', function () {

// The builder adds the spend to its state.
const b1 = builder.add_sapling_spend(spendj1)
console.log(b1)
expect(b1).toBeTruthy()

// We need to repeat the above process for the second spend.
const req3 = await app.extractSpendData()
Expand Down Expand Up @@ -1852,7 +1853,7 @@ describe('Failing transactions', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.
const req4 = await app.extractOutputData()
console.log(req4)
Expand Down Expand Up @@ -1900,6 +1901,7 @@ describe('Failing transactions', function () {
const ledgerblob_txdata = builder.build(SPEND_PATH, OUTPUT_PATH, bad_tx_version)

const req6 = await app.checkAndSign(ledgerblob_txdata, bad_tx_version)
expect(req6).toBeDefined()
} finally {
await sim.close()
}
Expand Down
34 changes: 18 additions & 16 deletions tests_zemu/tests/txs_basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { get_inittx_data, OUTPUT_PATH, SPEND_PATH, ZcashBuilderBridge } from '@z
import { fee_for, TX_INPUT_DATA } from './_vectors'
import crypto from 'crypto'
import { takeLastSnapshot } from './utils'
import { Signatures } from '@zondax/zcashtools/build/native'
jest.setTimeout(60000)

const tx_version = 0x05
Expand All @@ -38,10 +39,6 @@ describe('tx methods', function () {
const app = new ZCashApp(sim.getTransport())

const tx_input_data = TX_INPUT_DATA[0]
const {
s_spend: [s_spend1, s_spend2],
s_output: [s_out1, s_out2],
} = tx_input_data

const ledgerblob_initdata = get_inittx_data(tx_input_data)
const reqinit = app.initNewTx(ledgerblob_initdata)
Expand Down Expand Up @@ -79,10 +76,10 @@ describe('tx methods', function () {
// Transaction data is collected from the UI and formatted into JSON structures.

const tx_input_data = TX_INPUT_DATA[0]
const {
s_spend: [s_spend1, s_spend2],
s_output: [s_out1, s_out2],
} = tx_input_data
// const {
// s_spend: [s_spend1, s_spend2],
// s_output: [s_out1, s_out2],
// } = tx_input_data

const builder = new ZcashBuilderBridge(fee_for(tx_input_data))

Expand All @@ -100,6 +97,7 @@ describe('tx methods', function () {
const testname = `${m.prefix.toLowerCase()}-2-spend-2-out`
const last_index = await sim.navigateUntilText('.', testname, sim.startOptions.approveKeyword)
await sim.deleteEvents()
expect(last_index).toEqual(23)

const req = await reqinit

Expand Down Expand Up @@ -137,8 +135,8 @@ describe('tx methods', function () {
proofkey: req2.key,
rcv: req2.rcv,
alpha: req2.alpha,
address: s_spend1.address,
value: s_spend1.value,
address: tx_input_data.s_spend[0].address,
value: tx_input_data.s_spend[0].value,
witness: '01305aef35a6fa9dd43af22d2557f99268fbab70a53e963fa67fc762391510406000000000',
rseed: '0000000000000000000000000000000000000000000000000000000000000000',
}
Expand All @@ -156,8 +154,8 @@ describe('tx methods', function () {
proofkey: req3.key,
rcv: req3.rcv,
alpha: req3.alpha,
address: s_spend2.address,
value: s_spend2.value,
address: tx_input_data.s_spend[1].address,
value: tx_input_data.s_spend[1].value,
witness: '01305aef35a6fa9dd43af22d2557f99268fbab70a53e963fa67fc762391510406000000000',
rseed: '0000000000000000000000000000000000000000000000000000000000000000',
}
Expand Down Expand Up @@ -283,7 +281,7 @@ describe('tx methods', function () {
// - the randomness needed for the value commitment (rcv)
// - the randomness needed for the note commitment (rcm)
// - the randomness needed for the random encryption key (esk)
// All this is retrieved from the ledger using a extractoutputdata call with no inputs.
// All this is retrieved from the ledger using an extractoutputdata call with no inputs.
// The ledger already knows how much data it needs to send after the inittx call.

const req4 = await app.extractOutputData()
Expand Down Expand Up @@ -337,14 +335,16 @@ describe('tx methods', function () {
// The builder returns a txdata blob.
// The ledger needs this blob to validate the correctness of the tx.

const ledgerblob_txdata = builder.build(SPEND_PATH, OUTPUT_PATH, tx_version)
const ledgerblob_txdata = Buffer.from(builder.build(SPEND_PATH, OUTPUT_PATH, tx_version))
expect(ledgerblob_txdata).toBeDefined()

// Now the ledger will validate the txdata blob.
// For this, it uses the input from inittx to verify.
// If all checks are ok, the ledger signs the transaction.
// console.log(ledgerblob_txdata.slice(10 * 250 + 116))

const req6 = await app.checkAndSign(ledgerblob_txdata, tx_version)
expect(req6).toBeDefined()
console.log(req6)

// Check the hash of the return
Expand All @@ -367,18 +367,20 @@ describe('tx methods', function () {
// We now add these signatures to the builder.
// Note that for this transaction, we do not have any transparent signatures.

const signatures = {
const signatures: Signatures = {
transparent_sigs: [] as string[],
sapling_sigs: [req7.signature, req8.signature],
}

const b5 = builder.add_signatures(signatures)
console.log(b5)
expect(b5).toBeTruthy()

await takeLastSnapshot(testname, last_index, sim)

// The builder is now done and the transaction is complete.
const b6 = builder.finalize()
expect(b6).toBeDefined()

console.log(b6)
} finally {
await sim.close()
Expand Down

1 comment on commit 729b225

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy reports: 78 concern(s)
  • app/rust/include/zip32.h:3:14: error: [clang-diagnostic-error]

    unknown type name 'uint32_t'

    void get_pkd(uint32_t zip32_account, const uint8_t *diversifier_ptr, uint8_t *pkd);
                 ^
  • app/rust/include/zip32.h:3:44: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void get_pkd(uint32_t zip32_account, const uint8_t *diversifier_ptr, uint8_t *pkd);
                                               ^
  • app/rust/include/zip32.h:3:70: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void get_pkd(uint32_t zip32_account, const uint8_t *diversifier_ptr, uint8_t *pkd);
                                                                         ^
  • app/rust/include/zip32.h:5:24: error: [clang-diagnostic-error]

    unknown type name 'uint32_t'

    void get_pkd_from_seed(uint32_t zip32_account, const uint8_t *start_index, uint8_t *diversifier_ptr, uint8_t *pkd);
                           ^
  • app/rust/include/zip32.h:5:54: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void get_pkd_from_seed(uint32_t zip32_account, const uint8_t *start_index, uint8_t *diversifier_ptr, uint8_t *pkd);
                                                         ^
  • app/rust/include/zip32.h:5:76: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void get_pkd_from_seed(uint32_t zip32_account, const uint8_t *start_index, uint8_t *diversifier_ptr, uint8_t *pkd);
                                                                               ^
  • app/rust/include/zip32.h:5:102: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void get_pkd_from_seed(uint32_t zip32_account, const uint8_t *start_index, uint8_t *diversifier_ptr, uint8_t *pkd);
                                                                                                         ^
  • app/rust/include/zip32.h:7:1: error: [clang-diagnostic-error]

    unknown type name 'bool'

    bool diversifier_is_valid(const uint8_t *diversifier);
    ^
  • app/rust/include/zip32.h:7:33: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    bool diversifier_is_valid(const uint8_t *diversifier);
                                    ^
  • app/rust/include/zip32.h:9:27: error: [clang-diagnostic-error]

    unknown type name 'uint32_t'

    void diversifier_get_list(uint32_t zip32_account, const uint8_t *startindex, uint8_t *diversifier_list);
                              ^
  • app/rust/include/zip32.h:9:57: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void diversifier_get_list(uint32_t zip32_account, const uint8_t *startindex, uint8_t *diversifier_list);
                                                            ^
  • app/rust/include/zip32.h:9:78: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void diversifier_get_list(uint32_t zip32_account, const uint8_t *startindex, uint8_t *diversifier_list);
                                                                                 ^
  • app/rust/include/zip32.h:11:29: error: [clang-diagnostic-error]

    unknown type name 'uint32_t'

    void diversifier_find_valid(uint32_t zip32_account, uint8_t *default_diversifier);
                                ^
  • app/rust/include/zip32.h:11:53: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void diversifier_find_valid(uint32_t zip32_account, uint8_t *default_diversifier);
                                                        ^
  • app/rust/include/zip32.h:15:26: error: [clang-diagnostic-error]

    unknown type name 'uint32_t'

    void zip32_child_ask_nsk(uint32_t account, uint8_t *ask, uint8_t *nsk);
                             ^
  • app/rust/include/zip32.h:15:44: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void zip32_child_ask_nsk(uint32_t account, uint8_t *ask, uint8_t *nsk);
                                               ^
  • app/rust/include/zip32.h:15:58: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void zip32_child_ask_nsk(uint32_t account, uint8_t *ask, uint8_t *nsk);
                                                             ^
  • app/rust/include/zip32.h:17:28: error: [clang-diagnostic-error]

    unknown type name 'uint32_t'

    void zip32_child_proof_key(uint32_t account, uint8_t *ak_ptr, uint8_t *nsk_ptr);
                               ^
  • app/rust/include/zip32.h:17:46: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void zip32_child_proof_key(uint32_t account, uint8_t *ak_ptr, uint8_t *nsk_ptr);
                                                 ^
  • app/rust/include/notes.h:3:30: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void rseed_get_esk_epk(const uint8_t *rseed_ptr, uint8_t *d_ptr, uint8_t *output_esk_ptr, uint8_t *output_epk_ptr);
                                 ^
  • app/rust/include/notes.h:3:50: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void rseed_get_esk_epk(const uint8_t *rseed_ptr, uint8_t *d_ptr, uint8_t *output_esk_ptr, uint8_t *output_epk_ptr);
                                                     ^
  • app/rust/include/notes.h:3:66: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void rseed_get_esk_epk(const uint8_t *rseed_ptr, uint8_t *d_ptr, uint8_t *output_esk_ptr, uint8_t *output_epk_ptr);
                                                                     ^
  • app/rust/include/notes.h:3:91: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void rseed_get_esk_epk(const uint8_t *rseed_ptr, uint8_t *d_ptr, uint8_t *output_esk_ptr, uint8_t *output_epk_ptr);
                                                                                              ^
  • app/rust/include/notes.h:5:26: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void rseed_get_rcm(const uint8_t *rseed_ptr, uint8_t *output_ptr);
                             ^
  • app/rust/include/notes.h:5:46: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void rseed_get_rcm(const uint8_t *rseed_ptr, uint8_t *output_ptr);
                                                 ^
  • app/rust/include/notes.h:7:16: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void ka_to_key(uint8_t *esk_ptr, uint8_t *pkd_ptr, uint8_t *epk_ptr, uint8_t *output_ptr);
                   ^
  • app/rust/include/notes.h:7:34: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void ka_to_key(uint8_t *esk_ptr, uint8_t *pkd_ptr, uint8_t *epk_ptr, uint8_t *output_ptr);
                                     ^
  • app/rust/include/notes.h:7:52: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void ka_to_key(uint8_t *esk_ptr, uint8_t *pkd_ptr, uint8_t *epk_ptr, uint8_t *output_ptr);
                                                       ^
  • app/rust/include/notes.h:7:70: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void ka_to_key(uint8_t *esk_ptr, uint8_t *pkd_ptr, uint8_t *epk_ptr, uint8_t *output_ptr);
                                                                         ^
  • app/rust/include/notes.h:9:27: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void prepare_compact_note(uint8_t *d, uint64_t value, uint8_t *rcm_ptr, uint8_t memotype, uint8_t *out_ptr);
                              ^
  • app/rust/include/notes.h:9:39: error: [clang-diagnostic-error]

    unknown type name 'uint64_t'

    void prepare_compact_note(uint8_t *d, uint64_t value, uint8_t *rcm_ptr, uint8_t memotype, uint8_t *out_ptr);
                                          ^
  • app/rust/include/notes.h:9:55: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void prepare_compact_note(uint8_t *d, uint64_t value, uint8_t *rcm_ptr, uint8_t memotype, uint8_t *out_ptr);
                                                          ^
  • app/rust/include/notes.h:9:73: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void prepare_compact_note(uint8_t *d, uint64_t value, uint8_t *rcm_ptr, uint8_t memotype, uint8_t *out_ptr);
                                                                            ^
  • app/rust/include/notes.h:9:91: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void prepare_compact_note(uint8_t *d, uint64_t value, uint8_t *rcm_ptr, uint8_t memotype, uint8_t *out_ptr);
                                                                                              ^
  • app/rust/include/commitments.h:3:24: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void compute_nullifier(uint8_t *ncm_ptr, uint64_t note_pos, const uint8_t *nsk_ptr, uint8_t *out_ptr);
                           ^
  • app/rust/include/commitments.h:3:42: error: [clang-diagnostic-error]

    unknown type name 'uint64_t'

    void compute_nullifier(uint8_t *ncm_ptr, uint64_t note_pos, const uint8_t *nsk_ptr, uint8_t *out_ptr);
                                             ^
  • app/rust/include/commitments.h:3:67: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void compute_nullifier(uint8_t *ncm_ptr, uint64_t note_pos, const uint8_t *nsk_ptr, uint8_t *out_ptr);
                                                                      ^
  • app/rust/include/commitments.h:3:85: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void compute_nullifier(uint8_t *ncm_ptr, uint64_t note_pos, const uint8_t *nsk_ptr, uint8_t *out_ptr);
                                                                                        ^
  • app/rust/include/commitments.h:6:11: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
              ^
    /__w/ledger-zcash/ledger-zcash/app/rust/include/commitments.h:6:29: error: parameter 'value' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls,-warnings-as-errors]
        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                ^~~~~~
  • app/rust/include/commitments.h:6:35: error: [clang-diagnostic-error]

    unknown type name 'uint64_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                      ^
  • app/rust/include/commitments.h:6:57: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                                            ^
  • app/rust/include/commitments.h:6:89: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                                                                            ^
  • app/rust/include/commitments.h:6:103: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                                                                                          ^
  • app/rust/include/commitments.h:9:11: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
              ^
    /__w/ledger-zcash/ledger-zcash/app/rust/include/commitments.h:9:29: error: parameter 'value' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls,-warnings-as-errors]
        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                ^~~~~~
  • app/rust/include/commitments.h:9:35: error: [clang-diagnostic-error]

    unknown type name 'uint64_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                      ^
  • app/rust/include/commitments.h:9:57: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                                            ^
  • app/rust/include/commitments.h:9:89: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                                                                            ^
  • app/rust/include/commitments.h:9:103: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        const uint8_t *rcm_ptr, const uint64_t value, const uint8_t *diversifier_ptr, const uint8_t *pkd, uint8_t *out_ptr);
                                                                                                          ^
  • app/rust/include/commitments.h:11:37: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void compute_value_commitment(const uint8_t *rcm_ptr, const uint64_t value, uint8_t *out_ptr);
                                        ^
    /__w/ledger-zcash/ledger-zcash/app/rust/include/commitments.h:11:55: error: parameter 'value' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls,-warnings-as-errors]
    void compute_value_commitment(const uint8_t *rcm_ptr, const uint64_t value, uint8_t *out_ptr);
                                                          ^~~~~~
  • app/rust/include/commitments.h:11:61: error: [clang-diagnostic-error]

    unknown type name 'uint64_t'

    void compute_value_commitment(const uint8_t *rcm_ptr, const uint64_t value, uint8_t *out_ptr);
                                                                ^
  • app/rust/include/commitments.h:11:77: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    void compute_value_commitment(const uint8_t *rcm_ptr, const uint64_t value, uint8_t *out_ptr);
                                                                                ^
  • app/src/key.h:25:5: error: [clang-diagnostic-error]

    unknown type name 'key_type_e'

        key_type_e kind;
        ^
  • app/src/key.h:26:5: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

        uint8_t len;
        ^
  • app/src/key.h:30:25: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t key_getNumItems(uint8_t *num_items);
                            ^
  • app/src/key.h:33:21: error: [clang-diagnostic-error]

    unknown type name 'int8_t'

    zxerr_t key_getItem(int8_t displayIdx,
                        ^
  • app/src/key.h:35:21: error: [clang-diagnostic-error]

    unknown type name 'uint16_t'

                        uint16_t outKeyLen,
                        ^
  • app/src/key.h:37:21: error: [clang-diagnostic-error]

    unknown type name 'uint16_t'

                        uint16_t outValueLen,
                        ^
  • app/src/key.h:38:21: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

                        uint8_t pageIdx,
                        ^
  • app/src/key.h:39:21: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

                        uint8_t *pageCount);
                        ^
  • app/src/refactor/txid.h:19:1: error: [clang-diagnostic-error]

    unknown type name 'zxerr_t'

    zxerr_t nu5_transparent_prevouts_hash(const uint8_t *input, uint8_t *output);
    ^
  • app/src/refactor/txid.h:19:45: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_transparent_prevouts_hash(const uint8_t *input, uint8_t *output);
                                                ^
  • app/src/refactor/txid.h:19:61: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_transparent_prevouts_hash(const uint8_t *input, uint8_t *output);
                                                                ^
  • app/src/refactor/txid.h:21:1: error: [clang-diagnostic-error]

    unknown type name 'zxerr_t'

    zxerr_t nu5_transparent_sequence_hash(const uint8_t *input, uint8_t *output);
    ^
  • app/src/refactor/txid.h:21:45: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_transparent_sequence_hash(const uint8_t *input, uint8_t *output);
                                                ^
  • app/src/refactor/txid.h:21:61: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_transparent_sequence_hash(const uint8_t *input, uint8_t *output);
                                                                ^
  • app/src/refactor/txid.h:23:1: error: [clang-diagnostic-error]

    unknown type name 'zxerr_t'

    zxerr_t nu5_transparent_outputs_hash(uint8_t *output);
    ^
  • app/src/refactor/txid.h:23:38: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_transparent_outputs_hash(uint8_t *output);
                                         ^
  • app/src/refactor/txid.h:25:1: error: [clang-diagnostic-error]

    unknown type name 'zxerr_t'

    zxerr_t nu5_hash_sapling_spends(const uint8_t *input, uint8_t *output);
    ^
  • app/src/refactor/txid.h:25:39: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_hash_sapling_spends(const uint8_t *input, uint8_t *output);
                                          ^
  • app/src/refactor/txid.h:25:55: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_hash_sapling_spends(const uint8_t *input, uint8_t *output);
                                                          ^
  • app/src/refactor/txid.h:27:1: error: [clang-diagnostic-error]

    unknown type name 'zxerr_t'

    zxerr_t nu5_hash_sapling_outputs(const uint8_t *input, uint8_t *output);
    ^
  • app/src/refactor/txid.h:27:40: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_hash_sapling_outputs(const uint8_t *input, uint8_t *output);
                                           ^
  • app/src/refactor/txid.h:27:56: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t nu5_hash_sapling_outputs(const uint8_t *input, uint8_t *output);
                                                           ^
  • app/src/refactor/txid.h:29:1: error: [clang-diagnostic-error]

    unknown type name 'zxerr_t'

    zxerr_t hash_header_txid_data(const uint8_t *input, uint8_t *output);
    ^
  • app/src/refactor/txid.h:29:37: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t hash_header_txid_data(const uint8_t *input, uint8_t *output);
                                        ^
  • app/src/refactor/txid.h:29:53: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t hash_header_txid_data(const uint8_t *input, uint8_t *output);
                                                        ^
  • app/src/refactor/txid.h:31:1: error: [clang-diagnostic-error]

    unknown type name 'zxerr_t'

    zxerr_t hash_transparent_txid_data(const uint8_t *input, uint8_t *output);
    ^
  • app/src/refactor/txid.h:31:42: error: [clang-diagnostic-error]

    unknown type name 'uint8_t'

    zxerr_t hash_transparent_txid_data(const uint8_t *input, uint8_t *output);
                                             ^

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.