From 7cca37e951107dfc63cb57457c1c1f2ca439327e Mon Sep 17 00:00:00 2001 From: Lawliet-Chan <1576710154@qq.com> Date: Mon, 18 Nov 2024 13:44:00 +0800 Subject: [PATCH 1/2] sample kv --- core/state/sample_kv.go | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 core/state/sample_kv.go diff --git a/core/state/sample_kv.go b/core/state/sample_kv.go new file mode 100644 index 00000000..50d06803 --- /dev/null +++ b/core/state/sample_kv.go @@ -0,0 +1,72 @@ +package state + +import ( + "github.com/yu-org/yu/core/types" + "github.com/yu-org/yu/infra/storage/kv" +) + +type SampleKV struct { + kvdb kv.KV +} + +func (s *SampleKV) Set(triName NameString, key, value []byte) { + //TODO implement me + tx, _ := s.kvdb.NewKvTxn() + + panic("implement me") +} + +func (s *SampleKV) Delete(triName NameString, key []byte) { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) Get(triName NameString, key []byte) ([]byte, error) { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) GetFinalized(triName NameString, key []byte) ([]byte, error) { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) Exist(triName NameString, key []byte) bool { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) GetByBlockHash(triName NameString, key []byte, block *types.Block) ([]byte, error) { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) Commit() ([]byte, error) { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) NextTxn() { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) Discard() { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) DiscardAll() { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) StartBlock(block *types.Block) { + //TODO implement me + panic("implement me") +} + +func (s *SampleKV) FinalizeBlock(block *types.Block) { + //TODO implement me + panic("implement me") +} From 817987f76a2b672fc7780b99065700afe4eec30e Mon Sep 17 00:00:00 2001 From: Lawliet-Chan <1576710154@qq.com> Date: Mon, 18 Nov 2024 13:48:07 +0800 Subject: [PATCH 2/2] fix --- core/state/sample_kv.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/state/sample_kv.go b/core/state/sample_kv.go index 50d06803..44087267 100644 --- a/core/state/sample_kv.go +++ b/core/state/sample_kv.go @@ -11,8 +11,6 @@ type SampleKV struct { func (s *SampleKV) Set(triName NameString, key, value []byte) { //TODO implement me - tx, _ := s.kvdb.NewKvTxn() - panic("implement me") }