-
Notifications
You must be signed in to change notification settings - Fork 658
/
context.go
38 lines (33 loc) · 898 Bytes
/
context.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package builder
import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/logging"
)
const Alias = "X"
type Context struct {
NetworkID uint32
BlockchainID ids.ID
AVAXAssetID ids.ID
BaseTxFee uint64
CreateAssetTxFee uint64
}
func NewSnowContext(
networkID uint32,
blockchainID ids.ID,
avaxAssetID ids.ID,
) (*snow.Context, error) {
lookup := ids.NewAliaser()
return &snow.Context{
NetworkID: networkID,
SubnetID: constants.PrimaryNetworkID,
ChainID: blockchainID,
XChainID: blockchainID,
AVAXAssetID: avaxAssetID,
Log: logging.NoLog{},
BCLookup: lookup,
}, lookup.Alias(blockchainID, Alias)
}