浏览代码

transactionRoot -> transactionsRoot

Taylor Gerring 10 年之前
父节点
当前提交
f89baa73e5
共有 2 个文件被更改,包括 31 次插入31 次删除
  1. 3 3
      rpc/responses.go
  2. 28 28
      rpc/responses_test.go

+ 3 - 3
rpc/responses.go

@@ -16,7 +16,7 @@ type BlockRes struct {
 	Nonce           *hexdata          `json:"nonce"`
 	Sha3Uncles      *hexdata          `json:"sha3Uncles"`
 	LogsBloom       *hexdata          `json:"logsBloom"`
-	TransactionRoot *hexdata          `json:"transactionRoot"`
+	TransactionRoot *hexdata          `json:"transactionsRoot"`
 	StateRoot       *hexdata          `json:"stateRoot"`
 	Miner           *hexdata          `json:"miner"`
 	Difficulty      *hexnum           `json:"difficulty"`
@@ -40,7 +40,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
 			Nonce           *hexdata          `json:"nonce"`
 			Sha3Uncles      *hexdata          `json:"sha3Uncles"`
 			LogsBloom       *hexdata          `json:"logsBloom"`
-			TransactionRoot *hexdata          `json:"transactionRoot"`
+			TransactionRoot *hexdata          `json:"transactionsRoot"`
 			StateRoot       *hexdata          `json:"stateRoot"`
 			Miner           *hexdata          `json:"miner"`
 			Difficulty      *hexnum           `json:"difficulty"`
@@ -83,7 +83,7 @@ func (b *BlockRes) MarshalJSON() ([]byte, error) {
 			Nonce           *hexdata   `json:"nonce"`
 			Sha3Uncles      *hexdata   `json:"sha3Uncles"`
 			LogsBloom       *hexdata   `json:"logsBloom"`
-			TransactionRoot *hexdata   `json:"transactionRoot"`
+			TransactionRoot *hexdata   `json:"transactionsRoot"`
 			StateRoot       *hexdata   `json:"stateRoot"`
 			Miner           *hexdata   `json:"miner"`
 			Difficulty      *hexnum    `json:"difficulty"`

+ 28 - 28
rpc/responses_test.go

@@ -34,20 +34,20 @@ func TestNewBlockRes(t *testing.T) {
 	extra := ""
 	block := types.NewBlock(parentHash, coinbase, root, difficulty, nonce, extra)
 	tests := map[string]string{
-		"number":          reNum,
-		"hash":            reHash,
-		"parentHash":      reHash,
-		"nonce":           reData,
-		"sha3Uncles":      reHash,
-		"logsBloom":       reData,
-		"transactionRoot": reHash,
-		"stateRoot":       reHash,
-		"miner":           reAddress,
-		"difficulty":      `"0x1"`,
-		"totalDifficulty": reNum,
-		"size":            reNumNonZero,
-		"extraData":       reData,
-		"gasLimit":        reNum,
+		"number":           reNum,
+		"hash":             reHash,
+		"parentHash":       reHash,
+		"nonce":            reData,
+		"sha3Uncles":       reHash,
+		"logsBloom":        reData,
+		"transactionsRoot": reHash,
+		"stateRoot":        reHash,
+		"miner":            reAddress,
+		"difficulty":       `"0x1"`,
+		"totalDifficulty":  reNum,
+		"size":             reNumNonZero,
+		"extraData":        reData,
+		"gasLimit":         reNum,
 		// "minGasPrice":  "0x",
 		"gasUsed":   reNum,
 		"timestamp": reNum,
@@ -84,20 +84,20 @@ func TestNewBlockResWithTrans(t *testing.T) {
 	extra := ""
 	block := types.NewBlock(parentHash, coinbase, root, difficulty, nonce, extra)
 	tests := map[string]string{
-		"number":          reNum,
-		"hash":            reHash,
-		"parentHash":      reHash,
-		"nonce":           reData,
-		"sha3Uncles":      reHash,
-		"logsBloom":       reData,
-		"transactionRoot": reHash,
-		"stateRoot":       reHash,
-		"miner":           reAddress,
-		"difficulty":      `"0x1"`,
-		"totalDifficulty": reNum,
-		"size":            reNumNonZero,
-		"extraData":       reData,
-		"gasLimit":        reNum,
+		"number":           reNum,
+		"hash":             reHash,
+		"parentHash":       reHash,
+		"nonce":            reData,
+		"sha3Uncles":       reHash,
+		"logsBloom":        reData,
+		"transactionsRoot": reHash,
+		"stateRoot":        reHash,
+		"miner":            reAddress,
+		"difficulty":       `"0x1"`,
+		"totalDifficulty":  reNum,
+		"size":             reNumNonZero,
+		"extraData":        reData,
+		"gasLimit":         reNum,
 		// "minGasPrice":  "0x",
 		"gasUsed":   reNum,
 		"timestamp": reNum,