From c0ea797ca0066d218e322fb4fd05d3980feb54c7 Mon Sep 17 00:00:00 2001 From: jlaveracll Date: Fri, 8 Nov 2024 11:10:17 -0300 Subject: [PATCH] improving a bit --- aptos.go | 2 +- genchains_aptos.go | 7 ++++--- genchains_evm.go | 3 ++- genchains_solana.go | 3 ++- generated_chains_aptos.go | 6 +++--- generated_chains_solana.go | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/aptos.go b/aptos.go index 8b640d8..091caba 100644 --- a/aptos.go +++ b/aptos.go @@ -39,7 +39,7 @@ func parseAptosYml(ymlFile []byte) map[uint64]ChainDetails { } func validateAptosChainID(data map[uint64]ChainDetails) { - // TODO: + // TODO: https://smartcontract-it.atlassian.net/browse/NONEVM-890 } func AptosChainIdToChainSelector() map[uint64]uint64 { diff --git a/genchains_aptos.go b/genchains_aptos.go index 3b33256..f8f8c01 100644 --- a/genchains_aptos.go +++ b/genchains_aptos.go @@ -29,7 +29,7 @@ var chainTemplate, _ = template.New("").Parse(`// Code generated by go generate package chain_selectors type AptosChain struct { - ChainID string + ChainID uint64 Selector uint64 Name string VarName string @@ -37,7 +37,7 @@ type AptosChain struct { var ( {{ range . }} - {{.VarName}} = AptosChain{ChainID: "{{ .ChainID }}", Selector: {{ .Selector }}, Name: "{{ .Name }}"}{{ end }} + {{.VarName}} = AptosChain{ChainID: {{ .ChainID }}, Selector: {{ .Selector }}, Name: "{{ .Name }}"}{{ end }} ) var AptosALL = []AptosChain{ @@ -64,9 +64,10 @@ func main() { } if string(existingContent) == string(formatted) { - fmt.Println("no changes detected") + fmt.Println("aptos: no changes detected") return } + fmt.Println("aptos: updating generations") err = os.WriteFile(filename, formatted, 0644) if err != nil { diff --git a/genchains_evm.go b/genchains_evm.go index 62dafdc..804068e 100644 --- a/genchains_evm.go +++ b/genchains_evm.go @@ -64,9 +64,10 @@ func main() { } if string(existingContent) == string(formatted) { - fmt.Println("no changes detected") + fmt.Println("evm: no changes detected") return } + fmt.Println("evm: updating generations") err = os.WriteFile(filename, formatted, 0644) if err != nil { diff --git a/genchains_solana.go b/genchains_solana.go index 85937ed..bee19e8 100644 --- a/genchains_solana.go +++ b/genchains_solana.go @@ -64,9 +64,10 @@ func main() { } if string(existingContent) == string(formatted) { - fmt.Println("no changes detected") + fmt.Println("solana: no changes detected") return } + fmt.Println("evm: updating generations") err = os.WriteFile(filename, formatted, 0644) if err != nil { diff --git a/generated_chains_aptos.go b/generated_chains_aptos.go index 6f31953..cabd075 100644 --- a/generated_chains_aptos.go +++ b/generated_chains_aptos.go @@ -2,15 +2,15 @@ package chain_selectors type AptosChain struct { - ChainID string + ChainID uint64 Selector uint64 Name string VarName string } var ( - APTOS_MAINNET = AptosChain{ChainID: "1", Selector: 124, Name: "aptos-mainnet"} - APTOS_TESTNET = AptosChain{ChainID: "2", Selector: 321, Name: "aptos-testnet"} + APTOS_MAINNET = AptosChain{ChainID: 1, Selector: 124, Name: "aptos-mainnet"} + APTOS_TESTNET = AptosChain{ChainID: 2, Selector: 321, Name: "aptos-testnet"} ) var AptosALL = []AptosChain{ diff --git a/generated_chains_solana.go b/generated_chains_solana.go index ba261dd..9f0a3bb 100644 --- a/generated_chains_solana.go +++ b/generated_chains_solana.go @@ -11,7 +11,7 @@ type SolanaChain struct { var ( SOLANA_DEVNET = SolanaChain{ChainID: "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG", Selector: 16423721717087811551, Name: "solana-devnet"} SOLANA_MAINNET = SolanaChain{ChainID: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d", Selector: 124615329519749607, Name: "solana-mainnet"} - SOLANA_TESTNET = SolanaChain{ChainID: "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY", Selector: 6302590918974934319, Name: "solana-testnet"} + SOLANA_TESTNET = SolanaChain{ChainID: "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY", Selector: 6302590918974934333, Name: "solana-testnet"} ) var SolanaALL = []SolanaChain{