diff --git a/blockchain.go b/blockchain.go index af0392e..2ec2968 100644 --- a/blockchain.go +++ b/blockchain.go @@ -18,17 +18,21 @@ var blockchain []Block func GenesisBlock() Block { return Block{ - Sender: dsa.PublicKey{}, - Recipient: dsa.PublicKey{}, - Miner: dsa.PublicKey{}, - Amount: 0, - Nonce: 0, - R: big.Int{}, - S: big.Int{}, - MiningTime: 0, - Difficulty: 0, - PreviousBlockHash: [32]byte{}, - Timestamp: time.Time{}, + Sender: dsa.PublicKey{}, + Recipient: dsa.PublicKey{}, + Miner: dsa.PublicKey{}, + Amount: 0, + Nonce: 0, + SenderSignature: Signature{ + R: big.Int{}, + S: big.Int{}, + }, + MiningTime: 0, + Difficulty: 0, + PreviousBlockHash: [32]byte{}, + Timestamp: time.Time{}, + TimeVerifierSignatures: []Signature{}, + TimeVerifiers: []dsa.PublicKey{}, } } diff --git a/create_block.go b/create_block.go index ee19023..b4ab221 100644 --- a/create_block.go +++ b/create_block.go @@ -108,6 +108,7 @@ func CreateBlock(sender dsa.PublicKey, recipient dsa.PublicKey, amount float64, if err != nil { panic(err) } + fmt.Println(string(bodyBytes)) // Unmarshal the response body responseBlock := Block{} err = json.Unmarshal(bodyBytes, &responseBlock) diff --git a/verify_test.go b/verify_test.go index 8d681b6..3a5f4bc 100644 --- a/verify_test.go +++ b/verify_test.go @@ -134,8 +134,7 @@ func TestVerifyBlock(t *testing.T) { Sender: sender, Recipient: receiver, Amount: 0, - R: *r, - S: *s, + SenderSignature: Signature{R: *r, S: *s}, PreviousBlockHash: HashBlock(GenesisBlock()), Miner: key.PublicKey, Difficulty: 1,