@@ -121,45 +121,35 @@ impl Bundle {
121
121
Ok ( b)
122
122
}
123
123
124
- pub fn create_testnode_transaction_bundle ( nonce : u64 ) -> Result < Bundle , InvalidTransaction > {
125
- // private key from pre funded dev account on test node
126
- // https://docs.arbitrum.io/run-arbitrum-node/run-local-full-chain-simulation
127
- let private_key = "b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659" ;
128
- let to_address: alloy:: primitives:: Address =
129
- address ! ( "6A568afe0f82d34759347bb36F14A6bB171d2CBe" ) ;
124
+ pub fn create_dev_acct_txn_bundle ( nonce : u64 ) -> anyhow:: Result < Bundle > {
130
125
let chain_id = 412346 ;
131
- let value = U256 :: from ( 1 ) ;
132
- let gas_limit = 21000 ;
133
- let max_fee_per_gas = 1000000000 ;
134
- let max_priority_fee_per_gas = 1000000000 ;
135
-
136
126
let mut tx = TxEip1559 {
137
127
chain_id,
138
128
nonce,
139
- max_priority_fee_per_gas,
140
- max_fee_per_gas,
141
- gas_limit,
142
- to : TxKind :: Call ( to_address ) ,
143
- value,
129
+ max_priority_fee_per_gas : 1000000000 ,
130
+ max_fee_per_gas : 1000000000 ,
131
+ gas_limit : 21000 ,
132
+ to : TxKind :: Call ( address ! ( "6A568afe0f82d34759347bb36F14A6bB171d2CBe" ) ) ,
133
+ value : U256 :: from ( 1 ) ,
144
134
input : alloy:: primitives:: Bytes :: new ( ) ,
145
135
access_list : AccessList :: default ( ) ,
146
136
} ;
147
137
148
- let signer = PrivateKeySigner :: from_str ( private_key ) . expect ( "valid private key" ) ;
149
- let signature = signer
150
- . sign_transaction_sync ( & mut tx )
151
- . expect ( "valid signature" ) ;
152
- let signed_tx = tx . into_signed ( signature ) ;
153
- let tx_envelope = TxEnvelope :: Eip1559 ( signed_tx ) ;
154
-
155
- let mut rlp_encoded = Vec :: new ( ) ;
156
- tx_envelope . encode ( & mut rlp_encoded ) ;
157
-
158
- let encoded = ssz :: ssz_encode ( & vec ! [ & rlp_encoded ] ) ;
159
-
160
- let bundle = Bundle :: new ( chain_id. into ( ) , Epoch :: now ( ) , encoded. into ( ) , false ) ;
138
+ // private key from pre funded dev account on test node
139
+ // https://docs.arbitrum.io/run-arbitrum-node/run-local-full-chain-simulation
140
+ let signer = PrivateKeySigner :: from_str (
141
+ "b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659" ,
142
+ ) ? ;
143
+ let sig = signer . sign_transaction_sync ( & mut tx ) ? ;
144
+ let signed_tx = tx . into_signed ( sig ) ;
145
+ let env = TxEnvelope :: Eip1559 ( signed_tx ) ;
146
+ let mut rlp = Vec :: new ( ) ;
147
+ env . encode ( & mut rlp ) ;
148
+
149
+ let encoded = ssz :: ssz_encode ( & vec ! [ & rlp ] ) ;
150
+ let b = Bundle :: new ( chain_id. into ( ) , Epoch :: now ( ) , encoded. into ( ) , false ) ;
161
151
162
- Ok ( bundle )
152
+ Ok ( b )
163
153
}
164
154
}
165
155
0 commit comments