@@ -2,19 +2,21 @@ package state
22
33import (
44 "bytes"
5+ "encoding/hex"
56 "errors"
67 "fmt"
78 "os"
89 "time"
9- "encoding/hex"
10+
1011 "github.com/cosmos/gogoproto/proto"
1112
12- tmenclave "github.com/scrtlabs/tm-secret-enclave"
1313 cmtstate "github.com/cometbft/cometbft/proto/tendermint/state"
14+ tm_type "github.com/cometbft/cometbft/proto/tendermint/types"
1415 cmtversion "github.com/cometbft/cometbft/proto/tendermint/version"
1516 "github.com/cometbft/cometbft/types"
1617 cmttime "github.com/cometbft/cometbft/types/time"
1718 "github.com/cometbft/cometbft/version"
19+ tmenclave "github.com/scrtlabs/tm-secret-enclave"
1820)
1921
2022// database keys
@@ -241,6 +243,27 @@ func (state State) MakeBlock(
241243) * types.Block {
242244
243245 // Build base block with block data.
246+ // ScrtLabs changes in ->
247+ marshalledTxs , err := tmenclave .GetScheduledTxs ()
248+ if err != nil {
249+ panic ("Failed to get scheduled txs from tm-secret-enclave" )
250+ }
251+ // implicitTxs = types.Txs(implicitTxs)
252+ implicitTxs := & tm_type.Data {}
253+ err = implicitTxs .Unmarshal (marshalledTxs )
254+ if err != nil {
255+ panic ("Failed to unmarshal scheduled txs" )
256+ }
257+
258+ scheduledTxs := make ([]types.Tx , len (implicitTxs .Txs ), len (implicitTxs .Txs )+ len (txs ))
259+ for i , tx := range implicitTxs .Txs {
260+ scheduledTxs [i ] = types .Tx (tx )
261+ }
262+
263+ // Append original txs after scheduled ones
264+ txs = append (scheduledTxs , txs ... )
265+
266+ // ScrtLabs changes out <-
244267 block := types .MakeBlock (height , txs , lastCommit , evidence )
245268
246269 // Set time.
0 commit comments