Skip to content

Commit 92252e1

Browse files
committed
Refactor code for consistency by removing unnecessary whitespace and ensuring proper formatting in multiple files
1 parent 6e41f63 commit 92252e1

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

client.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"net/http"
66
"time"
7-
87
"github.com/aptos-labs/aptos-go-sdk/api"
98
"github.com/aptos-labs/aptos-go-sdk/crypto"
109
"github.com/hasura/go-graphql-client"
@@ -776,7 +775,7 @@ func (client *Client) SimulateTransaction(rawTxn *RawTransaction, sender Transac
776775
// - data: A slice of pointers to the simulated user transactions.
777776
// - err: An error if the simulation fails.
778777
func (client *Client) SimulateMultiTransaction(rawTxnWithData *RawTransactionWithData, sender TransactionSigner, additionalSigners []crypto.AccountAuthenticator, options ...any) (data []*api.UserTransaction, err error) {
779-
return client.nodeClient.SimulateMultiTransaction(rawTxnWithData, sender, additionalSigners , options...)
778+
return client.nodeClient.SimulateMultiTransaction(rawTxnWithData, sender, additionalSigners, options...)
780779
}
781780

782781
// SimulateTransactionWithSignedTxn simulates a transaction using a signed transaction.

crypto/AccountAuthenticatorNoAccountAuthenticator.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ func (aa *AccountAuthenticatorNoAccountAuthenticator) PublicKey() PublicKey {
1717
err := (publicKey).FromHex("0x0000000000000000000000000000000000000000000000000000000000000000")
1818
println(publicKey.ToHex())
1919
if err != nil {
20-
20+
2121
// Handle error or log it
2222
// For this case, it should never fail since we're using a valid zero key
2323
}
24-
24+
2525
return publicKey
2626
}
2727

@@ -42,4 +42,4 @@ func (ea *AccountAuthenticatorNoAccountAuthenticator) Signature() Signature {
4242
// - [AccountAuthenticatorImpl]
4343
func (aa *AccountAuthenticatorNoAccountAuthenticator) Verify(msg []byte) bool {
4444
return false
45-
}
45+
}

crypto/authenticator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const (
3939
AccountAuthenticatorMultiEd25519 AccountAuthenticatorType = 1 // AccountAuthenticatorMultiEd25519 is the authenticator type for multi-ed25519 accounts
4040
AccountAuthenticatorSingleSender AccountAuthenticatorType = 2 // AccountAuthenticatorSingleSender is the authenticator type for single-key accounts
4141
AccountAuthenticatorMultiKey AccountAuthenticatorType = 3 // AccountAuthenticatorMultiKey is the authenticator type for multi-key accounts
42-
AccountAuthenticatorNoAccount AccountAuthenticatorType = 4
42+
AccountAuthenticatorNoAccount AccountAuthenticatorType = 4
4343
)
4444

4545
// AccountAuthenticator a generic authenticator type for a transaction

examples/simulate_mult_transaction/main.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ func example(networkConfig aptos.NetworkConfig) {
8282
panic("Failed to serialize transfer amount:" + err.Error())
8383
}
8484

85-
8685
rawTxn, err := client.BuildTransactionMultiAgent(alice.AccountAddress(), aptos.TransactionPayload{
8786
Payload: &aptos.EntryFunction{
8887
Module: aptos.ModuleId{
@@ -124,7 +123,7 @@ func example(networkConfig aptos.NetworkConfig) {
124123
}
125124

126125
// 4.a. merge the signatures together into a single transaction
127-
signedTxn, ok := rawTxn.ToFeePayerSignedTransaction(aliceAuth,bobAuth ,[]crypto.AccountAuthenticator{})
126+
signedTxn, ok := rawTxn.ToFeePayerSignedTransaction(aliceAuth, bobAuth, []crypto.AccountAuthenticator{})
128127
if !ok {
129128
panic("Failed to build a signed multiagent transaction")
130129
}

nodeClient.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"sort"
1414
"strconv"
1515
"time"
16-
1716
"github.com/aptos-labs/aptos-go-sdk/api"
1817
"github.com/aptos-labs/aptos-go-sdk/bcs"
1918
"github.com/aptos-labs/aptos-go-sdk/crypto"
@@ -734,19 +733,19 @@ func (rc *NodeClient) SimulateTransaction(rawTxn *RawTransaction, sender Transac
734733
// If feePayerAddress is nil, no fee payer will be used
735734
// If secondarySignerAddresses is nil or empty, no secondary signers will be used
736735
func (rc *NodeClient) SimulateMultiTransaction(rawTxnWithData *RawTransactionWithData, sender TransactionSigner, additionalSigners []crypto.AccountAuthenticator, options ...any) (data []*api.UserTransaction, err error) {
737-
if( rawTxnWithData == nil ) {
736+
if rawTxnWithData == nil {
738737
return nil, fmt.Errorf("rawTxnWithData is nil")
739738
}
740-
switch rawTxnWithData.Variant{
739+
switch rawTxnWithData.Variant {
741740
case MultiAgentWithFeePayerRawTransactionWithDataVariant:
742741
signedFeePayerTxn, ok := rawTxnWithData.ToFeePayerSignedTransaction(
743742
sender.SimulationAuthenticator(),
744743
&crypto.AccountAuthenticator{
745744
Variant: crypto.AccountAuthenticatorNoAccount,
746-
Auth: &crypto.AccountAuthenticatorNoAccountAuthenticator{},
745+
Auth: &crypto.AccountAuthenticatorNoAccountAuthenticator{},
747746
},
748747
additionalSigners,
749-
);
748+
)
750749
if !ok {
751750
return nil, fmt.Errorf("failed to sign fee payer transaction")
752751
}

0 commit comments

Comments
 (0)