diff --git a/core/primitives/src/receipt.rs b/core/primitives/src/receipt.rs index bca5f6b167c..0f07ee72249 100644 --- a/core/primitives/src/receipt.rs +++ b/core/primitives/src/receipt.rs @@ -11,6 +11,8 @@ use serde_with::serde_as; use std::borrow::Borrow; use std::fmt; +pub use near_vm_errors::DataReceiver; + /// Receipts are used for a cross-shard communication. /// Receipts could be 2 types (determined by a `ReceiptEnum`): `ReceiptEnum::Action` of `ReceiptEnum::Data`. #[derive( @@ -170,24 +172,6 @@ impl fmt::Debug for DataReceipt { } } -/// The outgoing (egress) data which will be transformed -/// to a `DataReceipt` to be sent to a `receipt.receiver` -#[derive( - BorshSerialize, - BorshDeserialize, - Hash, - Clone, - Debug, - PartialEq, - Eq, - serde::Serialize, - serde::Deserialize, -)] -pub struct DataReceiver { - pub data_id: CryptoHash, - pub receiver_id: AccountId, -} - /// A temporary data which is created by processing of DataReceipt /// stored in a state trie with a key = `account_id` + `data_id` until /// `input_data_ids` of all incoming Receipts are satisfied diff --git a/runtime/near-vm-errors/src/lib.rs b/runtime/near-vm-errors/src/lib.rs index 62c7bc96530..028a630b984 100644 --- a/runtime/near-vm-errors/src/lib.rs +++ b/runtime/near-vm-errors/src/lib.rs @@ -49,6 +49,24 @@ impl TrieNodesCount { }) } } + +/// The outgoing (egress) data which will be transformed +/// to a `DataReceipt` to be sent to a `receipt.receiver` +#[derive( + BorshSerialize, + BorshDeserialize, + Hash, + Clone, + Debug, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, +)] +pub struct DataReceiver { + pub data_id: CryptoHash, + pub receiver_id: AccountId, +} // ---------->8---------- /// For bugs in the runtime itself, crash and die is the usual response.