2019-11-23 17:57:05 +00:00
|
|
|
package gethbridge
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/status-im/status-go/eth-node/types"
|
2020-01-13 19:17:30 +00:00
|
|
|
"github.com/status-im/status-go/waku"
|
2019-12-09 10:36:14 +00:00
|
|
|
"github.com/status-im/status-go/whisper/v6"
|
2019-11-23 17:57:05 +00:00
|
|
|
)
|
|
|
|
|
2020-01-13 19:17:30 +00:00
|
|
|
// NewWhisperMailServerResponseWrapper returns a types.MailServerResponse object that mimics Geth's MailServerResponse
|
|
|
|
func NewWhisperMailServerResponseWrapper(mailServerResponse *whisper.MailServerResponse) *types.MailServerResponse {
|
|
|
|
if mailServerResponse == nil {
|
|
|
|
panic("mailServerResponse should not be nil")
|
|
|
|
}
|
|
|
|
|
|
|
|
return &types.MailServerResponse{
|
|
|
|
LastEnvelopeHash: types.Hash(mailServerResponse.LastEnvelopeHash),
|
|
|
|
Cursor: mailServerResponse.Cursor,
|
|
|
|
Error: mailServerResponse.Error,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewWakuMailServerResponseWrapper returns a types.MailServerResponse object that mimics Geth's MailServerResponse
|
|
|
|
func NewWakuMailServerResponseWrapper(mailServerResponse *waku.MailServerResponse) *types.MailServerResponse {
|
2019-11-23 17:57:05 +00:00
|
|
|
if mailServerResponse == nil {
|
|
|
|
panic("mailServerResponse should not be nil")
|
|
|
|
}
|
|
|
|
|
|
|
|
return &types.MailServerResponse{
|
|
|
|
LastEnvelopeHash: types.Hash(mailServerResponse.LastEnvelopeHash),
|
|
|
|
Cursor: mailServerResponse.Cursor,
|
|
|
|
Error: mailServerResponse.Error,
|
|
|
|
}
|
|
|
|
}
|