@@ -5,9 +5,10 @@ use crate::authority::SuiDataStore;
5
5
use serde:: { Deserialize , Serialize } ;
6
6
use std:: collections:: HashSet ;
7
7
use std:: fmt:: Debug ;
8
+ use sui_types:: base_types:: ObjectRef ;
8
9
use sui_types:: messages:: TransactionKind ;
9
10
use sui_types:: {
10
- base_types:: { ObjectID , SequenceNumber , SuiAddress } ,
11
+ base_types:: { SequenceNumber , SuiAddress } ,
11
12
error:: { SuiError , SuiResult } ,
12
13
fp_ensure,
13
14
gas:: { self , SuiGasStatus } ,
28
29
{
29
30
let mut gas_status = check_gas (
30
31
store,
31
- transaction. gas_payment_object_ref ( ) . 0 ,
32
+ transaction. gas_payment_object_ref ( ) ,
32
33
transaction. signed_data . data . gas_budget ,
33
34
transaction. signed_data . data . gas_price ,
34
35
& transaction. signed_data . data . kind ,
90
91
#[ instrument( level = "trace" , skip_all) ]
91
92
async fn check_gas < S > (
92
93
store : & SuiDataStore < S > ,
93
- gas_payment_id : ObjectID ,
94
+ gas_payment : & ObjectRef ,
94
95
gas_budget : u64 ,
95
96
computation_gas_price : u64 ,
96
97
tx_kind : & TransactionKind ,
@@ -101,9 +102,11 @@ where
101
102
if tx_kind. is_system_tx ( ) {
102
103
Ok ( SuiGasStatus :: new_unmetered ( ) )
103
104
} else {
104
- let gas_object = store. get_object ( & gas_payment_id) ?;
105
- let gas_object = gas_object. ok_or ( SuiError :: ObjectNotFound {
106
- object_id : gas_payment_id,
105
+ let gas_object = store. get_object_by_key ( & gas_payment. 0 , gas_payment. 1 ) ?;
106
+ let gas_object = gas_object. ok_or ( SuiError :: ObjectErrors {
107
+ errors : vec ! [ SuiError :: ObjectNotFound {
108
+ object_id: gas_payment. 0 ,
109
+ } ] ,
107
110
} ) ?;
108
111
109
112
//TODO: cache this storage_gas_price in memory
0 commit comments