-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DeployAccount Method to account/account.go for Issue #381 #445
Open
Gabulhas
wants to merge
6
commits into
NethermindEth:main
Choose a base branch
from
Gabulhas:feature/issue-382
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
00f3530
created Account.DeployAccount method
Gabulhas 3f606aa
added test for account.DeployAccount
Gabulhas d036b5a
Merge branch 'main' into feature/issue-382
Gabulhas 5524d06
Fixed typo and changed DeployAccount name
Gabulhas acb5928
Merge remote-tracking branch 'origin/feature/issue-382' into feature/…
Gabulhas 26a0d83
- Updated the TestDeployAccountDevnet func name to TestCreateAndExecu…
Gabulhas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# use this variable to change the RPC base URL | ||
#INTEGRATION_BASE=http_insert_end_point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This example uses a pre-existing contract on the goerli network to deploy a new account contract. To successfully run this example, you will need: 1) a goerli endpoint, and 2) to fund the precomputed address. | ||
|
||
Steps: | ||
1. Rename the ".env.template" file to ".env.testnet" | ||
2. Uncomment, and assign your testnet endpoint to the "INTEGRATION_BASE" variable | ||
3. Execute `go mod tidy` (make sure you are in the "deployAccount" folder) | ||
4. Execute `go run main.go` | ||
5. Fund the precomputed address using a starknet faucet, eg https://faucet.goerli.starknet.io/ | ||
6. Press any key, then enter | ||
|
||
At this point your account should be deployed on testnet, and you can use a block explorer like [Voyager](https://voyager.online/) to view your transaction using the transaction hash. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module account | ||
|
||
go 1.21 | ||
|
||
require ( | ||
github.com/NethermindEth/juno v0.3.1 | ||
github.com/NethermindEth/starknet.go v0.2.1-0.20220620163912-1db2ca279608 | ||
github.com/ethereum/go-ethereum v1.10.26 | ||
github.com/joho/godotenv v1.4.0 | ||
) | ||
|
||
replace github.com/NethermindEth/starknet.go => ../../ | ||
|
||
require ( | ||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect | ||
github.com/bits-and-blooms/bitset v1.7.0 // indirect | ||
github.com/consensys/bavard v0.1.13 // indirect | ||
github.com/consensys/gnark-crypto v0.11.0 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/deckarep/golang-set v1.8.0 // indirect | ||
github.com/fxamacker/cbor/v2 v2.4.0 // indirect | ||
github.com/go-ole/go-ole v1.2.1 // indirect | ||
github.com/go-stack/stack v1.8.0 // indirect | ||
github.com/gorilla/websocket v1.4.2 // indirect | ||
github.com/mmcloughlin/addchain v0.4.0 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect | ||
github.com/stretchr/testify v1.8.1 // indirect | ||
github.com/test-go/testify v1.1.4 // indirect | ||
github.com/tklauser/go-sysconf v0.3.5 // indirect | ||
github.com/tklauser/numcpus v0.2.2 // indirect | ||
github.com/x448/float16 v0.8.4 // indirect | ||
golang.org/x/crypto v0.2.0 // indirect | ||
golang.org/x/sys v0.3.0 // indirect | ||
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
rsc.io/tmplfunc v0.0.3 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
go 1.21 | ||
|
||
use ( | ||
. | ||
../.. | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for rpcv05 and lower. However, rpcv06 introduces a new deployAccount transaction version (v3), meaning users won't be able to use this method to submit v3 transactions. It would be great if we could make this compatible with both transaction versions (eg by accepting the transaction as an argument, tx rpc.DeployAccountType)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure will fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by "this method" you mean the whole method "CreateAndExecuteAddDeployAccount" or the way you deploy accounts like in the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CreateAndExecuteAddDeployAccount method.