cbindgen 0.14

This commit is contained in:
Jack Grigg 2020-09-22 18:54:09 +01:00 committed by Francisco Gindre
parent 94d397ed13
commit 48a601600b
3 changed files with 74 additions and 77 deletions

128
Cargo.lock generated
View File

@ -271,18 +271,18 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
[[package]]
name = "cbindgen"
version = "0.8.7"
version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f861ef68cabbb271d373a7795014052bff37edce22c620d95e395e8719d7dc5"
checksum = "afa64e93023395ee316490cf013f07f753bc88d116eb1aec1bcee7d63fbcca53"
dependencies = [
"clap",
"heck",
"log",
"proc-macro2 0.4.30",
"quote 0.6.13",
"proc-macro2",
"quote",
"serde",
"serde_derive",
"serde_json",
"syn 0.15.44",
"syn",
"tempfile",
"toml",
]
@ -428,9 +428,9 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
dependencies = [
"proc-macro2 1.0.21",
"quote 1.0.7",
"syn 1.0.41",
"proc-macro2",
"quote",
"syn",
"synstructure",
]
@ -547,6 +547,15 @@ dependencies = [
"subtle",
]
[[package]]
name = "heck"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "hermit-abi"
version = "0.1.16"
@ -741,22 +750,13 @@ version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
[[package]]
name = "proc-macro2"
version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
dependencies = [
"unicode-xid 0.1.0",
]
[[package]]
name = "proc-macro2"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c"
dependencies = [
"unicode-xid 0.2.1",
"unicode-xid",
]
[[package]]
@ -784,22 +784,13 @@ dependencies = [
"protobuf-codegen",
]
[[package]]
name = "quote"
version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
dependencies = [
"proc-macro2 0.4.30",
]
[[package]]
name = "quote"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
dependencies = [
"proc-macro2 1.0.21",
"proc-macro2",
]
[[package]]
@ -954,9 +945,9 @@ version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
dependencies = [
"proc-macro2 1.0.21",
"quote 1.0.7",
"syn 1.0.41",
"proc-macro2",
"quote",
"syn",
]
[[package]]
@ -1036,11 +1027,11 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
dependencies = [
"proc-macro2 1.0.21",
"quote 1.0.7",
"proc-macro2",
"quote",
"serde",
"serde_derive",
"syn 1.0.41",
"syn",
]
[[package]]
@ -1050,13 +1041,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
dependencies = [
"base-x",
"proc-macro2 1.0.21",
"quote 1.0.7",
"proc-macro2",
"quote",
"serde",
"serde_derive",
"serde_json",
"sha1",
"syn 1.0.41",
"syn",
]
[[package]]
@ -1077,26 +1068,15 @@ version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd"
[[package]]
name = "syn"
version = "0.15.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
dependencies = [
"proc-macro2 0.4.30",
"quote 0.6.13",
"unicode-xid 0.1.0",
]
[[package]]
name = "syn"
version = "1.0.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6690e3e9f692504b941dc6c3b188fd28df054f7fb8469ab40680df52fdcc842b"
dependencies = [
"proc-macro2 1.0.21",
"quote 1.0.7",
"unicode-xid 0.2.1",
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
@ -1105,10 +1085,10 @@ version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
dependencies = [
"proc-macro2 1.0.21",
"quote 1.0.7",
"syn 1.0.41",
"unicode-xid 0.2.1",
"proc-macro2",
"quote",
"syn",
"unicode-xid",
]
[[package]]
@ -1166,17 +1146,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa"
dependencies = [
"proc-macro-hack",
"proc-macro2 1.0.21",
"quote 1.0.7",
"proc-macro2",
"quote",
"standback",
"syn 1.0.41",
"syn",
]
[[package]]
name = "toml"
version = "0.4.10"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a"
dependencies = [
"serde",
]
@ -1187,18 +1167,18 @@ version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
[[package]]
name = "unicode-segmentation"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
[[package]]
name = "unicode-width"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
[[package]]
name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
[[package]]
name = "unicode-xid"
version = "0.2.1"
@ -1248,9 +1228,9 @@ dependencies = [
"bumpalo",
"lazy_static",
"log",
"proc-macro2 1.0.21",
"quote 1.0.7",
"syn 1.0.41",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
@ -1260,7 +1240,7 @@ version = "0.2.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038"
dependencies = [
"quote 1.0.7",
"quote",
"wasm-bindgen-macro-support",
]
@ -1270,9 +1250,9 @@ version = "0.2.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe"
dependencies = [
"proc-macro2 1.0.21",
"quote 1.0.7",
"syn 1.0.41",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]

View File

@ -21,7 +21,7 @@ default-features = false
features = ["local-prover"]
[build-dependencies]
cbindgen = "0.8"
cbindgen = "0.14"
[lib]
name = "zcashlc"

View File

@ -12,9 +12,11 @@ void zcashlc_clear_last_error(void);
/**
* Creates a transaction paying the specified address from the given account.
*
* Returns the row index of the newly-created transaction in the `transactions` table
* within the data database. The caller can read the raw transaction bytes from the `raw`
* column in order to broadcast the transaction to the network.
*
* Do not call this multiple times in parallel, or you will generate transactions that
* double-spend the same notes.
*/
@ -53,6 +55,7 @@ int32_t zcashlc_error_message_utf8(char *buf, int32_t length);
/**
* Returns the address for the account.
*
* Call `zcashlc_string_free` on the returned pointer when you are finished with it.
*/
char *zcashlc_get_address(const uint8_t *db_data, uintptr_t db_data_len, int32_t account);
@ -64,8 +67,10 @@ int64_t zcashlc_get_balance(const uint8_t *db_data, uintptr_t db_data_len, int32
/**
* Returns the memo for a received note, if it is known and a valid UTF-8 string.
*
* The note is identified by its row index in the `received_notes` table within the data
* database.
*
* Call `zcashlc_string_free` on the returned pointer when you are finished with it.
*/
char *zcashlc_get_received_memo_as_utf8(const uint8_t *db_data,
@ -74,8 +79,10 @@ char *zcashlc_get_received_memo_as_utf8(const uint8_t *db_data,
/**
* Returns the memo for a sent note, if it is known and a valid UTF-8 string.
*
* The note is identified by its row index in the `sent_notes` table within the data
* database.
*
* Call `zcashlc_string_free` on the returned pointer when you are finished with it.
*/
char *zcashlc_get_sent_memo_as_utf8(const uint8_t *db_data, uintptr_t db_data_len, int64_t id_note);
@ -90,8 +97,10 @@ int64_t zcashlc_get_verified_balance(const uint8_t *db_data,
/**
* Initialises the data database with the given number of accounts using the given seed.
*
* Returns the ExtendedSpendingKeys for the accounts. The caller should store these
* securely for use while spending.
*
* Call `zcashlc_vec_string_free` on the returned pointer when you are finished with it.
*/
char **zcashlc_init_accounts_table(const uint8_t *db_data,
@ -102,6 +111,7 @@ char **zcashlc_init_accounts_table(const uint8_t *db_data,
/**
* Initialises the data database with the given block.
*
* This enables a newly-created database to be immediately-usable, without needing to
* synchronise historic blocks.
*/
@ -137,6 +147,7 @@ int32_t zcashlc_last_error_length(void);
/**
* Rewinds the data database to the given height.
*
* If the requested height is greater than or equal to the height of the last scanned
* block, this function does nothing.
*/
@ -145,13 +156,16 @@ int32_t zcashlc_rewind_to_height(const uint8_t *db_data, uintptr_t db_data_len,
/**
* Scans new blocks added to the cache for any transactions received by the tracked
* accounts.
*
* This function pays attention only to cached blocks with heights greater than the
* highest scanned block in `db_data`. Cached blocks with lower heights are not verified
* against previously-scanned blocks. In particular, this function **assumes** that the
* caller is handling rollbacks.
*
* For brand-new light client databases, this function starts scanning from the Sapling
* activation height. This height can be fast-forwarded to a more recent block by calling
* [`zcashlc_init_blocks_table`] before this function.
*
* Scanned blocks are required to be height-sequential. If a block is missing from the
* cache, an error will be signalled.
*/
@ -168,16 +182,19 @@ void zcashlc_string_free(char *s);
/**
* Checks that the scanned blocks in the data database, when combined with the recent
* `CompactBlock`s in the cache database, form a valid chain.
*
* This function is built on the core assumption that the information provided in the
* cache database is more likely to be accurate than the previously-scanned information.
* This follows from the design (and trust) assumption that the `lightwalletd` server
* provides accurate block information as of the time it was requested.
*
* Returns:
* - `-1` if the combined chain is valid.
* - `upper_bound` if the combined chain is invalid.
* `upper_bound` is the height of the highest invalid block (on the assumption that the
* highest block in the cache database is correct).
* `upper_bound` is the height of the highest invalid block (on the assumption that the
* highest block in the cache database is correct).
* - `0` if there was an error during validation unrelated to chain validity.
*
* This function does not mutate either of the databases.
*/
int32_t zcashlc_validate_combined_chain(const uint8_t *db_cache,