From 4c50e3184587936072fc27ef94a31ff6d6e17e7e Mon Sep 17 00:00:00 2001 From: "john.xlm" <60260750+JFWooten4@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:20:17 -0500 Subject: [PATCH 1/4] =?UTF-8?q?=E2=8C=A8=EF=B8=8F=20Optimize=20`nginx`=20l?= =?UTF-8?q?ine=20spacing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/tokens/publishing-asset-info.mdx | 57 +++++++++++++-------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/docs/tokens/publishing-asset-info.mdx b/docs/tokens/publishing-asset-info.mdx index ee91a777f..f0f3bed8a 100644 --- a/docs/tokens/publishing-asset-info.mdx +++ b/docs/tokens/publishing-asset-info.mdx @@ -133,25 +133,24 @@ You should also use the `set_options` operation to set the home domain on your i ```nginx title="Configure stellar.toml for nginx" server { - - server_name my.example.com; - root /var/www/my.example.com; - - location = /.well-known/stellar.toml { - types { } default_type "text/plain; charset=utf-8"; - allow all; - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Content-Length' 0; - return 204; - } - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; - } - } + server_name my.example.com; + root /var/www/my.example.com; + + location = /.well-known/stellar.toml { + types { } default_type "text/plain; charset=utf-8"; + allow all; + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; + add_header 'Content-Length' 0; + return 204; + } + if ($request_method = 'GET') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; + add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; + } + } // CertBot SSL configuration // ... @@ -181,9 +180,9 @@ server networkPassphrase: StellarSdk.Networks.TESTNET, }) .addOperation( - StellarSdk.Operation.setOptions({ - homeDomain: "yourdomain.com", - }), + StellarSdk.Operation.setOptions({ + homeDomain: "yourdomain.com", + }), ) // setTimeout is required for a transaction .setTimeout(100) @@ -220,12 +219,12 @@ issuing_account = server.load_account(issuing_public) transaction = ( TransactionBuilder( - source_account=issuing_account, - network_passphrase=network_passphrase, - base_fee=100, + source_account=issuing_account, + network_passphrase=network_passphrase, + base_fee=100, ) .append_set_options_op( - home_domain="yourdomain.com" + home_domain="yourdomain.com" ) .build() ) @@ -267,10 +266,10 @@ func main() { // Build the transaction tx, err := txnbuild.NewTransaction( txnbuild.TransactionParams{ - SourceAccount: &issuingAccount, + SourceAccount: &issuingAccount, IncrementSequenceNum: true, - BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(100)}, + BaseFee: txnbuild.MinBaseFee, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(100)}, Operations: []txnbuild.Operation{ &txnbuild.SetOptions{ HomeDomain: "yourdomain.com", From 9f67538b7ec75f4d461affc57c9691408ecf5c4a Mon Sep 17 00:00:00 2001 From: "john.xlm" <60260750+JFWooten4@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:26:11 -0500 Subject: [PATCH 2/4] Fix misc go change --- docs/tokens/publishing-asset-info.mdx | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/tokens/publishing-asset-info.mdx b/docs/tokens/publishing-asset-info.mdx index f0f3bed8a..e7e2a982c 100644 --- a/docs/tokens/publishing-asset-info.mdx +++ b/docs/tokens/publishing-asset-info.mdx @@ -152,8 +152,8 @@ server { } } - // CertBot SSL configuration - // ... + // CertBot SSL configuration + // ... } ``` @@ -264,19 +264,19 @@ func main() { } // Build the transaction - tx, err := txnbuild.NewTransaction( - txnbuild.TransactionParams{ - SourceAccount: &issuingAccount, - IncrementSequenceNum: true, - BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(100)}, - Operations: []txnbuild.Operation{ - &txnbuild.SetOptions{ - HomeDomain: "yourdomain.com", - }, - }, - }, - ) + tx, err := txnbuild.NewTransaction( + txnbuild.TransactionParams{ + SourceAccount: &issuingAccount, + IncrementSequenceNum: true, + BaseFee: txnbuild.MinBaseFee, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(100)}, + Operations: []txnbuild.Operation{ + &txnbuild.SetOptions{ + HomeDomain: "yourdomain.com", + }, + }, + }, + ) if err != nil { log.Fatal(err) } From 439e9f65d93887cb6d02005e1f87a59c73770cb8 Mon Sep 17 00:00:00 2001 From: "john.xlm" <60260750+JFWooten4@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:34:15 -0500 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=8D=20Python=20spacing,=20misc=20f?= =?UTF-8?q?low=20I=20like=20adding=20some=20space=20to=20seperate=20out=20?= =?UTF-8?q?the=20caller=20base=20object=20with=20the=20local=20variable=20?= =?UTF-8?q?for=20ease=20of=20visual=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/tokens/publishing-asset-info.mdx | 30 +++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/tokens/publishing-asset-info.mdx b/docs/tokens/publishing-asset-info.mdx index e7e2a982c..f3e435b81 100644 --- a/docs/tokens/publishing-asset-info.mdx +++ b/docs/tokens/publishing-asset-info.mdx @@ -207,33 +207,31 @@ server = Server(horizon_url="https://horizon-testnet.stellar.org") network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE # Keys for accounts to issue and receive the new asset -issuing_keypair = Keypair.from_secret( - "SCZANGBA5YHTNYVVV4C3U252E2B6P6F5T3U6MM63WBSBZATAQI3EBTQ4" -) +issuing_keypair = Keypair.from_secret("SCZANGBA5YHTNYVVV4C3U252E2B6P6F5T3U6MM63WBSBZATAQI3EBTQ4") issuing_public = issuing_keypair.public_key - # Transactions require a valid sequence number that is specific to this account. # We can fetch the current sequence number for the source account from Horizon. issuing_account = server.load_account(issuing_public) transaction = ( - TransactionBuilder( - source_account=issuing_account, - network_passphrase=network_passphrase, - base_fee=100, - ) - .append_set_options_op( - home_domain="yourdomain.com" - ) - .build() + TransactionBuilder( + source_account = issuing_account, + network_passphrase = network_passphrase, + base_fee = 100, + ) + .append_set_options_op( + home_domain = "yourdomain.com" + ) + .build() ) transaction.sign(issuing_keypair) + try: - transaction_resp = server.submit_transaction(transaction) - print(f"Transaction Resp:\n{transaction_resp}") + transaction_resp = server.submit_transaction(transaction) + print(f"Transaction Resp:\n{transaction_resp}") except BaseHorizonError as e: - print(f"Error: {e}") + print(f"Error: {e}") ``` ```java From 89b29b59b53466469aec7d8e1ce0a39d4998f43d Mon Sep 17 00:00:00 2001 From: "john.xlm" <60260750+JFWooten4@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:41:47 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A4=96=20ran=20the=20prettier=20scrip?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/build/guides/testing/unit-tests.mdx | 2 ++ docs/tokens/publishing-asset-info.mdx | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/build/guides/testing/unit-tests.mdx b/docs/build/guides/testing/unit-tests.mdx index dc70ccfed..87b7e902d 100644 --- a/docs/build/guides/testing/unit-tests.mdx +++ b/docs/build/guides/testing/unit-tests.mdx @@ -25,6 +25,7 @@ fn test() { assert_eq!(client.increment(), 3); } ``` + Ref: https://github.com/stellar/soroban-examples/blob/main/increment/src/test.rs :::tip @@ -42,6 +43,7 @@ The Env created at the beginning of the test is not a simulation of the Soroban It's a simple test, but it's a complete test. There's a full environment setup, used, and torn down in the test, and it happens fast. The Rust test harness runs all the tests for a contract in parallel and each will have its own isolated contract environment. Most tests, even integration tests and fuzz tests, will look very similar to this unit test. They'll do four things: + 1. Create an environment, the `Env`. 2. Register the contract(s) to be tested. 3. Invoke functions using a client. diff --git a/docs/tokens/publishing-asset-info.mdx b/docs/tokens/publishing-asset-info.mdx index f3e435b81..1b23d5ac1 100644 --- a/docs/tokens/publishing-asset-info.mdx +++ b/docs/tokens/publishing-asset-info.mdx @@ -180,9 +180,9 @@ server networkPassphrase: StellarSdk.Networks.TESTNET, }) .addOperation( - StellarSdk.Operation.setOptions({ - homeDomain: "yourdomain.com", - }), + StellarSdk.Operation.setOptions({ + homeDomain: "yourdomain.com", + }), ) // setTimeout is required for a transaction .setTimeout(100)