@@ -386,6 +386,73 @@ func TestGetSignatureStatusesConverters(t *testing.T) {
386386 require .Equal (t , conv .ConfirmationStatusType_CONFIRMATION_STATUS_TYPE_CONFIRMED , rep2 .Results [0 ].ConfirmationStatus )
387387}
388388
389+ func TestExternalRequestProtoRoundTrip (t * testing.T ) {
390+ t .Run ("GetAccountInfoRequest" , func (t * testing.T ) {
391+ pk := typesolana.PublicKey {}
392+ copy (pk [:], mkBytes (typesolana .PublicKeyLength , 0xAB ))
393+ d := typesolana.GetAccountInfoRequest {
394+ Account : pk ,
395+ Opts : & typesolana.GetAccountInfoOpts {
396+ Encoding : typesolana .EncodingBase64 ,
397+ Commitment : typesolana .CommitmentFinalized ,
398+ },
399+ IsExternal : true ,
400+ }
401+ pb := conv .ConvertGetAccountInfoRequestToProto (d )
402+ got , err := conv .ConvertGetAccountInfoRequestFromProto (pb )
403+ require .NoError (t , err )
404+ require .Equal (t , d , got )
405+ })
406+
407+ t .Run ("GetMultipleAccountsRequest" , func (t * testing.T ) {
408+ d := & typesolana.GetMultipleAccountsRequest {
409+ Accounts : []typesolana.PublicKey {
410+ {1 },
411+ func () (pk typesolana.PublicKey ) { copy (pk [:], mkBytes (typesolana .PublicKeyLength , 0xCD )); return pk }(),
412+ },
413+ Opts : & typesolana.GetMultipleAccountsOpts {
414+ Encoding : typesolana .EncodingJSONParsed ,
415+ Commitment : typesolana .CommitmentProcessed ,
416+ },
417+ IsExternal : true ,
418+ }
419+ pb := conv .ConvertGetMultipleAccountsRequestToProto (d )
420+ got := conv .ConvertGetMultipleAccountsRequestFromProto (pb )
421+ require .Equal (t , d .Accounts [0 ], got .Accounts [0 ])
422+ require .Equal (t , d .Accounts [1 ], got .Accounts [1 ])
423+ require .Equal (t , d .IsExternal , got .IsExternal )
424+ require .Equal (t , d .Opts , got .Opts )
425+ })
426+
427+ t .Run ("GetTransactionRequest" , func (t * testing.T ) {
428+ var sig typesolana.Signature
429+ copy (sig [:], mkBytes (typesolana .SignatureLength , 0xEF ))
430+ d := typesolana.GetTransactionRequest {Signature : sig , IsExternal : true }
431+ pb := conv .ConvertGetTransactionRequestToProto (d )
432+ got , err := conv .ConvertGetTransactionRequestFromProto (pb )
433+ require .NoError (t , err )
434+ require .Equal (t , d , got )
435+ })
436+
437+ t .Run ("SimulateTXRequest" , func (t * testing.T ) {
438+ var recv typesolana.PublicKey
439+ copy (recv [:], mkBytes (typesolana .PublicKeyLength , 0x11 ))
440+ d := typesolana.SimulateTXRequest {
441+ Receiver : recv ,
442+ EncodedTransaction : "txdata" ,
443+ Opts : & typesolana.SimulateTXOpts {
444+ SigVerify : true ,
445+ Commitment : typesolana .CommitmentConfirmed ,
446+ },
447+ IsExternal : true ,
448+ }
449+ pb := conv .ConvertSimulateTXRequestToProto (d )
450+ got , err := conv .ConvertSimulateTXRequestFromProto (pb )
451+ require .NoError (t , err )
452+ require .Equal (t , d , got )
453+ })
454+ }
455+
389456func TestErrorJoinBehavior_PublicKeys (t * testing.T ) {
390457 in := [][]byte {
391458 mkBytes (typesolana .PublicKeyLength - 1 , 0x01 ),
0 commit comments