Skip to content

Commit 8001d99

Browse files
committed
fix bug
1 parent aeaaac7 commit 8001d99

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

wisdom-core/src/main/java/org/wisdom/db/AccountStateTrie.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.util.Map;
2020
import java.util.Optional;
21+
import java.util.Set;
2122
import java.util.concurrent.atomic.AtomicInteger;
2223

2324
@Component
@@ -56,7 +57,27 @@ public AccountStateTrie(
5657
@Qualifier("storageTrie") Trie<byte[], byte[]> storageTrie,
5758
EconomicModel economicModel
5859
) throws Exception {
59-
super(AccountState.class, accountStateUpdater.getGenesisStates(), genesis, factory, true, false);
60+
super(AccountState.class, accountStateUpdater.getGenesisStates(), genesis, factory, true, false, new AbstractStateUpdater<AccountState>() {
61+
@Override
62+
public Map<byte[], AccountState> getGenesisStates() {
63+
throw new UnsupportedOperationException();
64+
}
65+
66+
@Override
67+
public Set<byte[]> getRelatedKeys(Transaction transaction, Map<byte[], AccountState> store) {
68+
throw new UnsupportedOperationException();
69+
}
70+
71+
@Override
72+
public AccountState createEmpty(byte[] id) {
73+
return new AccountState(id);
74+
}
75+
76+
@Override
77+
public AccountState update(Map<byte[], AccountState> beforeUpdate, byte[] id, AccountState state, TransactionInfo info) {
78+
throw new UnsupportedOperationException();
79+
}
80+
});
6081
this.bc = bc;
6182
this.accountStateUpdater = accountStateUpdater;
6283
this.accountStateUpdater.setWisdomBlockChain(bc);

wisdom-core/src/main/java/org/wisdom/db/StateTrieAdapter.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ public Optional<byte[]> getRootHashByBlockHash(byte[] blockHash) {
4545
return rootStore.get(blockHash);
4646
}
4747

48-
public StateTrieAdapter(
49-
Class<T> clazz, Map<byte[], T> genesisState,
50-
Block genesis, DatabaseStoreFactory factory,
51-
boolean logDeletes, boolean reset
52-
) {
53-
this(clazz, genesisState, genesis, factory, logDeletes, reset, null);
54-
}
5548

5649
public StateTrieAdapter(
5750
Class<T> clazz,

0 commit comments

Comments
 (0)