Skip to content

Commit

Permalink
make cid optional in create-pin-msg builder
Browse files Browse the repository at this point in the history
  • Loading branch information
trusch committed Nov 28, 2024
1 parent f05d6b1 commit bb543c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl MsgCreateTaskBuilder {
#[derive(Builder)]
pub struct MsgCreatePin {
pub creator: String,
pub cid: String,
pub cid: Option<String>,
pub bytes: ByteSize,
pub name: String,
pub redundancy: u64,
Expand All @@ -168,7 +168,7 @@ impl MsgCreatePinBuilder {
.map_err(|e| Error::EncodeError(e.to_string()))?;
Ok(gevulot::MsgCreatePin {
creator: msg.creator,
cid: msg.cid,
cid: msg.cid.unwrap_or_default(),
bytes: msg.bytes.to_bytes(),
name: msg.name,
redundancy: msg.redundancy,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ mod tests {
// Create a pin
let pin_msg = builders::MsgCreatePinBuilder::default()
.creator(address.clone())
.cid("QmSWeBJYvDqKUFG3om4gsrKGf379zk8Jq5tYXpDp7Xo".to_string())
.cid(Some("QmSWeBJYvDqKUFG3om4gsrKGf379zk8Jq5tYXpDp7Xo".to_string()))
.bytes((32, Byte).into())
.time(3600)
.redundancy(1)
Expand Down

0 comments on commit bb543c8

Please sign in to comment.