66 "testing"
77 "time"
88
9+ gethcommon "github.com/ethereum/go-ethereum/common"
910 solanasdk "github.com/gagliardetto/solana-go"
1011 "github.com/google/go-cmp/cmp"
1112 "github.com/google/go-cmp/cmp/cmpopts"
@@ -35,6 +36,8 @@ func TestBuildProposalFromBatchesV2(t *testing.T) {
3536 quarantine .Flaky (t , "DX-1824" )
3637 t .Parallel ()
3738
39+ clock := func () time.Time { return time .Date (2036 , time .December , 31 , 23 , 59 , 59 , 999999999 , time .UTC ) }
40+
3841 evmSelector := chain_selectors .TEST_90000001 .Selector
3942 solSelector := chain_selectors .TEST_22222222222222222222222222222222222222222222 .Selector
4043 programsPath , programIDs , ab := soltestutils .PreloadMCMS (t , solSelector )
@@ -92,10 +95,11 @@ func TestBuildProposalFromBatchesV2(t *testing.T) {
9295
9396 description := "Test Proposal"
9497 minDelay := 24 * time .Hour
95- solpk := solanasdk .NewWallet ().PublicKey ()
98+ solpk , err := solanasdk .WalletFromPrivateKeyBase58 ("5LfM6zhzXT8STNaCVKn8y2FXP2L3KLYn1Z4bGycNh2kz9W4yopTSR2bL587PSeJSCU8Ek6UqiTAhY3TWonJiim72" )
99+ require .NoError (t , err )
96100
97101 evmTx := types.Transaction {To : "0xRecipient1" , Data : []byte ("data1" ), AdditionalFields : json .RawMessage (`{"value": 0}` )}
98- solTx , err := solana .NewTransaction (solpk .String (), []byte ("data1" ), big .NewInt (0 ), []* solanasdk.AccountMeta {}, "" , []string {})
102+ solTx , err := solana .NewTransaction (solpk .PublicKey (). String (), []byte ("data1" ), big .NewInt (0 ), []* solanasdk.AccountMeta {}, "" , []string {})
99103 require .NoError (t , err )
100104 batches := []types.BatchOperation {
101105 {
@@ -124,7 +128,7 @@ func TestBuildProposalFromBatchesV2(t *testing.T) {
124128 BaseProposal : mcms.BaseProposal {
125129 Version : "v1" ,
126130 Kind : "TimelockProposal" ,
127- ValidUntil : 1234 ,
131+ ValidUntil : 2114639999 ,
128132 ChainMetadata : map [types.ChainSelector ]types.ChainMetadata {
129133 types .ChainSelector (evmSelector ): evmMetadata ,
130134 types .ChainSelector (solSelector ): solMetadata ,
@@ -141,8 +145,16 @@ func TestBuildProposalFromBatchesV2(t *testing.T) {
141145 return copiedAddrs
142146 }(timelockAddressPerChain ),
143147 Operations : []types.BatchOperation {
144- {ChainSelector : types .ChainSelector (evmSelector ), Transactions : []types.Transaction {evmTx }},
145- {ChainSelector : types .ChainSelector (solSelector ), Transactions : []types.Transaction {solTx }},
148+ {
149+ OperationID : gethcommon .HexToHash ("0xfd99d0c0641d26ed0e7d64c4674e58051823182216161d4b59967f98e6b888ba" ),
150+ ChainSelector : types .ChainSelector (evmSelector ),
151+ Transactions : []types.Transaction {evmTx },
152+ },
153+ {
154+ OperationID : gethcommon .HexToHash ("0x1f6e97592a5d0197b18504d909ae8e51a61cfecabb07e7b06c190a4abfa2da4b" ),
155+ ChainSelector : types .ChainSelector (solSelector ),
156+ Transactions : []types.Transaction {solTx },
157+ },
146158 },
147159 }
148160
@@ -158,21 +170,22 @@ func TestBuildProposalFromBatchesV2(t *testing.T) {
158170 name : "success: explicit inspectors" ,
159171 batches : batches ,
160172 inspectors : inspectorPerChain ,
161- options : []proposalutils.BuildProposalOption {},
173+ options : []proposalutils.BuildProposalOption {proposalutils . WithClock ( clock ) },
162174 want : wantProposal ,
163175 },
164176 {
165177 name : "success: implicit inspectors" ,
166178 batches : batches ,
167179 inspectors : nil ,
168- options : []proposalutils.BuildProposalOption {},
180+ options : []proposalutils.BuildProposalOption {proposalutils . WithClock ( clock ) },
169181 want : wantProposal ,
170182 },
171183 {
172184 name : "success: extra chain metadata" ,
173185 batches : batches ,
174186 inspectors : nil ,
175187 options : []proposalutils.BuildProposalOption {
188+ proposalutils .WithClock (clock ),
176189 proposalutils .WithChainMetadata (proposalutils.ChainMetadata {
177190 evmSelector : map [string ]any {
178191 "gasLimit" : 100 ,
@@ -190,8 +203,6 @@ func TestBuildProposalFromBatchesV2(t *testing.T) {
190203 },
191204 types .ChainSelector (solSelector ): solMetadata ,
192205 }
193- t .Logf ("PROPOSAL1.ChainMetadata: %#v" , proposal .ChainMetadata )
194- t .Logf ("WANTPROPOSAL1.ChainMetadata: %#v" , wantProposal .ChainMetadata )
195206 return & proposal
196207 }(),
197208 },
@@ -223,7 +234,7 @@ func TestBuildProposalFromBatchesV2(t *testing.T) {
223234 if tt .wantErr == "" {
224235 require .NoError (t , err )
225236 require .Empty (t , cmp .Diff (tt .want , proposal ,
226- cmpopts .IgnoreFields (mcms.BaseProposal {}, "useSimulatedBackend" , "ValidUntil" )))
237+ cmpopts .IgnoreFields (mcms.BaseProposal {}, "useSimulatedBackend" )))
227238 } else {
228239 require .Nil (t , proposal )
229240 require .ErrorContains (t , err , tt .wantErr )
0 commit comments