Skip to content

Commit

Permalink
feat: allow to specify Ethereum chain id
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel1302 committed Sep 27, 2022
1 parent be761ce commit 5675495
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ type WalletConfig struct {

type TokenConfig struct {
EthereumAPIAddress string `yaml:"ethereumAPIAddress"`
EthereumChainID int `yaml:"ethereumChainID"`
Erc20BridgeAddress string `yaml:"erc20BridgeAddress"`
StakingBridgeAddress string `yaml:"stakingBridgeAddress"`
ERC20TokenAddress string `yaml:"erc20TokenAddress"`
Expand Down
1 change: 1 addition & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ wallet:
url: http://127.0.0.1:1789
token:
ethereumAPIAddress: https://127.0.0.1:8545
ethereumChainID: 1440
erc20BridgeAddress: 0x9708FF7510D4A7B9541e1699d15b53Ecb1AFDc54
stakingBridgeAddress: 0x9135f5afd6F055e731bca2348429482eE614CFfA
erc20TokenAddress: 0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0
Expand Down
2 changes: 1 addition & 1 deletion token/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Service struct {
func NewService(conf *config.TokenConfig, vegaPubKey string) (*Service, error) {
ctx := context.Background()

client, err := vgethereum.NewClient(ctx, conf.EthereumAPIAddress, 1440)
client, err := vgethereum.NewClient(ctx, conf.EthereumAPIAddress, int64(conf.EthereumChainID))
if err != nil {
return nil, fmt.Errorf("failed to create Ethereum client: %w", err)
}
Expand Down

0 comments on commit 5675495

Please sign in to comment.