Corrections arising from
@@ -145,8 +145,7 @@ wkWalletConnectorSignDataETH (
assert (27 == signature.sig.vrs.v || 28 == signature.sig.vrs.v); // uncompressed
// Get the Ethereum network's chainId for EIP-155 encoding.
- WKWalletManagerETH managerETH = wkWalletManagerCoerceETH (walletConnector->manager);
- BREthereumChainId chainId = ethNetworkGetChainId(managerETH->network);
+ BREthereumChainId chainId = ethNetworkGetChainId(wkWalletManagerGetNetworkAsETH(walletConnector->manager));
// Update the signature `V` field with the EIP-155 encoding as per https://eips.ethereum.org/EIPS/eip-155
// "the v of the signature MUST be set to {0,1} + CHAIN_ID * 2 + 35 where {0,1} is the parity of y"
@@ -193,8 +192,7 @@ wkWalletConnectorRecoverKeyETH (
BREthereumSignatureVRS vrs = walletConnectVrsSignatureFromRsv(*((BREthereumSignatureRSV*)signature));
// Get the Ethereum network's chainId for EIP-155 decoding.
- WKWalletManagerETH managerETH = wkWalletManagerCoerceETH (walletConnector->manager);
- BREthereumChainId ourChainId = ethNetworkGetChainId(managerETH->network);
+ BREthereumChainId ourChainId = ethNetworkGetChainId(wkWalletManagerGetNetworkAsETH(walletConnector->manager));
// Flag to indicate if the chainId in `signature` matches ours.
bool validChainId = true;
@@ -369,8 +367,8 @@ wkWalletConnectorCreateTransactionFromArgumentsETH (
}
// Set the source address 'from', and 'nonce' based on the current account
+ BREthereumNetwork ethNetwork = wkWalletManagerGetNetworkAsETH(walletConnector->manager);
WKWalletManagerETH managerETH = wkWalletManagerCoerceETH (walletConnector->manager);
- BREthereumNetwork ethNetwork = managerETH->network;
BREthereumAccount ethAccount = managerETH->account;
BREthereumAddress sourceAddress = ethAccountGetPrimaryAddress (ethAccount);
@@ -404,8 +402,7 @@ wkWalletConnectorCreateTransactionFromSerializationETH (
WKBoolean *isSigned,
WKWalletConnectorStatus *status) {
- WKWalletManagerETH managerETH = wkWalletManagerCoerceETH (walletConnector->manager);
- BREthereumNetwork ethNetwork = managerETH->network;
+ BREthereumNetwork ethNetwork = wkWalletManagerGetNetworkAsETH(walletConnector->manager);
// No result, no error
*serializationLength = 0;
@@ -456,7 +453,7 @@ wkWalletConnectorSignTransactionDataETH (
WKWalletConnectorStatus *status ) {
WKWalletManagerETH managerETH = wkWalletManagerCoerceETH (walletConnector->manager);
- BREthereumNetwork ethNetwork = managerETH->network;
+ BREthereumNetwork ethNetwork = wkWalletManagerGetNetworkAsETH(walletConnector->manager);
BRKey brKey = *wkKeyGetCore (key);
BREthereumAccount ethAccount = managerETH->account;
BREthereumAddress ethAddress = ethAccountGetPrimaryAddress (ethAccount);
@@ -541,8 +538,7 @@ wkWalletConnectorSignTypedDataETH (
28 == signResult.signature.sig.vrs.v); // uncompressed
// Get the Ethereum network's chainId for EIP-155 encoding.
- WKWalletManagerETH managerETH = wkWalletManagerCoerceETH (walletConnector->manager);
- BREthereumChainId chainId = ethNetworkGetChainId(managerETH->network);
+ BREthereumChainId chainId = ethNetworkGetChainId(wkWalletManagerGetNetworkAsETH(walletConnector->manager));
// Update the signature `V` field with the EIP-155 encoding as per https://eips.ethereum.org/EIPS/eip-155
// "the v of the signature MUST be set to {0,1} + CHAIN_ID * 2 + 35 where {0,1} is the parity of y"
