@@ -14,7 +14,7 @@ use near_primitives::receipt::Receipt;
14
14
use near_primitives:: sharding:: {
15
15
ChunkHash , ChunkHashHeight , ReceiptProof , ShardChunk , ShardChunkHeader , ShardProof ,
16
16
} ;
17
- use near_primitives:: transaction:: { ExecutionOutcome , ExecutionStatus } ;
17
+ use near_primitives:: transaction:: ExecutionOutcome ;
18
18
use near_primitives:: types:: { AccountId , Balance , BlockIndex , ChunkExtra , Gas , ShardId } ;
19
19
use near_store:: { Store , COL_STATE_HEADERS } ;
20
20
@@ -27,10 +27,6 @@ use crate::types::{
27
27
ReceiptProofResponse , ReceiptResponse , RootProof , RuntimeAdapter , ShardStateSyncResponseHeader ,
28
28
ShardStateSyncResponsePart , StateHeaderKey , Tip , ValidatorSignatureVerificationResult ,
29
29
} ;
30
- use near_primitives:: views:: {
31
- ExecutionOutcomeView , ExecutionOutcomeWithIdView , ExecutionStatusView ,
32
- FinalExecutionOutcomeView , FinalExecutionStatus ,
33
- } ;
34
30
35
31
/// Maximum number of orphans chain can store.
36
32
pub const MAX_ORPHAN_SIZE : usize = 1024 ;
@@ -1312,72 +1308,6 @@ impl Chain {
1312
1308
1313
1309
Ok ( ( ) )
1314
1310
}
1315
-
1316
- pub fn get_transaction_execution_result (
1317
- & mut self ,
1318
- hash : & CryptoHash ,
1319
- ) -> Result < ExecutionOutcomeView , String > {
1320
- match self . get_transaction_result ( hash) {
1321
- Ok ( result) => Ok ( result. clone ( ) . into ( ) ) ,
1322
- Err ( err) => match err. kind ( ) {
1323
- ErrorKind :: DBNotFoundErr ( _) => {
1324
- Ok ( ExecutionOutcome { status : ExecutionStatus :: Unknown , ..Default :: default ( ) }
1325
- . into ( ) )
1326
- }
1327
- _ => Err ( err. to_string ( ) ) ,
1328
- } ,
1329
- }
1330
- }
1331
-
1332
- fn get_recursive_transaction_results (
1333
- & mut self ,
1334
- hash : & CryptoHash ,
1335
- ) -> Result < Vec < ExecutionOutcomeWithIdView > , String > {
1336
- let outcome = self . get_transaction_execution_result ( hash) ?;
1337
- let receipt_ids = outcome. receipt_ids . clone ( ) ;
1338
- let mut transactions = vec ! [ ExecutionOutcomeWithIdView { id: ( * hash) . into( ) , outcome } ] ;
1339
- for hash in & receipt_ids {
1340
- transactions
1341
- . extend ( self . get_recursive_transaction_results ( & hash. clone ( ) . into ( ) ) ?. into_iter ( ) ) ;
1342
- }
1343
- Ok ( transactions)
1344
- }
1345
-
1346
- pub fn get_final_transaction_result (
1347
- & mut self ,
1348
- hash : & CryptoHash ,
1349
- ) -> Result < FinalExecutionOutcomeView , String > {
1350
- let mut outcomes = self . get_recursive_transaction_results ( hash) ?;
1351
- let mut looking_for_id = ( * hash) . into ( ) ;
1352
- let num_outcomes = outcomes. len ( ) ;
1353
- let status = outcomes
1354
- . iter ( )
1355
- . find_map ( |outcome_with_id| {
1356
- if outcome_with_id. id == looking_for_id {
1357
- match & outcome_with_id. outcome . status {
1358
- ExecutionStatusView :: Unknown if num_outcomes == 1 => {
1359
- Some ( FinalExecutionStatus :: NotStarted )
1360
- }
1361
- ExecutionStatusView :: Unknown => Some ( FinalExecutionStatus :: Started ) ,
1362
- ExecutionStatusView :: Failure ( e) => {
1363
- Some ( FinalExecutionStatus :: Failure ( e. clone ( ) ) )
1364
- }
1365
- ExecutionStatusView :: SuccessValue ( v) => {
1366
- Some ( FinalExecutionStatus :: SuccessValue ( v. clone ( ) ) )
1367
- }
1368
- ExecutionStatusView :: SuccessReceiptId ( id) => {
1369
- looking_for_id = id. clone ( ) ;
1370
- None
1371
- }
1372
- }
1373
- } else {
1374
- None
1375
- }
1376
- } )
1377
- . expect ( "results should resolve to a final outcome" ) ;
1378
- let receipts = outcomes. split_off ( 1 ) ;
1379
- Ok ( FinalExecutionOutcomeView { status, transaction : outcomes. pop ( ) . unwrap ( ) , receipts } )
1380
- }
1381
1311
}
1382
1312
1383
1313
/// Various chain getters.
@@ -1507,7 +1437,7 @@ impl Chain {
1507
1437
1508
1438
/// Returns underlying RuntimeAdapter.
1509
1439
#[ inline]
1510
- pub fn runtime_adapter ( & self ) -> Arc < dyn RuntimeAdapter > {
1440
+ pub fn runtime_adapter ( & self ) -> Arc < RuntimeAdapter > {
1511
1441
self . runtime_adapter . clone ( )
1512
1442
}
1513
1443
@@ -2035,10 +1965,6 @@ impl<'a> ChainUpdate<'a> {
2035
1965
return Err ( ErrorKind :: InvalidEpochHash . into ( ) ) ;
2036
1966
}
2037
1967
2038
- if header. inner . chunk_mask . len ( ) as u64 != self . runtime_adapter . num_shards ( ) {
2039
- return Err ( ErrorKind :: InvalidChunkMask . into ( ) ) ;
2040
- }
2041
-
2042
1968
// Prevent time warp attacks and some timestamp manipulations by forcing strict
2043
1969
// time progression.
2044
1970
if header. inner . timestamp <= prev_header. inner . timestamp {
0 commit comments