-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds handling of Transaction commands.
- Loading branch information
Showing
51 changed files
with
4,424 additions
and
1,750 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package protocol | ||
|
||
import ( | ||
"crypto/ecdsa" | ||
|
||
"github.com/status-im/status-go/eth-node/crypto" | ||
"github.com/status-im/status-go/eth-node/types" | ||
"github.com/status-im/status-go/protocol/identity/alias" | ||
"github.com/status-im/status-go/protocol/identity/identicon" | ||
) | ||
|
||
func buildBasicMessage(message *Message, chat *Chat, key *ecdsa.PublicKey) error { | ||
clock, timestamp := chat.NextClockAndTimestamp() | ||
|
||
message.LocalChatID = chat.ID | ||
message.Clock = clock | ||
message.Timestamp = timestamp | ||
message.From = types.EncodeHex(crypto.FromECDSAPub(key)) | ||
message.SigPubKey = key | ||
message.WhisperTimestamp = timestamp | ||
message.Seen = true | ||
message.OutgoingStatus = OutgoingStatusSending | ||
|
||
identicon, err := identicon.GenerateBase64(message.From) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
message.Identicon = identicon | ||
|
||
alias, err := alias.GenerateFromPublicKeyString(message.From) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
message.Alias = alias | ||
return nil | ||
|
||
} |
Oops, something went wrong.