Skip to content

Commit

Permalink
bump starknet relayer (#12575)
Browse files Browse the repository at this point in the history
* bump starknet relayer

* changeset

* fix config test and remove caigo

* fix more tests

* add missing config

* trim newline and change order of FeederURL in TOML

* strip newline

* add spaces for web tests

* have to add space at end of every TOML file

* remove trim

* tidy
  • Loading branch information
augustbleeds committed Mar 27, 2024
1 parent dc224a2 commit 23254c4
Show file tree
Hide file tree
Showing 28 changed files with 190 additions and 118 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-weeks-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

update starknet relayer to fix nonce issue. introduces optional api-key for starknet toml config.
55 changes: 31 additions & 24 deletions core/cmd/shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/urfave/cli"

commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"
Expand Down Expand Up @@ -474,33 +475,37 @@ func TestSetupStarkNetRelayer(t *testing.T) {
tConfig := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Starknet = stkcfg.TOMLConfigs{
&stkcfg.TOMLConfig{
ChainID: ptr[string]("starknet-id-1"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
ChainID: ptr[string]("starknet-id-1"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
&stkcfg.TOMLConfig{
ChainID: ptr[string]("starknet-id-2"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
ChainID: ptr[string]("starknet-id-2"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
&stkcfg.TOMLConfig{
ChainID: ptr[string]("disabled-starknet-id-1"),
Enabled: ptr(false),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
ChainID: ptr[string]("disabled-starknet-id-1"),
Enabled: ptr(false),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
}
})

t2Config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Starknet = stkcfg.TOMLConfigs{
&stkcfg.TOMLConfig{
ChainID: ptr[string]("starknet-id-3"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
ChainID: ptr[string]("starknet-id-3"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
}
})
Expand Down Expand Up @@ -534,16 +539,18 @@ func TestSetupStarkNetRelayer(t *testing.T) {
duplicateConfig := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Starknet = stkcfg.TOMLConfigs{
&stkcfg.TOMLConfig{
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
&stkcfg.TOMLConfig{
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
}
})
Expand Down
4 changes: 4 additions & 0 deletions core/config/docs/chains-starknet.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[Starknet]]
# ChainID is the Starknet chain ID.
ChainID = 'foobar' # Example
# FeederURL is required to get tx metadata (that the RPC can't)
FeederURL = 'http://feeder.url' # Example
# Enabled enables this chain.
Enabled = true # Default
# OCR2CachePollPeriod is the rate to poll for the OCR2 state cache.
Expand All @@ -19,3 +21,5 @@ ConfirmationPoll = '5s' # Default
Name = 'primary' # Example
# URL is the base HTTP(S) endpoint for this node.
URL = 'http://stark.node' # Example
# APIKey Header is optional and only required for Nethermind RPCs
APIKey = 'key' # Example
7 changes: 4 additions & 3 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ require (
github.com/Depado/ginprom v1.8.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/NethermindEth/juno v0.3.1 // indirect
github.com/NethermindEth/starknet.go v0.6.1-0.20231218140327-915109ab5bc1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/XSAM/otelsql v0.27.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
Expand Down Expand Up @@ -152,7 +154,6 @@ require (
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/go-tpm v0.9.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
Expand Down Expand Up @@ -254,13 +255,12 @@ require (
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.23.11 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chain-selectors v1.0.10 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240213120401-01a23955f9f8 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240325075535-0f7eb05ee595 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/wsrpc v0.7.2 // indirect
Expand All @@ -275,6 +275,7 @@ require (
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect
github.com/test-go/testify v1.1.4 // indirect
github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tidwall/gjson v1.17.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/NethermindEth/juno v0.3.1 h1:AW72LiAm9gqUeCVJWvepnZcTnpU4Vkl0KzPMxS+42FA=
github.com/NethermindEth/juno v0.3.1/go.mod h1:SGbTpgGaCsxhFsKOid7Ylnz//WZ8swtILk+NbHGsk/Q=
github.com/NethermindEth/starknet.go v0.6.1-0.20231218140327-915109ab5bc1 h1:9SBvy3eZut1X+wEyAFqfb7ADGj8IQw7ZnlkMwz0YOTY=
github.com/NethermindEth/starknet.go v0.6.1-0.20231218140327-915109ab5bc1/go.mod h1:V6qrbi1+fTDCftETIT1grBXIf+TvWP/4Aois1a9EF1E=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
Expand Down Expand Up @@ -603,8 +607,6 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk=
github.com/google/go-tpm v0.9.0/go.mod h1:FkNVkc6C+IsvDI9Jw1OveJmxGZUUaKxtrpOS47QWKfU=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
Expand Down Expand Up @@ -1181,8 +1183,6 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCqR1LNS7aI3jT0V+xGrg=
github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 h1:GNhRKD3izyzAoGMXDvVUAwEuzz4Atdj3U3RH7eak5Is=
Expand All @@ -1197,8 +1197,8 @@ github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8 h
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8/go.mod h1:vy1L7NybTy2F/Yv7BOh+oZBa1MACD6gzd1+DkcSkfp8=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e h1:k8HS3GsAFZnxXIW3141VsQP2+EL1XrTtOi/HDt7sdBE=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240325075535-0f7eb05ee595 h1:y6ks0HsSOhPUueOmTcoxDQ50RCS1XINlRDTemZyHjFw=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240325075535-0f7eb05ee595/go.mod h1:vV6WfnVIbK5Q1JsIru4YcTG0T1uRpLJm6t2BgCnCSsg=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs=
github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo=
Expand Down
10 changes: 8 additions & 2 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ var (
Chain: stkcfg.Chain{
ConfirmationPoll: commoncfg.MustNewDuration(time.Hour),
},
FeederURL: commoncfg.MustParseURL("http://feeder.url"),
Nodes: []*stkcfg.Node{
{Name: ptr("primary"), URL: commoncfg.MustParseURL("http://stark.node")},
{Name: ptr("primary"), URL: commoncfg.MustParseURL("http://stark.node"), APIKey: ptr("key")},
},
},
},
Expand Down Expand Up @@ -654,8 +655,9 @@ func TestConfig_Marshal(t *testing.T) {
TxTimeout: commoncfg.MustNewDuration(13 * time.Second),
ConfirmationPoll: commoncfg.MustNewDuration(42 * time.Second),
},
FeederURL: commoncfg.MustParseURL("http://feeder.url"),
Nodes: []*stkcfg.Node{
{Name: ptr("primary"), URL: commoncfg.MustParseURL("http://stark.node")},
{Name: ptr("primary"), URL: commoncfg.MustParseURL("http://stark.node"), APIKey: ptr("key")},
},
},
}
Expand Down Expand Up @@ -1110,6 +1112,7 @@ URL = 'http://solana.bar'
`},
{"Starknet", Config{Starknet: full.Starknet}, `[[Starknet]]
ChainID = 'foobar'
FeederURL = 'http://feeder.url'
Enabled = true
OCR2CachePollPeriod = '6h0m0s'
OCR2CacheTTL = '3m0s'
Expand All @@ -1120,6 +1123,7 @@ ConfirmationPoll = '42s'
[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'
`},
{"Mercury", Config{Core: toml.Core{Mercury: full.Mercury}}, `[Mercury]
[Mercury.Cache]
Expand All @@ -1142,6 +1146,7 @@ CertFile = '/path/to/cert.pem'

require.NoError(t, config.DecodeTOML(strings.NewReader(s), &got))
ts, err := got.TOMLString()

require.NoError(t, err)
assert.Equal(t, tt.config, got, diff.Diff(s, ts))
})
Expand Down Expand Up @@ -1547,6 +1552,7 @@ func TestConfig_SetFrom(t *testing.T) {
require.NoError(t, c.SetFrom(&f))
}
ts, err := c.TOMLString()

require.NoError(t, err)
assert.Equal(t, tt.exp, ts)
})
Expand Down
34 changes: 20 additions & 14 deletions core/services/chainlink/relayer_chain_interoperators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,32 +100,38 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {

c.Starknet = stkcfg.TOMLConfigs{
&stkcfg.TOMLConfig{
ChainID: &starknetChainID1,
Enabled: ptr(true),
Chain: stkcfg.Chain{},
ChainID: &starknetChainID1,
Enabled: ptr(true),
Chain: stkcfg.Chain{},
FeederURL: commonconfig.MustParseURL("http://feeder.url"),
Nodes: []*stkcfg.Node{
{
Name: ptr("starknet chain 1 node 1"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:8547").URL())),
Name: ptr("starknet chain 1 node 1"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:8547").URL())),
APIKey: ptr("key"),
},
{
Name: ptr("starknet chain 1 node 2"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:8548").URL())),
Name: ptr("starknet chain 1 node 2"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:8548").URL())),
APIKey: ptr("key"),
},
{
Name: ptr("starknet chain 1 node 3"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:8549").URL())),
Name: ptr("starknet chain 1 node 3"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:8549").URL())),
APIKey: ptr("key"),
},
},
},
&stkcfg.TOMLConfig{
ChainID: &starknetChainID2,
Enabled: ptr(true),
Chain: stkcfg.Chain{},
ChainID: &starknetChainID2,
Enabled: ptr(true),
Chain: stkcfg.Chain{},
FeederURL: commonconfig.MustParseURL("http://feeder.url"),
Nodes: []*stkcfg.Node{
{
Name: ptr("starknet chain 2 node 1"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:3547").URL())),
Name: ptr("starknet chain 2 node 1"),
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:3547").URL())),
APIKey: ptr("key"),
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ URL = 'http://solana.bar'

[[Starknet]]
ChainID = 'foobar'
FeederURL = 'http://feeder.url'
Enabled = true
OCR2CachePollPeriod = '6h0m0s'
OCR2CacheTTL = '3m0s'
Expand All @@ -441,3 +442,4 @@ ConfirmationPoll = '42s'
[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'
2 changes: 2 additions & 0 deletions core/services/chainlink/testdata/config-invalid.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ Name = 'bar'
[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'

[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://second.stark.node'
APIKey = 'key'

[[Starknet]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ URL = 'http://testnet.solana.com'

[[Starknet]]
ChainID = 'foobar'
FeederURL = 'http://feeder.url'
OCR2CachePollPeriod = '5s'
OCR2CacheTTL = '1m0s'
RequestTimeout = '10s'
Expand All @@ -598,3 +599,4 @@ ConfirmationPoll = '1h0m0s'
[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'
2 changes: 2 additions & 0 deletions core/services/chainlink/testdata/config-multi-chain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ URL = 'http://testnet.solana.com'

[[Starknet]]
ChainID = 'foobar'
FeederURL = 'http://feeder.url'
ConfirmationPoll = '1h0m0s'

[[Starknet.Nodes]]
Name = 'primary'
URL = 'http://stark.node'
APIKey = 'key'
8 changes: 4 additions & 4 deletions core/services/keystore/keys/starkkey/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"math/big"

"github.com/smartcontractkit/caigo"
caigotypes "github.com/smartcontractkit/caigo/types"
"github.com/NethermindEth/juno/core/felt"
"github.com/NethermindEth/starknet.go/curve"
)

// Raw represents the Stark private key
Expand All @@ -19,7 +19,7 @@ func (raw Raw) Key() Key {
var err error

k.priv = new(big.Int).SetBytes(raw)
k.pub.X, k.pub.Y, err = caigo.Curve.PrivateToPoint(k.priv)
k.pub.X, k.pub.Y, err = curve.Curve.PrivateToPoint(k.priv)
if err != nil {
panic(err) // key not generated
}
Expand Down Expand Up @@ -75,7 +75,7 @@ func (key Key) ID() string {
// it is the X component of the ECDSA pubkey and used in the deployment of the account contract
// this func is used in exporting it via CLI and API
func (key Key) StarkKeyStr() string {
return caigotypes.BigToFelt(key.pub.X).String()
return new(felt.Felt).SetBytes(key.pub.X.Bytes()).String()
}

// Raw from private key
Expand Down
Loading

0 comments on commit 23254c4

Please sign in to comment.