MCPcopy Create free account
hub / github.com/LFDT-web3j/web3j / encodeBool

Method encodeBool

abi/src/main/java/org/web3j/abi/TypeEncoder.java:231–237  ·  view source on GitHub ↗
(Bool value)

Source from the content-addressed store, hash-verified

229 }
230
231 static String encodeBool(Bool value) {
232 byte[] rawValue = new byte[MAX_BYTE_LENGTH];
233 if (value.getValue()) {
234 rawValue[rawValue.length - 1] = 1;
235 }
236 return Numeric.toHexStringNoPrefix(rawValue);
237 }
238
239 static String encodeBytes(BytesType bytesType) {
240 byte[] value = bytesType.getValue();

Callers 2

testBoolEncodeMethod · 0.95
encodeMethod · 0.95

Calls 2

toHexStringNoPrefixMethod · 0.95
getValueMethod · 0.65

Tested by 1

testBoolEncodeMethod · 0.76