diff --git a/packages/model/metabundle/metabundle.go b/packages/model/metabundle/metabundle.go deleted file mode 100644 index 75a132cae7f95b67f8d3c4a715e30232ddc66911..0000000000000000000000000000000000000000 --- a/packages/model/metabundle/metabundle.go +++ /dev/null @@ -1,31 +0,0 @@ -package metabundle - -import ( - "github.com/iotaledger/goshimmer/packages/model/meta_transaction" - "github.com/iotaledger/goshimmer/packages/ternary" -) - -type MetaBundle struct { - hash ternary.Trytes - transactionHashes []ternary.Trytes -} - -func New(transactions []*meta_transaction.MetaTransaction) (result *MetaBundle) { - result = &MetaBundle{ - hash: CalculateBundleHash(transactions), - } - - return -} - -func (bundle *MetaBundle) GetTransactionHashes() []ternary.Trytes { - -} - -func (bundle *MetaBundle) GetHash() { - -} - -func CalculateBundleHash(transactions []*meta_transaction.MetaTransaction) ternary.Trytes { - return ternary.Trytes("A") -} diff --git a/packages/model/value_transaction/value_transaction.go b/packages/model/value_transaction/value_transaction.go index 37b2bfbc13ca00c671db142ead215972c8e8370d..2d9b0cd8b8f3d553e0e9684b86e11da079877ef4 100644 --- a/packages/model/value_transaction/value_transaction.go +++ b/packages/model/value_transaction/value_transaction.go @@ -37,7 +37,7 @@ func New() (result *ValueTransaction) { func FromMetaTransaction(metaTransaction *meta_transaction.MetaTransaction) *ValueTransaction { return &ValueTransaction{ MetaTransaction: metaTransaction, - trits: metaTransaction.GetData(), + trits: metaTransaction.GetData(), } } diff --git a/packages/model/valuebundle/metabundle.go b/packages/model/valuebundle/metabundle.go new file mode 100644 index 0000000000000000000000000000000000000000..18d78f6ab1cc5b0b4f6e1cb1cabde58b32ec0a82 --- /dev/null +++ b/packages/model/valuebundle/metabundle.go @@ -0,0 +1,32 @@ +package valuebundle + +import ( + "github.com/iotaledger/goshimmer/packages/model/value_transaction" + "github.com/iotaledger/goshimmer/packages/ternary" +) + +type MetaBundle struct { + hash ternary.Trytes + transactionHashes []ternary.Trytes +} + +func New(transactions []*value_transaction.ValueTransaction) (result *MetaBundle) { + result = &MetaBundle{ + hash: CalculateBundleHash(transactions), + } + + return +} + +func (bundle *MetaBundle) GetTransactionHashes() []ternary.Trytes { + return bundle.transactionHashes +} + +func (bundle *MetaBundle) GetHash() ternary.Trytes { + return bundle.hash +} + +func CalculateBundleHash(transactions []*value_transaction.ValueTransaction) ternary.Trytes { + //transactions[0].GetData()[value_transaction.SIGNATURE_MESSAGE_FRAGMENT_OFFSET] + return ternary.Trytes("A") +}