Cleanup redundant AsFixedBytes and FixedLength traits (#3131)

* no need for AsFixedBytes we can just use AsRef<[u8]>

* cleanup FixedLength trait

* revert this change for now

* fix store tests

* cleanup and fix tests after rebase

* fix tests

* update based on PR review
less hard-coded values now

* cleanup
This commit is contained in:
Antioch Peverell
2020-01-29 13:41:50 +00:00
committed by GitHub
parent 83a2649946
commit 616dad43fd
15 changed files with 112 additions and 265 deletions
+5 -5
View File
@@ -22,7 +22,7 @@ use grin_core::libtx::{
reward,
};
use grin_core::pow::Difficulty;
use grin_core::ser::{self, FixedLength, PMMRable, Readable, Reader, Writeable, Writer};
use grin_core::ser::{self, PMMRable, Readable, Reader, Writeable, Writer};
use keychain::{Identifier, Keychain};
// utility producing a transaction with 2 inputs and a single outputs
@@ -133,16 +133,16 @@ pub struct TestElem(pub [u32; 4]);
impl DefaultHashable for TestElem {}
impl FixedLength for TestElem {
const LEN: usize = 16;
}
impl PMMRable for TestElem {
type E = Self;
fn as_elmt(&self) -> Self::E {
self.clone()
}
fn elmt_size() -> Option<u16> {
Some(16)
}
}
impl Writeable for TestElem {