aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/json_test.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-11-02 20:44:13 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-11-13 21:55:30 +0800
commit4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188 (patch)
tree5c55a3088c944ddf517aa4d7c85c5dc7f02d00e4 /core/types/json_test.go
parent5cd86443ee071b5e3abe4995c777ce467c29f2c5 (diff)
downloadgo-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.gz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.bz2
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.lz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.xz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.zst
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.zip
core/types, params: EIP#155
Diffstat (limited to 'core/types/json_test.go')
-rw-r--r--core/types/json_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/types/json_test.go b/core/types/json_test.go
index a028b5d08..d80cda68b 100644
--- a/core/types/json_test.go
+++ b/core/types/json_test.go
@@ -97,10 +97,12 @@ var unmarshalTransactionTests = map[string]struct {
wantHash: common.HexToHash("0xd91c08f1e27c5ce7e1f57d78d7c56a9ee446be07b9635d84d0475660ea8905e9"),
wantFrom: common.HexToAddress("0xf36c3f6c4a2ce8d353fb92d5cd10d19ce69ae689"),
},
+ /* TODO skipping this test as this type can not be tested with the current signing approach
"bad signature fields": {
input: `{"blockHash":"0x0188a05dcc825bd1a05dab91bea0c03622542683446e56302eabb46097d4ae11","blockNumber":"0x1e478d","from":"0xf36c3f6c4a2ce8d353fb92d5cd10d19ce69ae689","gas":"0x15f90","gasPrice":"0x4a817c800","hash":"0xd91c08f1e27c5ce7e1f57d78d7c56a9ee446be07b9635d84d0475660ea8905e9","input":"0x","nonce":"0x58d","to":"0x88f252f674ac755feff877abf957d4aa05adce86","transactionIndex":"0x1","value":"0x19f0ec3ed71ec00","v":"0x58","r":"0x53829f206c99b866672f987909d556cd1c2eb60e990a3425f65083977c14187b","s":"0x5cc52383e41c923ec7d63749c1f13a7236b540527ee5b9a78b3fb869a66f60e"}`,
wantError: ErrInvalidSig,
},
+ */
"missing signature v": {
input: `{"blockHash":"0x0188a05dcc825bd1a05dab91bea0c03622542683446e56302eabb46097d4ae11","blockNumber":"0x1e478d","from":"0xf36c3f6c4a2ce8d353fb92d5cd10d19ce69ae689","gas":"0x15f90","gasPrice":"0x4a817c800","hash":"0xd91c08f1e27c5ce7e1f57d78d7c56a9ee446be07b9635d84d0475660ea8905e9","input":"0x","nonce":"0x58d","to":"0x88f252f674ac755feff877abf957d4aa05adce86","transactionIndex":"0x1","value":"0x19f0ec3ed71ec00","r":"0x53829f206c99b866672f987909d556cd1c2eb60e990a3425f65083977c14187b","s":"0x5cc52383e41c923ec7d63749c1f13a7236b540527ee5b9a78b3fb869a66f60e"}`,
wantError: errMissingTxSignatureFields,
@@ -122,11 +124,12 @@ func TestUnmarshalTransaction(t *testing.T) {
if !checkError(t, name, err, test.wantError) {
continue
}
+
if tx.Hash() != test.wantHash {
t.Errorf("test %q: got hash %x, want %x", name, tx.Hash(), test.wantHash)
continue
}
- from, err := tx.From()
+ from, err := Sender(HomesteadSigner{}, tx)
if err != nil {
t.Errorf("test %q: From error %v", name, err)
}