Skip to content

Commit a44aecc

Browse files
authored
Merge pull request #383 from hashgraph/sr/freeze
Add transaction freezing & to bytes
2 parents 2d6d05b + e960645 commit a44aecc

File tree

134 files changed

+3759
-958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+3759
-958
lines changed

sdk/c/include/hedera.h

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ typedef enum HederaError {
2525
HEDERA_ERROR_KEY_PARSE,
2626
HEDERA_ERROR_KEY_DERIVE,
2727
HEDERA_ERROR_NO_PAYER_ACCOUNT_OR_TRANSACTION_ID,
28+
HEDERA_ERROR_FREEZE_UNSET_NODE_ACCOUNT_IDS,
2829
HEDERA_ERROR_MAX_QUERY_PAYMENT_EXCEEDED,
2930
HEDERA_ERROR_NODE_ACCOUNT_UNKNOWN,
3031
HEDERA_ERROR_RESPONSE_STATUS_UNRECOGNIZED,
@@ -251,10 +252,6 @@ int32_t hedera_error_pre_check_status(void);
251252

252253
int32_t hedera_error_receipt_status_status(void);
253254

254-
size_t hedera_crypto_sha3_keccak256_digest(const uint8_t *bytes,
255-
size_t bytes_size,
256-
uint8_t **result_out);
257-
258255
/**
259256
* Parse a Hedera `AccountBalance` from the passed bytes.
260257
*/
@@ -369,11 +366,22 @@ struct HederaClient *hedera_client_for_previewnet(void);
369366
* this client.
370367
*/
371368
void hedera_client_set_operator(struct HederaClient *client,
372-
uint64_t id_shard,
373-
uint64_t id_realm,
374-
uint64_t id_num,
369+
struct HederaAccountId id,
375370
struct HederaPrivateKey *key);
376371

372+
/**
373+
* Returns `true` if there was an operator and `false` if there wasn't.
374+
*
375+
* If this method returns `false`, variables will not be modified.
376+
*/
377+
bool hedera_client_get_operator(struct HederaClient *client,
378+
struct HederaAccountId *id_out,
379+
struct HederaPrivateKey **key_out);
380+
381+
uint64_t hedera_client_get_max_transaction_fee(struct HederaClient *client);
382+
383+
size_t hedera_client_get_random_node_ids(struct HederaClient *client, struct HederaAccountId **ids);
384+
377385
/**
378386
* Get all the nodes for the `Client`
379387
*
@@ -444,6 +452,10 @@ enum HederaError hedera_contract_log_info_from_bytes(const uint8_t *bytes,
444452

445453
enum HederaError hedera_contract_log_info_to_bytes(const char *s, uint8_t **buf, size_t *buf_size);
446454

455+
size_t hedera_crypto_sha3_keccak256_digest(const uint8_t *bytes,
456+
size_t bytes_size,
457+
uint8_t **result_out);
458+
447459
/**
448460
* Parse a Hedera `FileId` from the passed bytes.
449461
*
@@ -1439,6 +1451,17 @@ enum HederaError hedera_topic_info_from_bytes(const uint8_t *bytes, size_t bytes
14391451

14401452
enum HederaError hedera_topic_info_to_bytes(const char *s, uint8_t **buf, size_t *buf_size);
14411453

1454+
/**
1455+
* Convert the provided transaction to protobuf-encoded bytes.
1456+
*
1457+
* # Safety
1458+
* - todo(sr): Missing basically everything
1459+
*/
1460+
enum HederaError hedera_transaction_to_bytes(const char *transaction,
1461+
struct HederaSigners signers,
1462+
uint8_t **buf,
1463+
size_t *buf_size);
1464+
14421465
/**
14431466
* # Safety
14441467
* - `s` must be a valid string

sdk/rust/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/rust/Cargo.toml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,7 @@ bench = false
1515
crate-type = ["lib", "staticlib"]
1616

1717
[features]
18-
ffi = [
19-
"anyhow",
20-
"cbindgen",
21-
"libc",
22-
"fraction/with-serde-support",
23-
"ed25519-dalek/serde",
24-
"hedera-proto/serde",
25-
"serde",
26-
"serde_with",
27-
"serde_json",
28-
"time/serde",
29-
"serde/derive",
30-
]
18+
ffi = ["anyhow", "cbindgen", "libc", "fraction/with-serde-support", "ed25519-dalek/serde", "hedera-proto/serde", "serde", "serde_with", "serde_json", "time/serde", "serde/derive"]
3119

3220
[dependencies]
3321
async-stream = "0.3.3"
@@ -66,6 +54,7 @@ tinystr = "0.7.0"
6654

6755
# for ed25519-dalek
6856
rand_0_7 = { version = "0.7", package = "rand" }
57+
arc-swap = "1.6.0"
6958

7059
[dependencies.serde_json]
7160
version = "1.0.79"

0 commit comments

Comments
 (0)