-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: returning non-success response code instead of reverting when su…
…pplykey is missing (#167) (#223) Signed-off-by: Mariusz Jasuwienas <[email protected]>
- Loading branch information
1 parent
0fe9477
commit b737b00
Showing
5 changed files
with
99 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import {IHederaTokenService} from "./IHederaTokenService.sol"; | ||
|
||
library KeyLib { | ||
function keyExists(uint keyType, IHederaTokenService.TokenInfo memory tokenInfo) internal pure returns (bool) { | ||
for (uint256 i = 0; i < tokenInfo.token.tokenKeys.length; i++) { | ||
if (tokenInfo.token.tokenKeys[i].keyType == keyType) { | ||
IHederaTokenService.KeyValue memory key = tokenInfo.token.tokenKeys[i].key; | ||
return key.contractId != address(0) || (key.ECDSA_secp256k1.length + key.ed25519.length) > 0; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters