-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renaming state trie account for verkle integration (#7907)
Signed-off-by: Karim Taam <[email protected]>
- Loading branch information
Showing
31 changed files
with
218 additions
and
157 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
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
81 changes: 81 additions & 0 deletions
81
...rc/main/java/org/hyperledger/besu/ethereum/trie/common/AbstractStateTrieAccountValue.java
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,81 @@ | ||
/* | ||
* Copyright ConsenSys AG. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.hyperledger.besu.ethereum.trie.common; | ||
|
||
import static com.google.common.base.Preconditions.checkNotNull; | ||
|
||
import org.hyperledger.besu.datatypes.AccountValue; | ||
import org.hyperledger.besu.datatypes.Hash; | ||
import org.hyperledger.besu.datatypes.Wei; | ||
import org.hyperledger.besu.ethereum.rlp.RLPOutput; | ||
|
||
/** Represents the raw values associated with an account in the world state trie. */ | ||
public abstract class AbstractStateTrieAccountValue implements AccountValue { | ||
|
||
protected final long nonce; | ||
protected final Wei balance; | ||
protected final Hash codeHash; | ||
|
||
public AbstractStateTrieAccountValue(final long nonce, final Wei balance, final Hash codeHash) { | ||
checkNotNull(balance, "balance cannot be null"); | ||
checkNotNull(codeHash, "codeHash cannot be null"); | ||
this.nonce = nonce; | ||
this.balance = balance; | ||
this.codeHash = codeHash; | ||
} | ||
|
||
/** | ||
* The account nonce, that is the number of transactions sent from that account. | ||
* | ||
* @return the account nonce. | ||
*/ | ||
@Override | ||
public long getNonce() { | ||
return nonce; | ||
} | ||
|
||
/** | ||
* The available balance of that account. | ||
* | ||
* @return the balance, in Wei, of the account. | ||
*/ | ||
@Override | ||
public Wei getBalance() { | ||
return balance; | ||
} | ||
|
||
/** | ||
* The hash of the EVM bytecode associated with this account. | ||
* | ||
* @return the hash of the account code (which may be {@link Hash#EMPTY}). | ||
*/ | ||
@Override | ||
public Hash getCodeHash() { | ||
return codeHash; | ||
} | ||
|
||
/** | ||
* The hash of the root of the storage trie associated with this account. | ||
* | ||
* @return the hash of the root node of the storage trie. | ||
*/ | ||
@Override | ||
public Hash getStorageRoot() { | ||
return Hash.EMPTY_TRIE_HASH; | ||
} | ||
|
||
@Override | ||
public abstract void writeTo(final RLPOutput out); | ||
} |
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
Oops, something went wrong.