Skip to content

Commit

Permalink
[tests] Move to using localtestnet instead of devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnazario committed Jun 5, 2024
1 parent 2a64874 commit 36f3eca
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/actions/run-go-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ runs:
- uses: actions/setup-go@v5
with:
go-version: '>=1.22'
# Run a local testnet in the background. After this action runs the local testnet
# should be up and queryable. This also installs node and pnpm for us.
- uses: aptos-labs/actions/run-local-testnet@main
with:
PNPM_VERSION: 8.9.0
# Run unit tests
- shell: bash
run: 'go vet ./...'
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.14.0
2 changes: 1 addition & 1 deletion examples/alternative_signing/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (signer *AlternativeSigner) AuthKey() *crypto.AuthenticationKey {
// main This example shows you how to make an alternative signer for the SDK, if you prefer a different library
func main() {
// Create a client for Aptos
client, err := aptos.NewClient(aptos.DevnetConfig)
client, err := aptos.NewClient(aptos.LocalnetConfig)
if err != nil {
panic("Failed to create client:" + err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/external_signing/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (signer *ExternalSigner) AuthKey() *crypto.AuthenticationKey {
// main This example shows you how to make an alternative signer for the SDK, if you prefer a different library
func main() {
// Create a client for Aptos
client, err := aptos.NewClient(aptos.DevnetConfig)
client, err := aptos.NewClient(aptos.LocalnetConfig)
if err != nil {
panic("Failed to create client:" + err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/performance_transaction/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
start := time.Now()
before := time.Now()
// Create a client for Aptos
client, err := aptos.NewClient(aptos.DevnetConfig)
client, err := aptos.NewClient(aptos.LocalnetConfig)
if err != nil {
panic("Failed to create client:" + err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion examples/transfer_coin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const TransferAmount = 1_000
// main This example shows you how to make an APT transfer transaction in the simplest possible way
func main() {
// Create a client for Aptos
client, err := aptos.NewClient(aptos.DevnetConfig)
client, err := aptos.NewClient(aptos.LocalnetConfig)
if err != nil {
panic("Failed to create client:" + err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func Sha3256Hash(bytes [][]byte) (output []byte) {
return util.Sha3256Hash(bytes)
}

var testConfig = DevnetConfig
var testConfig = LocalnetConfig

// createTestClient to use for testing for only one place to configure the network
// TODO: Allow overrides with environment variable?
Expand Down

0 comments on commit 36f3eca

Please sign in to comment.