Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkv-vcm committed Sep 16, 2021
1 parent 0fb5436 commit bf489f7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/addressUtilsShelley.c
Expand Up @@ -76,7 +76,7 @@ uint8_t getNetworkId(uint8_t addressHeader)

bool isValidNetworkId(uint8_t networkId)
{
return networkId <= 0b1111;
return networkId <= MAXIMUM_NETWORK_ID;
}

bool isValidStakingChoice(staking_data_source_t stakingDataSource)
Expand Down
2 changes: 1 addition & 1 deletion src/cardano.h
Expand Up @@ -48,7 +48,7 @@ STATIC_ASSERT(LOVELACE_MAX_SUPPLY < LOVELACE_INVALID, "bad LOVELACE_INVALID");

#define TESTNET_NETWORK_ID 0

#define MAXIMUM_NETWORK_ID 15
#define MAXIMUM_NETWORK_ID 0b1111


typedef enum {
Expand Down
2 changes: 1 addition & 1 deletion src/securityPolicy.c
Expand Up @@ -276,7 +276,7 @@ security_policy_t policyForSignTxInit(
ASSERT(false);
}

DENY_IF(networkId > MAXIMUM_NETWORK_ID);
DENY_IF(!isValidNetworkId(networkId));

WARN_IF(!is_tx_network_verifiable(numOutputs, numWithdrawals, txSigningMode));

Expand Down
2 changes: 1 addition & 1 deletion src/txHashBuilder.c
Expand Up @@ -1189,7 +1189,7 @@ void txHashBuilder_addNetworkId(tx_hash_builder_t* builder, uint8_t networkId)

txHashBuilder_assertCanLeaveMint(builder);

// add fee item into the main tx body map
// add network id item into the main tx body map
BUILDER_APPEND_CBOR(CBOR_TYPE_UNSIGNED, TX_BODY_KEY_NETWORK_ID);
BUILDER_APPEND_CBOR(CBOR_TYPE_UNSIGNED, networkId);

Expand Down
2 changes: 1 addition & 1 deletion src/txHashBuilder.h
Expand Up @@ -15,7 +15,7 @@ enum {
TX_BODY_KEY_AUX_DATA = 7,
TX_BODY_KEY_VALIDITY_INTERVAL_START = 8,
TX_BODY_KEY_MINT = 9,
TX_BODY_KEY_NETWORK_ID = 15,
TX_BODY_KEY_NETWORK_ID = 15,
};

/* The state machine of the tx hash builder is driven by user calls.
Expand Down

0 comments on commit bf489f7

Please sign in to comment.