@@ -51,7 +51,7 @@ type SubmissionManager interface {
5151}
5252
5353type submissionManager struct {
54- consensus Backend
54+ consensus Services
5555 priceDiscovery PriceDiscovery
5656 maxFee quantity.Quantity
5757
@@ -77,7 +77,7 @@ func (m *submissionManager) EstimateGasAndSetFee(ctx context.Context, signer sig
7777 gas transaction.Gas
7878 err error
7979 )
80- gas , err = m .consensus .EstimateGas (ctx , & EstimateGasRequest {Signer : signer .Public (), Transaction : tx })
80+ gas , err = m .consensus .Core (). EstimateGas (ctx , & EstimateGasRequest {Signer : signer .Public (), Transaction : tx })
8181 if err != nil {
8282 return fmt .Errorf ("failed to estimate gas: %w" , err )
8383 }
@@ -118,14 +118,14 @@ func (m *submissionManager) getSignerNonce(ctx context.Context, signerAddr staki
118118 nonce , ok := m .nonces [signerAddr ]
119119 if ! ok {
120120 // Query latest nonce when one is not available.
121- var err error
122- nonce , err = m .consensus .GetSignerNonce (ctx , & GetSignerNonceRequest {
123- AccountAddress : signerAddr ,
124- Height : HeightLatest ,
121+ account , err := m .consensus .Staking ().Account (ctx , & staking.OwnerQuery {
122+ Height : HeightLatest ,
123+ Owner : signerAddr ,
125124 })
126125 if err != nil {
127126 return 0 , err
128127 }
128+ nonce = account .General .Nonce
129129 }
130130
131131 m .nonces [signerAddr ] = nonce + 1
@@ -171,9 +171,9 @@ func (m *submissionManager) signAndSubmitTx(ctx context.Context, signer signatur
171171
172172 var proof * transaction.Proof
173173 if withProof {
174- proof , err = m .consensus .SubmitTxWithProof (ctx , sigTx )
174+ proof , err = m .consensus .Core (). SubmitTxWithProof (ctx , sigTx )
175175 } else {
176- err = m .consensus .SubmitTx (ctx , sigTx )
176+ err = m .consensus .Core (). SubmitTx (ctx , sigTx )
177177 }
178178 if err != nil {
179179 // If the transaction check fails (which cannot be determined from
@@ -236,7 +236,7 @@ func (m *submissionManager) SignAndSubmitTxWithProof(ctx context.Context, signer
236236}
237237
238238// NewSubmissionManager creates a new transaction submission manager.
239- func NewSubmissionManager (consensus Backend , priceDiscovery PriceDiscovery , maxFee uint64 ) SubmissionManager {
239+ func NewSubmissionManager (consensus Services , priceDiscovery PriceDiscovery , maxFee uint64 ) SubmissionManager {
240240 sm := & submissionManager {
241241 consensus : consensus ,
242242 priceDiscovery : priceDiscovery ,
0 commit comments