File tree Expand file tree Collapse file tree 8 files changed +17
-25
lines changed
tw_any_coin/tests/chains/solana Expand file tree Collapse file tree 8 files changed +17
-25
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ jobs:
152
152
./tools/release-size compare --before previous/release-report.json --current release-report.json > report-diff.md
153
153
154
154
- name : Create or Update Comment
155
+ if : github.event_name == 'pull_request'
155
156
uses : edumserrano/find-create-or-update-comment@v2
156
157
with :
157
158
issue-number : ${{ github.event.pull_request.number }}
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ ENV CXX=/usr/bin/clang++-14
38
38
RUN wget "https://sh.rustup.rs" -O rustup.sh \
39
39
&& sh rustup.sh -y
40
40
ENV PATH="/root/.cargo/bin:${PATH}"
41
+ RUN rustup default nightly-2024-02-09
41
42
RUN cargo install --force cbindgen \
42
43
&& rustup target add wasm32-unknown-emscripten
43
44
Original file line number Diff line number Diff line change @@ -35,13 +35,11 @@ impl SolanaCompiler {
35
35
input : Proto :: SigningInput < ' _ > ,
36
36
) -> SigningResult < Proto :: PreSigningOutput < ' static > > {
37
37
let builder = MessageBuilder :: new ( input) ;
38
- let signers = builder. signers ( ) ?;
39
38
let unsigned_msg = builder. build ( ) ?;
40
-
41
39
let data_to_sign = TxSigner :: preimage_versioned ( & unsigned_msg) ?;
42
40
43
- let signers: Vec < _ > = signers
44
- . iter ( )
41
+ let signers: Vec < _ > = unsigned_msg
42
+ . signers ( )
45
43
. map ( |addr| Cow :: from ( addr. to_string ( ) . into_bytes ( ) ) )
46
44
. collect ( ) ;
47
45
Original file line number Diff line number Diff line change @@ -57,22 +57,6 @@ impl<'a> MessageBuilder<'a> {
57
57
Ok ( signing_keys)
58
58
}
59
59
60
- pub fn signers ( & self ) -> SigningResult < Vec < SolanaAddress > > {
61
- let mut signers = Vec :: default ( ) ;
62
- if !self . input . fee_payer . is_empty ( ) {
63
- signers. push ( SolanaAddress :: from_str ( self . input . fee_payer . as_ref ( ) ) ?) ;
64
- }
65
-
66
- signers. push ( self . signer_address ( ) ?) ;
67
-
68
- // Consider matching other transaction types if they may contain other private keys.
69
- if let ProtoTransactionType :: create_nonce_account( ref nonce) = self . input . transaction_type {
70
- signers. push ( SolanaAddress :: from_str ( nonce. nonce_account . as_ref ( ) ) ?) ;
71
- }
72
-
73
- Ok ( signers)
74
- }
75
-
76
60
pub fn external_signatures ( & self ) -> SigningResult < PubkeySignatureMap > {
77
61
match self . input . raw_message {
78
62
Some ( ref raw_message) => RawMessageBuilder :: external_signatures ( raw_message) ,
Original file line number Diff line number Diff line change @@ -65,6 +65,16 @@ impl VersionedMessage {
65
65
}
66
66
}
67
67
68
+ pub fn signers ( & self ) -> impl Iterator < Item = & SolanaAddress > {
69
+ let signatures_count = self . num_required_signatures ( ) ;
70
+ match self {
71
+ VersionedMessage :: Legacy ( legacy) => & legacy. account_keys ,
72
+ VersionedMessage :: V0 ( v0) => & v0. account_keys ,
73
+ }
74
+ . iter ( )
75
+ . take ( signatures_count)
76
+ }
77
+
68
78
pub fn recent_blockhash ( & self ) -> Blockhash {
69
79
match self {
70
80
VersionedMessage :: Legacy ( legacy) => Blockhash :: with_bytes ( legacy. recent_blockhash ) ,
Original file line number Diff line number Diff line change @@ -302,8 +302,6 @@ fn test_solana_decode_transaction_update_blockhash_preimage_hash_and_compile() {
302
302
// Step 3. Pre-image hash the transaction.
303
303
304
304
let input = Proto :: SigningInput {
305
- // There is no matching pubkey in the transaction account keys.
306
- sender : SENDER_PUBLIC_KEY . into ( ) ,
307
305
raw_message : Some ( decoded_tx) ,
308
306
tx_encoding : Proto :: Encoding :: Base64 ,
309
307
..Proto :: SigningInput :: default ( )
Original file line number Diff line number Diff line change 2
2
//
3
3
// Copyright © 2017 Trust Wallet.
4
4
5
- #include " Coin.h"
6
5
#include " HexCoding.h"
7
6
#include " PublicKey.h"
8
7
#include " TransactionCompiler.h"
9
8
10
9
#include " proto/Bitcoin.pb.h"
11
10
#include " proto/TransactionCompiler.pb.h"
12
11
12
+ #include < TrustWalletCore/TWAnySigner.h>
13
+ #include < TrustWalletCore/TWBitcoinSigHashType.h>
13
14
#include < TrustWalletCore/TWCoinType.h>
14
15
15
16
#include " Bitcoin/Script.h"
16
- #include " Bitcoin/TransactionPlan.h"
17
17
18
18
#include " TestUtilities.h"
19
19
#include < gtest/gtest.h>
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def compare_sizes(args):
54
54
print ("## Binary size comparison" )
55
55
print ()
56
56
for target , current_kb in current_json .items ():
57
- before_kb = before_json .get (target , 0 )
57
+ before_kb = before_json .get (target , current_kb )
58
58
display_target (target , before_kb , current_kb )
59
59
print ()
60
60
You can’t perform that action at this time.
0 commit comments