1717use std:: cell:: RefMut ;
1818
1919use ckey:: Address ;
20- use cmerkle:: { Result as TrieResult , TrieDB , TrieMut } ;
20+ use cmerkle:: { Result as TrieResult , Trie , TrieMut } ;
2121use primitives:: H256 ;
2222
2323use super :: WriteBack ;
@@ -90,43 +90,43 @@ impl TopCache {
9090 Ok ( ( ) )
9191 }
9292
93- pub fn account ( & self , a : & Address , db : & TrieDB ) -> TrieResult < Option < Account > > {
93+ pub fn account ( & self , a : & Address , db : & dyn Trie ) -> TrieResult < Option < Account > > {
9494 self . account . get ( a, db)
9595 }
9696
97- pub fn account_mut ( & self , a : & Address , db : & TrieDB ) -> TrieResult < RefMut < Account > > {
97+ pub fn account_mut ( & self , a : & Address , db : & dyn Trie ) -> TrieResult < RefMut < Account > > {
9898 self . account . get_mut ( a, db)
9999 }
100100
101101 pub fn remove_account ( & self , address : & Address ) {
102102 self . account . remove ( address)
103103 }
104104
105- pub fn regular_account ( & self , a : & RegularAccountAddress , db : & TrieDB ) -> TrieResult < Option < RegularAccount > > {
105+ pub fn regular_account ( & self , a : & RegularAccountAddress , db : & dyn Trie ) -> TrieResult < Option < RegularAccount > > {
106106 self . regular_account . get ( a, db)
107107 }
108108
109- pub fn regular_account_mut ( & self , a : & RegularAccountAddress , db : & TrieDB ) -> TrieResult < RefMut < RegularAccount > > {
109+ pub fn regular_account_mut ( & self , a : & RegularAccountAddress , db : & dyn Trie ) -> TrieResult < RefMut < RegularAccount > > {
110110 self . regular_account . get_mut ( a, db)
111111 }
112112
113113 pub fn remove_regular_account ( & self , address : & RegularAccountAddress ) {
114114 self . regular_account . remove ( address)
115115 }
116116
117- pub fn metadata ( & self , a : & MetadataAddress , db : & TrieDB ) -> TrieResult < Option < Metadata > > {
117+ pub fn metadata ( & self , a : & MetadataAddress , db : & dyn Trie ) -> TrieResult < Option < Metadata > > {
118118 self . metadata . get ( a, db)
119119 }
120120
121- pub fn metadata_mut ( & self , a : & MetadataAddress , db : & TrieDB ) -> TrieResult < RefMut < Metadata > > {
121+ pub fn metadata_mut ( & self , a : & MetadataAddress , db : & dyn Trie ) -> TrieResult < RefMut < Metadata > > {
122122 self . metadata . get_mut ( a, db)
123123 }
124124
125- pub fn shard ( & self , a : & ShardAddress , db : & TrieDB ) -> TrieResult < Option < Shard > > {
125+ pub fn shard ( & self , a : & ShardAddress , db : & dyn Trie ) -> TrieResult < Option < Shard > > {
126126 self . shard . get ( a, db)
127127 }
128128
129- pub fn shard_mut ( & self , a : & ShardAddress , db : & TrieDB ) -> TrieResult < RefMut < Shard > > {
129+ pub fn shard_mut ( & self , a : & ShardAddress , db : & dyn Trie ) -> TrieResult < RefMut < Shard > > {
130130 self . shard . get_mut ( a, db)
131131 }
132132
@@ -135,23 +135,23 @@ impl TopCache {
135135 self . shard . remove ( address)
136136 }
137137
138- pub fn text ( & self , a : & H256 , db : & TrieDB ) -> TrieResult < Option < Text > > {
138+ pub fn text ( & self , a : & H256 , db : & dyn Trie ) -> TrieResult < Option < Text > > {
139139 self . text . get ( a, db)
140140 }
141141
142- pub fn text_mut ( & self , a : & H256 , db : & TrieDB ) -> TrieResult < RefMut < Text > > {
142+ pub fn text_mut ( & self , a : & H256 , db : & dyn Trie ) -> TrieResult < RefMut < Text > > {
143143 self . text . get_mut ( a, db)
144144 }
145145
146146 pub fn remove_text ( & self , address : & H256 ) {
147147 self . text . remove ( address) ;
148148 }
149149
150- pub fn action_data ( & self , a : & H256 , db : & TrieDB ) -> TrieResult < Option < ActionData > > {
150+ pub fn action_data ( & self , a : & H256 , db : & dyn Trie ) -> TrieResult < Option < ActionData > > {
151151 self . action_data . get ( a, db)
152152 }
153153
154- pub fn action_data_mut ( & self , a : & H256 , db : & TrieDB ) -> TrieResult < RefMut < ActionData > > {
154+ pub fn action_data_mut ( & self , a : & H256 , db : & dyn Trie ) -> TrieResult < RefMut < ActionData > > {
155155 self . action_data . get_mut ( a, db)
156156 }
157157
0 commit comments