(value: unknown)
| 80 | } |
| 81 | |
| 82 | function castString32(value: unknown) { |
| 83 | assertValueIsNotArrayOrObject(value); |
| 84 | |
| 85 | const strValue = String(value); |
| 86 | // We can't encode strings longer than 31 characters to bytes32. Ethers needs to keep room for null termination |
| 87 | return ethers.utils.formatBytes32String(strValue.length > 31 ? strValue.substring(0, 31) : strValue); |
| 88 | } |
| 89 | |
| 90 | function createTimestamp() { |
| 91 | return new BigNumber(Math.floor(Date.now() / 1000)).toString(); |
no test coverage detected