Skip to content

Commit

Permalink
feat: allow CBOR events (#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg authored Jan 31, 2024
1 parent 0bbb3a0 commit b9b4540
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fvm/src/kernel/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::path::PathBuf;
use anyhow::{anyhow, Context as _};
use cid::Cid;
use fvm_ipld_blockstore::Blockstore;
use fvm_ipld_encoding::IPLD_RAW;
use fvm_ipld_encoding::{CBOR, IPLD_RAW};
use fvm_shared::address::Payload;
use fvm_shared::crypto::signature;
use fvm_shared::error::ErrorNumber;
Expand Down Expand Up @@ -1024,11 +1024,11 @@ where
.context("event entry value out of range")
.or_illegal_argument()?;

// Check the codec. We currently only allow IPLD_RAW.
if header.codec != IPLD_RAW {
// Check the codec. We currently only allow IPLD_RAW or CBOR.
if header.codec != IPLD_RAW && header.codec != CBOR {
let tmp = header.codec;
return Err(
syscall_error!(IllegalCodec; "event codec must be IPLD_RAW, was: {}", tmp)
syscall_error!(IllegalCodec; "event codec must be IPLD_RAW or CBOR, was: {}", tmp)
.into(),
);
}
Expand Down

0 comments on commit b9b4540

Please sign in to comment.