Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions internal/contracts/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,10 @@ func (mc *JSONContract) Unmarshal() (Contract, error) {
func GenerateRandomContract() (*Contract){
min := 1
maxVer := 65535
b := make([]byte, 32)
mrand.Read(b)
genRecipPubKeyHash := b
b := make([]byte, 8)
binary.LittleEndian.PutUint64(b, mrand.Uint64())

genRecipPubKeyHash := hashing.New(b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b isn't random

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it out on playground, and it generates a random []byte every time I call the function

genVersion := mrand.Intn(maxVer - min) + min
genValue := mrand.Uint64()+uint64(min)
genStateNonce := mrand.Uint64()+uint64(min)
Expand Down