mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
dendrite uses commandline flag v1 or v2 to choose the smart contracts for the isEntitled check
19 lines
357 B
Go
19 lines
357 B
Go
package zion
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/crypto"
|
|
)
|
|
|
|
func NetworkIdToHash(networkId string) [32]byte {
|
|
hash := crypto.Keccak256Hash([]byte(networkId))
|
|
return sliceBytesToBytes32(hash.Bytes())
|
|
}
|
|
|
|
func sliceBytesToBytes32(bytes []byte) [32]byte {
|
|
bytes32 := [32]byte{}
|
|
for i := 0; i < 32; i++ {
|
|
bytes32[i] = bytes[i]
|
|
}
|
|
return bytes32
|
|
}
|