Skip to content

Commit

Permalink
Merge branch 'develop' into c/create-contract-carmen
Browse files Browse the repository at this point in the history
  • Loading branch information
cabrador authored Oct 5, 2024
2 parents 3081522 + 05a1b07 commit 9c74fb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions executor/transaction_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ func prepareBlockCtx(inputEnv txcontext.BlockEnvironment, hashError *error) *vm.
BlockNumber: new(big.Int).SetUint64(inputEnv.GetNumber()),
Time: inputEnv.GetTimestamp(),
Difficulty: inputEnv.GetDifficulty(),
Random: inputEnv.GetRandom(),
GasLimit: inputEnv.GetGasLimit(),
GetHash: getHash,
}
Expand Down
7 changes: 6 additions & 1 deletion txcontext/substate/block_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ type blockEnvironment struct {
}

func (e *blockEnvironment) GetRandom() *common.Hash {
return nil
if e.Random == nil {
return nil
}

h := common.Hash(e.Random.Bytes())
return &h
}

func (e *blockEnvironment) GetBlockHash(block uint64) (common.Hash, error) {
Expand Down

0 comments on commit 9c74fb5

Please sign in to comment.