Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Oct 9, 2024
1 parent 4897a2c commit b95097a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions e2e/e2etests/test_solana_whitelist_spl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package e2etests
import (
"github.com/gagliardetto/solana-go"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/node/e2e/runner"
"github.com/zeta-chain/node/e2e/txserver"
"github.com/zeta-chain/node/e2e/utils"
Expand Down
6 changes: 5 additions & 1 deletion e2e/runner/solana.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ func (r *E2ERunner) DeploySPL(privateKey *solana.PrivateKey) *solana.Wallet {
tokenAccount.PublicKey(),
).Build()

signedTx := r.CreateSignedTransaction([]solana.Instruction{createAccountInstruction, initializeMintInstruction}, *privateKey, []solana.PrivateKey{tokenAccount.PrivateKey})
signedTx := r.CreateSignedTransaction(
[]solana.Instruction{createAccountInstruction, initializeMintInstruction},
*privateKey,
[]solana.PrivateKey{tokenAccount.PrivateKey},
)

// broadcast the transaction and wait for finalization
_, out := r.BroadcastTxSync(signedTx)
Expand Down
4 changes: 3 additions & 1 deletion zetaclient/chains/solana/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ func (signer *Signer) TryProcessOutbound(
// sign the withdraw transaction by relayer key
tx, err := signer.SignWhitelistTx(ctx, contracts.NewMsgWhitelist(pk, whitelistEntryPDA))
if err != nil {
logger.Error().Err(err).Msgf("TryProcessOutbound: SignWhitelistTx error for chain %d nonce %d", chainID, nonce)
logger.Error().
Err(err).
Msgf("TryProcessOutbound: SignWhitelistTx error for chain %d nonce %d", chainID, nonce)
return
}

Expand Down
10 changes: 9 additions & 1 deletion zetaclient/chains/solana/signer/whitelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
"github.com/near/borsh-go"

contracts "github.com/zeta-chain/node/pkg/contracts/solana"
)

Expand All @@ -24,7 +25,14 @@ func (signer *Signer) SignWhitelistTx(ctx context.Context, msg *contracts.MsgWhi

// attach required accounts to the instruction
privkey := signer.relayerKey
attachWhitelistAccounts(&inst, privkey.PublicKey(), signer.pda, msg.WhitelistCandidate(), msg.WhitelistEntry(), signer.gatewayID)
attachWhitelistAccounts(
&inst,
privkey.PublicKey(),
signer.pda,
msg.WhitelistCandidate(),
msg.WhitelistEntry(),
signer.gatewayID,
)

// get a recent blockhash
recent, err := signer.client.GetLatestBlockhash(ctx, rpc.CommitmentFinalized)
Expand Down

0 comments on commit b95097a

Please sign in to comment.