MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / new_secp256k1

Method new_secp256k1

fendermint/vm/message/src/signed.rs:77–88  ·  view source on GitHub ↗

Create a signed message.

(
        message: Message,
        sk: &SecretKey,
        chain_id: &ChainID,
    )

Source from the content-addressed store, hash-verified

75
76 /// Create a signed message.
77 pub fn new_secp256k1(
78 message: Message,
79 sk: &SecretKey,
80 chain_id: &ChainID,
81 ) -> Result<Self, SignedMessageError> {
82 let signature = match Self::signable(&message, chain_id)? {
83 Signable::Ethereum((hash, _)) => sign_eth(sk, hash),
84 Signable::Regular(data) => sign_regular(sk, &data),
85 Signable::RegularFromEth((data, _)) => sign_regular(sk, &data),
86 };
87 Ok(Self { message, signature })
88 }
89
90 /// Calculate the CID of an FVM message.
91 pub fn cid(message: &Message) -> Result<Cid, fvm_ipld_encoding::Error> {

Callers

nothing calls this directly

Calls 2

sign_ethFunction · 0.85
sign_regularFunction · 0.85

Tested by

no test coverage detected