Removed the helper getNftContractAddress helper function and some NULL checks

Useless since we don't allow NFT signing without the NFT metadata anymore
This commit is contained in:
Alexandre Paillier
2022-03-09 15:36:03 +01:00
parent a26da165df
commit fb28efc012
4 changed files with 12 additions and 45 deletions

View File

@@ -22,15 +22,11 @@ static void set_approval_for_all_ui(ethQueryContractUI_t *msg, erc1155_context_t
break;
case 1:
strlcpy(msg->title, "To Manage ALL", msg->titleLength);
if (msg->item1) {
strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
} else {
strlcpy(msg->msg, "Not found", msg->msgLength);
}
strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
getEthDisplayableAddress(getNftContractAddress(msg),
getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -55,15 +51,11 @@ static void set_transfer_ui(ethQueryContractUI_t *msg, erc1155_context_t *contex
break;
case 1:
strlcpy(msg->title, "Collection Name", msg->titleLength);
if (msg->item1) {
strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
} else {
strlcpy(msg->msg, "Not Found", msg->msgLength);
}
strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
getEthDisplayableAddress(getNftContractAddress(msg),
getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -101,15 +93,11 @@ static void set_batch_transfer_ui(ethQueryContractUI_t *msg, erc1155_context_t *
break;
case 1:
strlcpy(msg->title, "Collection Name", msg->titleLength);
if (msg->item1) {
strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
} else {
strlcpy(msg->msg, "Not Found", msg->msgLength);
}
strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
getEthDisplayableAddress(getNftContractAddress(msg),
getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,

View File

@@ -18,15 +18,11 @@ static void set_approval_ui(ethQueryContractUI_t *msg, erc721_context_t *context
break;
case 1:
strlcpy(msg->title, "To Manage Your", msg->titleLength);
if (msg->item1) {
strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
} else {
strlcpy(msg->msg, "Not Found", msg->msgLength);
}
strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
getEthDisplayableAddress(getNftContractAddress(msg),
getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -62,15 +58,11 @@ static void set_approval_for_all_ui(ethQueryContractUI_t *msg, erc721_context_t
break;
case 1:
strlcpy(msg->title, "To Manage ALL", msg->titleLength);
if (msg->item1) {
strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
} else {
strlcpy(msg->msg, "Not found", msg->msgLength);
}
strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
getEthDisplayableAddress(getNftContractAddress(msg),
getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -95,15 +87,11 @@ static void set_transfer_ui(ethQueryContractUI_t *msg, erc721_context_t *context
break;
case 1:
strlcpy(msg->title, "Collection Name", msg->titleLength);
if (msg->item1) {
strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
} else {
strlcpy(msg->msg, "Not Found", msg->msgLength);
}
strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
getEthDisplayableAddress(getNftContractAddress(msg),
getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,