Skip to content

Commit

Permalink
Merge pull request #851 from aionnetwork/rm-avm-prefix
Browse files Browse the repository at this point in the history
Removing the AVM prefix
  • Loading branch information
AionJayT authored Mar 19, 2019
2 parents bdf2cad + 7c4d198 commit 4ef59ef
Show file tree
Hide file tree
Showing 35 changed files with 426 additions and 440 deletions.
2 changes: 1 addition & 1 deletion aion_fastvm
2 changes: 1 addition & 1 deletion modAion/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext.moduleName = 'aion.zero'
test.dependsOn copyNativeLibsForModuleTests

dependencies {
compile 'network.aion:vm-api4j:0.4.0'
compile project(':aion_vm_api')
compile 'network.aion:util4j:0.4.0'
compile 'network.aion:rlp4j:0.4.0'
compile 'network.aion:crypto4j:0.4.0'
Expand Down
6 changes: 5 additions & 1 deletion modAion/src/org/aion/zero/db/AionRepositoryCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import org.aion.interfaces.db.ContractDetails;
import org.aion.interfaces.db.Repository;
import org.aion.interfaces.db.RepositoryCache;
import org.aion.types.Address;
import org.aion.mcf.core.AccountState;
import org.aion.mcf.db.AbstractRepositoryCache;
import org.aion.mcf.db.ContractDetailsCacheImpl;
import org.aion.mcf.db.IBlockStoreBase;
import org.aion.types.Address;

public class AionRepositoryCache extends AbstractRepositoryCache<IBlockStoreBase<?, ?>> {

Expand Down Expand Up @@ -251,4 +251,8 @@ public List<byte[]> getCacheTx() {
throw new UnsupportedOperationException(
"getCachelTx should be called on the tracked repository.");
}

public byte getVMUsed(Address contract) {
return repository.getVMUsed(contract);
}
}
2 changes: 1 addition & 1 deletion modAionImpl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sourceSets {
}

dependencies {
compile 'network.aion:vm-api4j:0.4.0'
compile project(':aion_vm_api')
compile 'network.aion:util4j:0.4.0'
compile 'network.aion:log4j:0.4.0'
compile 'network.aion:rlp4j:0.4.0'
Expand Down
20 changes: 18 additions & 2 deletions modAionImpl/src/org/aion/zero/impl/AionBlockchainImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import java.util.Stack;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import org.aion.interfaces.db.Repository;
import org.aion.interfaces.db.RepositoryCache;
import org.aion.crypto.HashUtil;
import org.aion.equihash.EquihashMiner;
import org.aion.evtmgr.IEvent;
import org.aion.evtmgr.IEventMgr;
import org.aion.evtmgr.impl.evt.EventBlock;
import org.aion.interfaces.db.Repository;
import org.aion.interfaces.db.RepositoryCache;
import org.aion.log.AionLoggerFactory;
import org.aion.log.LogEnum;
import org.aion.mcf.core.ImportResult;
Expand Down Expand Up @@ -73,7 +73,9 @@
import org.aion.zero.impl.types.AionTxInfo;
import org.aion.zero.impl.types.RetValidPreBlock;
import org.aion.zero.impl.valid.TXValidator;
import org.aion.mcf.valid.TransactionTypeRule;
import org.aion.zero.impl.valid.TransactionTypeValidator;
import org.aion.mcf.tx.TransactionTypes;
import org.aion.zero.types.A0BlockHeader;
import org.aion.zero.types.AionTransaction;
import org.aion.zero.types.AionTxExecSummary;
Expand Down Expand Up @@ -910,6 +912,20 @@ public AionBlockSummary add(AionBlock block, boolean rebuild) {
// update corresponding account with the new balance
track.flush();

// save contract creation data
for (AionTxReceipt receipt : receipts) {
AionTransaction tx = receipt.getTransaction();
if (tx.isContractCreationTransaction()) {
repository.saveIndexedContractInformation(
tx.getContractAddress(),
block.getNumber(),
TransactionTypeRule.isValidAVMContractDeployment(tx.getTargetVM())
? TransactionTypes.AVM_CREATE_CODE
: TransactionTypes.FVM_CREATE_CODE,
true);
}
}

if (rebuild) {
for (int i = 0; i < receipts.size(); i++) {
transactionStore.putToBatch(new AionTxInfo(receipts.get(i), block.getHash(), i));
Expand Down
282 changes: 0 additions & 282 deletions modAionImpl/src/org/aion/zero/impl/db/AionRepositoryDummy.java

This file was deleted.

Loading

0 comments on commit 4ef59ef

Please sign in to comment.