Skip to content

Commit 47053a1

Browse files
Merge pull request #93 from ElrondNetwork/codec-empty-struct
Codec empty struct test
2 parents fd21e22 + 60e61a7 commit 47053a1

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ members = [
1010

1111
"contracts/examples/adder",
1212
"contracts/examples/adder/abi",
13-
"contracts/examples/adder/debug",
1413
"contracts/examples/crypto-bubbles",
1514
"contracts/examples/crypto-bubbles/abi",
1615
"contracts/examples/factorial",

contracts/examples/adder/debug/Cargo.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

contracts/examples/adder/debug/src/main.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
extern crate elrond_codec_derive;
2+
use elrond_codec_derive::*;
3+
4+
use elrond_codec::test_util::{check_dep_encode_decode, check_top_encode_decode};
5+
6+
#[derive(NestedEncode, NestedDecode, TopEncode, TopDecode, PartialEq, Clone, Debug)]
7+
pub struct EmptyStruct1;
8+
9+
#[derive(NestedEncode, NestedDecode, TopEncode, TopDecode, PartialEq, Clone, Debug)]
10+
pub struct EmptyStruct2 {}
11+
12+
#[test]
13+
fn empty_struct_test() {
14+
check_top_encode_decode(EmptyStruct1, &[]);
15+
check_dep_encode_decode(EmptyStruct1, &[]);
16+
17+
check_top_encode_decode(EmptyStruct2 {}, &[]);
18+
check_dep_encode_decode(EmptyStruct2 {}, &[]);
19+
}

0 commit comments

Comments
 (0)