@@ -589,3 +589,80 @@ func pbToExecutePluginReport(pb *ccipocr3pb.ExecutePluginReport) ccipocr3.Execut
589589 ChainReports : chainReports ,
590590 }
591591}
592+
593+ // ExtraDataCodecBundle client
594+ var _ ccipocr3.ExtraDataCodecBundle = (* extraDataCodecBundleClient )(nil )
595+
596+ type extraDataCodecBundleClient struct {
597+ * net.BrokerExt
598+ grpc ccipocr3pb.ExtraDataCodecBundleClient
599+ }
600+
601+ func NewExtraDataCodecBundleClient (broker * net.BrokerExt , cc grpc.ClientConnInterface ) ccipocr3.ExtraDataCodecBundle {
602+ return & extraDataCodecBundleClient {
603+ BrokerExt : broker ,
604+ grpc : ccipocr3pb .NewExtraDataCodecBundleClient (cc ),
605+ }
606+ }
607+
608+ func (c * extraDataCodecBundleClient ) DecodeExtraArgs (extraArgs ccipocr3.Bytes , sourceChainSelector ccipocr3.ChainSelector ) (map [string ]any , error ) {
609+ resp , err := c .grpc .DecodeExtraArgs (context .Background (), & ccipocr3pb.DecodeExtraArgsWithChainSelectorRequest {
610+ ExtraArgs : extraArgs ,
611+ SourceChainSelector : uint64 (sourceChainSelector ),
612+ })
613+ if err != nil {
614+ return nil , err
615+ }
616+ return pbMapToGoMap (resp .DecodedMap )
617+ }
618+
619+ func (c * extraDataCodecBundleClient ) DecodeTokenAmountDestExecData (destExecData ccipocr3.Bytes , sourceChainSelector ccipocr3.ChainSelector ) (map [string ]any , error ) {
620+ resp , err := c .grpc .DecodeTokenAmountDestExecData (context .Background (), & ccipocr3pb.DecodeTokenAmountDestExecDataRequest {
621+ DestExecData : destExecData ,
622+ SourceChainSelector : uint64 (sourceChainSelector ),
623+ })
624+ if err != nil {
625+ return nil , err
626+ }
627+ return pbMapToGoMap (resp .DecodedMap )
628+ }
629+
630+ // ExtraDataCodecBundle server
631+ var _ ccipocr3pb.ExtraDataCodecBundleServer = (* extraDataCodecBundleServer )(nil )
632+
633+ type extraDataCodecBundleServer struct {
634+ ccipocr3pb.UnimplementedExtraDataCodecBundleServer
635+ impl ccipocr3.ExtraDataCodecBundle
636+ }
637+
638+ func NewExtraDataCodecBundleServer (impl ccipocr3.ExtraDataCodecBundle ) ccipocr3pb.ExtraDataCodecBundleServer {
639+ return & extraDataCodecBundleServer {impl : impl }
640+ }
641+
642+ func (s * extraDataCodecBundleServer ) DecodeExtraArgs (ctx context.Context , req * ccipocr3pb.DecodeExtraArgsWithChainSelectorRequest ) (* ccipocr3pb.DecodeExtraArgsWithChainSelectorResponse , error ) {
643+ decodedMap , err := s .impl .DecodeExtraArgs (req .ExtraArgs , ccipocr3 .ChainSelector (req .SourceChainSelector ))
644+ if err != nil {
645+ return nil , err
646+ }
647+ pbMap , err := goMapToPbMap (decodedMap )
648+ if err != nil {
649+ return nil , fmt .Errorf ("failed to convert decoded map to protobuf: %w" , err )
650+ }
651+ return & ccipocr3pb.DecodeExtraArgsWithChainSelectorResponse {
652+ DecodedMap : pbMap ,
653+ }, nil
654+ }
655+
656+ func (s * extraDataCodecBundleServer ) DecodeTokenAmountDestExecData (ctx context.Context , req * ccipocr3pb.DecodeTokenAmountDestExecDataRequest ) (* ccipocr3pb.DecodeTokenAmountDestExecDataResponse , error ) {
657+ decodedMap , err := s .impl .DecodeTokenAmountDestExecData (req .DestExecData , ccipocr3 .ChainSelector (req .SourceChainSelector ))
658+ if err != nil {
659+ return nil , err
660+ }
661+ pbMap , err := goMapToPbMap (decodedMap )
662+ if err != nil {
663+ return nil , fmt .Errorf ("failed to convert decoded map to protobuf: %w" , err )
664+ }
665+ return & ccipocr3pb.DecodeTokenAmountDestExecDataResponse {
666+ DecodedMap : pbMap ,
667+ }, nil
668+ }
0 commit comments