use of org.ethereum.vm.DataWord in project rskj by rsksmart.
the class BridgeEventLoggerImpl method logAddSignature.
public void logAddSignature(BtcECKey federatorPublicKey, BtcTransaction btcTx, byte[] rskTxHash) {
List<DataWord> topics = Collections.singletonList(Bridge.ADD_SIGNATURE_TOPIC);
byte[] data = RLP.encodeList(RLP.encodeString(btcTx.getHashAsString()), RLP.encodeElement(federatorPublicKey.getPubKeyHash()), RLP.encodeElement(rskTxHash));
this.logs.add(new LogInfo(BRIDGE_CONTRACT_ADDRESS, topics, data));
}
use of org.ethereum.vm.DataWord in project rskj by rsksmart.
the class RemascStorageProvider method getSiblings.
public SortedMap<Long, List<Sibling>> getSiblings() {
if (siblings != null) {
return siblings;
}
DataWord address = new DataWord(SIBLINGS_KEY.getBytes(StandardCharsets.UTF_8));
byte[] bytes = this.repository.getStorageBytes(this.contractAddress, address);
siblings = getSiblingsFromBytes(bytes);
return siblings;
}
use of org.ethereum.vm.DataWord in project rskj by rsksmart.
the class RemascStorageProvider method saveSiblings.
private void saveSiblings() {
if (this.siblings == null) {
return;
}
byte[] bytes = getSiblingsBytes(this.siblings);
DataWord address = new DataWord(SIBLINGS_KEY.getBytes(StandardCharsets.UTF_8));
this.repository.addStorageBytes(this.contractAddress, address, bytes);
}
use of org.ethereum.vm.DataWord in project rskj by rsksmart.
the class RemascStorageProvider method getBurnedBalance.
public Coin getBurnedBalance() {
if (burnedBalance != null) {
return burnedBalance;
}
DataWord address = new DataWord(BURNED_BALANCE_KEY.getBytes(StandardCharsets.UTF_8));
DataWord value = this.repository.getStorageValue(this.contractAddress, address);
if (value == null) {
return Coin.ZERO;
}
return new Coin(value.getData());
}
use of org.ethereum.vm.DataWord in project rskj by rsksmart.
the class RemascStorageProvider method saveBurnedBalance.
private void saveBurnedBalance() {
if (burnedBalance == null) {
return;
}
DataWord address = new DataWord(BURNED_BALANCE_KEY.getBytes(StandardCharsets.UTF_8));
this.repository.addStorageRow(this.contractAddress, address, new DataWord(this.burnedBalance.getBytes()));
}
Aggregations