use of org.aion.precompiled.type.PrecompiledDataWord in project aion by aionnetwork.
the class BridgeStorageConnector method getBundle.
/**
* @implNote changed as part of ATB-4, see {@link #setBundle(byte[], byte[])} above for more
* information.
* @implNote note here that we return an EMPTY_WORD, this is checked in the controller layer and
* equates to a false.
* @param key bundleHash
* @return {@code EMPTY_WORD (32)} if no blockHash is found, {@code transactionHash} of the
* input transaction otherwise.
*/
public byte[] getBundle(@Nonnull final byte[] key) {
assert key.length == 32;
byte[] h = ByteUtil.chop(CapabilitiesProvider.getExternalCapabilities().blake2b(ByteUtil.merge(M_ID.BUNDLE_MAP.id, key)));
PrecompiledDataWord hWord = PrecompiledDataWord.fromBytes(h);
byte[] bundleDoubleWord = this.getDWORD(hWord);
if (bundleDoubleWord == null)
return ByteUtil.EMPTY_WORD;
// paranoid, this should typically never happen
if (bundleDoubleWord.length < 32)
bundleDoubleWord = PrecompiledUtilities.pad(bundleDoubleWord, 32);
return bundleDoubleWord;
}
use of org.aion.precompiled.type.PrecompiledDataWord in project aion by aionnetwork.
the class BridgeStorageConnector method setInitialized.
public void setInitialized(final boolean initialized) {
PrecompiledDataWord init = initialized ? PrecompiledDataWord.fromInt(1) : PrecompiledDataWord.fromInt(0);
this.setWORD(S_OFFSET.INITIALIZED.offset, init);
}
Aggregations