@@ -57,7 +57,7 @@ func (a *GasAPI) GasEstimateFeeCap(
57
57
maxqueueblks int64 ,
58
58
tsk types.TipSetKey ,
59
59
) (types.BigInt , error ) {
60
- return gasutils .GasEstimateFeeCap (a .Chain , msg , maxqueueblks )
60
+ return gasutils .GasEstimateFeeCap (ctx , a .Chain , msg , maxqueueblks , tsk )
61
61
}
62
62
63
63
func (m * GasModule ) GasEstimateFeeCap (
@@ -66,27 +66,27 @@ func (m *GasModule) GasEstimateFeeCap(
66
66
maxqueueblks int64 ,
67
67
tsk types.TipSetKey ,
68
68
) (types.BigInt , error ) {
69
- return gasutils .GasEstimateFeeCap (m .Chain , msg , maxqueueblks )
69
+ return gasutils .GasEstimateFeeCap (ctx , m .Chain , msg , maxqueueblks , tsk )
70
70
}
71
71
72
72
func (a * GasAPI ) GasEstimateGasPremium (
73
73
ctx context.Context ,
74
74
nblocksincl uint64 ,
75
75
sender address.Address ,
76
76
gaslimit int64 ,
77
- _ types.TipSetKey ,
77
+ tsk types.TipSetKey ,
78
78
) (types.BigInt , error ) {
79
- return gasutils .GasEstimateGasPremium (ctx , a .Chain , a .PriceCache , nblocksincl )
79
+ return gasutils .GasEstimateGasPremium (ctx , a .Chain , a .PriceCache , nblocksincl , tsk )
80
80
}
81
81
82
82
func (m * GasModule ) GasEstimateGasPremium (
83
83
ctx context.Context ,
84
84
nblocksincl uint64 ,
85
85
sender address.Address ,
86
86
gaslimit int64 ,
87
- _ types.TipSetKey ,
87
+ tsk types.TipSetKey ,
88
88
) (types.BigInt , error ) {
89
- return gasutils .GasEstimateGasPremium (ctx , m .Chain , m .PriceCache , nblocksincl )
89
+ return gasutils .GasEstimateGasPremium (ctx , m .Chain , m .PriceCache , nblocksincl , tsk )
90
90
}
91
91
92
92
func (a * GasAPI ) GasEstimateGasLimit (ctx context.Context , msgIn * types.Message , tsk types.TipSetKey ) (int64 , error ) {
@@ -105,9 +105,9 @@ func (m *GasModule) GasEstimateGasLimit(ctx context.Context, msgIn *types.Messag
105
105
return gasutils .GasEstimateGasLimit (ctx , m .Chain , m .Stmgr , m .Mpool , msgIn , ts )
106
106
}
107
107
108
- func (m * GasModule ) GasEstimateMessageGas (ctx context.Context , msg * types.Message , spec * api.MessageSendSpec , _ types.TipSetKey ) (* types.Message , error ) {
108
+ func (m * GasModule ) GasEstimateMessageGas (ctx context.Context , msg * types.Message , spec * api.MessageSendSpec , ts types.TipSetKey ) (* types.Message , error ) {
109
109
if msg .GasLimit == 0 {
110
- gasLimit , err := m .GasEstimateGasLimit (ctx , msg , types . EmptyTSK )
110
+ gasLimit , err := m .GasEstimateGasLimit (ctx , msg , ts )
111
111
if err != nil {
112
112
return nil , err
113
113
}
@@ -120,15 +120,15 @@ func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Messag
120
120
}
121
121
122
122
if msg .GasPremium == types .EmptyInt || types .BigCmp (msg .GasPremium , types .NewInt (0 )) == 0 {
123
- gasPremium , err := m .GasEstimateGasPremium (ctx , 10 , msg .From , msg .GasLimit , types . EmptyTSK )
123
+ gasPremium , err := m .GasEstimateGasPremium (ctx , 10 , msg .From , msg .GasLimit , ts )
124
124
if err != nil {
125
125
return nil , xerrors .Errorf ("estimating gas price: %w" , err )
126
126
}
127
127
msg .GasPremium = gasPremium
128
128
}
129
129
130
130
if msg .GasFeeCap == types .EmptyInt || types .BigCmp (msg .GasFeeCap , types .NewInt (0 )) == 0 {
131
- feeCap , err := m .GasEstimateFeeCap (ctx , msg , 20 , types . EmptyTSK )
131
+ feeCap , err := m .GasEstimateFeeCap (ctx , msg , 20 , ts )
132
132
if err != nil {
133
133
return nil , xerrors .Errorf ("estimating fee cap: %w" , err )
134
134
}
0 commit comments