mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
- Update github.com/luxfi/netrunner v1.15.3 → v1.15.4 - Update github.com/luxfi/node v1.22.77 → v1.22.80 - Remove local replace directive for netrunner - Use published package versions for reproducible builds
27 lines
655 B
Go
27 lines
655 B
Go
// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package precompiles
|
|
|
|
import (
|
|
luxcommon "github.com/luxfi/crypto/common"
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/sdk/contract"
|
|
)
|
|
|
|
func WarpPrecompileGetBlockchainID(
|
|
rpcURL string,
|
|
) (ids.ID, error) {
|
|
// Convert geth common.Address to luxcommon.Address
|
|
warpAddr := luxcommon.BytesToAddress(WarpPrecompile.Bytes())
|
|
out, err := contract.CallToMethod(
|
|
rpcURL,
|
|
warpAddr,
|
|
"getBlockchainID()->(bytes32)",
|
|
)
|
|
if err != nil {
|
|
return ids.Empty, err
|
|
}
|
|
return contract.GetSmartContractCallResult[[32]byte]("getBlockchainID", out)
|
|
}
|