Skip to content

Commit

Permalink
constant
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Feb 8, 2024
1 parent 413f9fa commit b57d8b2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
use dep::protocol_types::traits::Serialize;

global PRIVATE_GLOBAL_VARIABLES_LENGTH: Field = 2;

// docs:start:private-global-variables
struct PrivateGlobalVariables {
chain_id: Field,
version: Field,
}
// docs:end:private-global-variables

impl Serialize<2> for PrivateGlobalVariables {
fn serialize(self) -> [Field; 2] {
impl Serialize<PRIVATE_GLOBAL_VARIABLES_LENGTH> for PrivateGlobalVariables {
fn serialize(self) -> [Field; PRIVATE_GLOBAL_VARIABLES_LENGTH] {
[self.chain_id, self.version]
}
}

0 comments on commit b57d8b2

Please sign in to comment.