diff --git a/Makefile b/Makefile index 38f78d776..c41b367bf 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ mock: ##@other Regenerate mocks mockgen -source=geth/common/types.go -destination=geth/common/types_mock.go -package=common mockgen -source=geth/mailservice/mailservice.go -destination=geth/mailservice/mailservice_mock.go -package=mailservice mockgen -source=geth/common/notification.go -destination=geth/common/notification_mock.go -package=common -imports fcm=github.com/NaySoftware/go-fcm - mockgen -source=geth/notification/fcm/client.go -destination=geth/notification/fcm/client_mock.go -package=fcm -imports fcm=github.com/NaySoftware/go-fcm + mockgen -source=geth/notifications/push/fcm/client.go -destination=geth/notifications/push/fcm/client_mock.go -package=fcm -imports fcm=github.com/NaySoftware/go-fcm mockgen -source=geth/transactions/fake/txservice.go -destination=geth/transactions/fake/mock.go -package=fake docker-test: ##@tests Run tests in a docker container with golang. diff --git a/geth/notifications/push/fcm/client_mock.go b/geth/notifications/push/fcm/client_mock.go index 3d80c7560..428775205 100644 --- a/geth/notifications/push/fcm/client_mock.go +++ b/geth/notifications/push/fcm/client_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: geth/notification/fcm/client.go +// Source: geth/notifications/push/fcm/client.go // Package fcm is a generated GoMock package. package fcm diff --git a/static/bindata.go b/static/bindata.go index 4b5c0f7d2..ca5c0d266 100644 --- a/static/bindata.go +++ b/static/bindata.go @@ -1,4 +1,4 @@ -// Code generated by go-bindata. +// Code generated by go-bindata. DO NOT EDIT. // sources: // scripts/README.md // scripts/web3.js @@ -7,6 +7,7 @@ // config/status-chain-accounts.json // config/status-chain-genesis.json // config/test-data.json +// keys/bootnode.key // keys/firebaseauthkey // keys/test-account1-status-chain.pk // keys/test-account1.pk @@ -21,13 +22,13 @@ // testdata/jail/tx-send/no-message-id-or-context.js // testdata/jail/tx-send/tx-send.js // testdata/node/test.sol -// DO NOT EDIT! package static import ( "bytes" "compress/gzip" + "crypto/sha256" "fmt" "io" "io/ioutil" @@ -58,8 +59,9 @@ func bindataRead(data []byte, name string) ([]byte, error) { } type asset struct { - bytes []byte - info os.FileInfo + bytes []byte + info os.FileInfo + digest [sha256.Size]byte } type bindataFileInfo struct { @@ -103,8 +105,8 @@ func scriptsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "scripts/README.md", size: 133, mode: os.FileMode(420), modTime: time.Unix(1503936425, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "scripts/README.md", size: 133, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x23, 0x94, 0xc, 0xba, 0xac, 0xa8, 0xe3, 0xd0, 0xbb, 0xdd, 0x6e, 0xd7, 0xd8, 0x67, 0x6a, 0x76, 0x72, 0x7c, 0x80, 0xd8, 0xdd, 0xf5, 0xd2, 0xf8, 0x20, 0xe8, 0x50, 0xb6, 0x4e, 0xd2, 0xc8, 0xf8}} return a, nil } @@ -123,8 +125,8 @@ func scriptsWeb3Js() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "scripts/web3.js", size: 497689, mode: os.FileMode(420), modTime: time.Unix(1513019268, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "scripts/web3.js", size: 497689, mode: os.FileMode(436), modTime: time.Unix(1519298311, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdb, 0x1a, 0xf9, 0x11, 0xef, 0xf0, 0xce, 0x2d, 0xd1, 0xfc, 0xd, 0x24, 0x5d, 0x1, 0x25, 0x55, 0xbf, 0x9a, 0x59, 0x92, 0x55, 0x21, 0xa5, 0xf5, 0xb4, 0xf0, 0x9c, 0xd7, 0x90, 0xe3, 0xe8, 0x48}} return a, nil } @@ -143,8 +145,8 @@ func configChtJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/cht.json", size: 7006, mode: os.FileMode(420), modTime: time.Unix(1513019260, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "config/cht.json", size: 7006, mode: os.FileMode(436), modTime: time.Unix(1516097139, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7a, 0x7d, 0x0, 0xd4, 0xf3, 0x67, 0x5c, 0xd7, 0xd, 0xf8, 0x83, 0x9e, 0x27, 0x79, 0xbc, 0x66, 0xf3, 0xc9, 0x19, 0x95, 0x7b, 0x4c, 0x5c, 0xbd, 0x3a, 0x9c, 0xfe, 0x74, 0x3b, 0x32, 0xc5, 0xf5}} return a, nil } @@ -163,8 +165,8 @@ func configPublicChainAccountsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/public-chain-accounts.json", size: 165, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "config/public-chain-accounts.json", size: 165, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf6, 0xa7, 0xf7, 0xe4, 0xdd, 0x94, 0xb2, 0x97, 0x99, 0x13, 0xd1, 0xc0, 0x5f, 0xf9, 0x63, 0x13, 0x14, 0xc0, 0xe1, 0xde, 0x56, 0x3f, 0x14, 0x1b, 0x37, 0xf1, 0x87, 0x5d, 0xda, 0xc8, 0xd4, 0x1c}} return a, nil } @@ -183,8 +185,8 @@ func configStatusChainAccountsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/status-chain-accounts.json", size: 330, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "config/status-chain-accounts.json", size: 330, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3d, 0x4a, 0x37, 0x3b, 0x7f, 0xee, 0x4b, 0x1b, 0x5, 0x9e, 0xc5, 0x5d, 0xbf, 0x31, 0x12, 0xf5, 0xa, 0xd2, 0xcf, 0xec, 0xee, 0xe4, 0x90, 0x42, 0x5, 0xba, 0x71, 0xce, 0x84, 0x98, 0xd1, 0xd6}} return a, nil } @@ -203,8 +205,8 @@ func configStatusChainGenesisJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/status-chain-genesis.json", size: 612, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "config/status-chain-genesis.json", size: 612, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb, 0xf0, 0xc, 0x1, 0x95, 0x65, 0x6, 0x55, 0x48, 0x8f, 0x83, 0xa0, 0xb4, 0x81, 0xda, 0xad, 0x30, 0x6d, 0xb2, 0x78, 0x1b, 0x26, 0x4, 0x13, 0x12, 0x9, 0x6, 0xae, 0x3a, 0x2c, 0x1, 0x71}} return a, nil } @@ -223,8 +225,28 @@ func configTestDataJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/test-data.json", size: 84, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "config/test-data.json", size: 84, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xce, 0x9d, 0x80, 0xf5, 0x87, 0xfa, 0x57, 0x1d, 0xa1, 0xd5, 0x7a, 0x10, 0x3, 0xac, 0xd7, 0xf4, 0x64, 0x32, 0x96, 0x2b, 0xb7, 0x21, 0xb7, 0xa6, 0x80, 0x40, 0xe9, 0x65, 0xe3, 0xd6, 0xbd, 0x40}} + return a, nil +} + +var _keysBootnodeKey = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\x4b\x01\x80\x40\x08\x04\xd0\xbb\x69\x58\x96\x6f\x1c\x66\x94\xfe\x11\x7c\xbe\x65\xab\x03\x07\x43\x1b\x87\x5b\x17\x8e\x9e\x23\x02\x11\x1a\x57\x51\x9d\x32\xf7\x24\x99\x1b\x08\xd8\xcb\xcf\x2d\xf4\xba\x3e\x7f\x00\x00\x00\xff\xff\x4a\x3d\x56\xc6\x41\x00\x00\x00") + +func keysBootnodeKeyBytes() ([]byte, error) { + return bindataRead( + _keysBootnodeKey, + "keys/bootnode.key", + ) +} + +func keysBootnodeKey() (*asset, error) { + bytes, err := keysBootnodeKeyBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "keys/bootnode.key", size: 65, mode: os.FileMode(436), modTime: time.Unix(1517849813, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x31, 0xcf, 0x27, 0xd4, 0x96, 0x2e, 0x32, 0xcd, 0x58, 0x96, 0x2a, 0xe5, 0x8c, 0xa0, 0xf1, 0x73, 0x1f, 0xd6, 0xd6, 0x8b, 0xb, 0x73, 0xd3, 0x2c, 0x84, 0x1a, 0x56, 0xa4, 0x74, 0xb6, 0x95, 0x20}} return a, nil } @@ -243,8 +265,8 @@ func keysFirebaseauthkey() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/firebaseauthkey", size: 153, mode: os.FileMode(420), modTime: time.Unix(1503936425, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "keys/firebaseauthkey", size: 153, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe, 0x69, 0x23, 0x64, 0x7d, 0xf9, 0x14, 0x37, 0x6f, 0x2b, 0x1, 0xf0, 0xb0, 0xa4, 0xb2, 0xd0, 0x18, 0xcd, 0xf9, 0xeb, 0x57, 0xa3, 0xfd, 0x79, 0x25, 0xa7, 0x9c, 0x3, 0xce, 0x26, 0xec, 0xe1}} return a, nil } @@ -263,8 +285,8 @@ func keysTestAccount1StatusChainPk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account1-status-chain.pk", size: 489, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "keys/test-account1-status-chain.pk", size: 489, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8f, 0xba, 0x35, 0x1, 0x2b, 0x9d, 0xad, 0xf0, 0x2d, 0x3c, 0x4d, 0x6, 0xb5, 0x22, 0x2, 0x47, 0xd4, 0x1c, 0xf4, 0x31, 0x2f, 0xb, 0x5b, 0x27, 0x5d, 0x43, 0x97, 0x58, 0x2d, 0xf0, 0xe1, 0xbe}} return a, nil } @@ -283,8 +305,8 @@ func keysTestAccount1Pk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account1.pk", size: 491, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "keys/test-account1.pk", size: 491, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9, 0x43, 0xc2, 0xf4, 0x8c, 0xc6, 0x64, 0x25, 0x8c, 0x7, 0x8c, 0xa8, 0x89, 0x2b, 0x7b, 0x9b, 0x4f, 0x81, 0xcb, 0xce, 0x3d, 0xef, 0x82, 0x9c, 0x27, 0x27, 0xa9, 0xc5, 0x46, 0x70, 0x30, 0x38}} return a, nil } @@ -303,8 +325,8 @@ func keysTestAccount2StatusChainPk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account2-status-chain.pk", size: 489, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "keys/test-account2-status-chain.pk", size: 489, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9, 0xf8, 0x5c, 0xe9, 0x92, 0x96, 0x2d, 0x88, 0x2b, 0x8e, 0x42, 0x3f, 0xa4, 0x93, 0x6c, 0xad, 0xe9, 0xc0, 0x1b, 0x8a, 0x8, 0x8c, 0x5e, 0x7a, 0x84, 0xa2, 0xf, 0x9f, 0x77, 0x58, 0x2c, 0x2c}} return a, nil } @@ -323,8 +345,8 @@ func keysTestAccount2Pk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account2.pk", size: 491, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "keys/test-account2.pk", size: 491, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x72, 0xd5, 0x95, 0x5c, 0x5a, 0x99, 0x9d, 0x2f, 0x21, 0x83, 0xd7, 0x10, 0x17, 0x4a, 0x3d, 0x65, 0xc9, 0x26, 0x1a, 0x2c, 0x9d, 0x65, 0x63, 0xd2, 0xa0, 0xfc, 0x7c, 0x0, 0x87, 0x38, 0x9f}} return a, nil } @@ -343,8 +365,8 @@ func keysTestAccount3BeforeEip55Pk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account3-before-eip55.pk", size: 489, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "keys/test-account3-before-eip55.pk", size: 489, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x40, 0x56, 0xc1, 0x5e, 0x10, 0x6e, 0x28, 0x15, 0x3, 0x4e, 0xc4, 0xc4, 0x71, 0x4d, 0x16, 0x99, 0xcc, 0x1b, 0x63, 0xee, 0x10, 0x20, 0xe4, 0x59, 0x52, 0x3f, 0xc0, 0xad, 0x15, 0x13, 0x72}} return a, nil } @@ -363,8 +385,8 @@ func keysWnodepassword() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/wnodepassword", size: 21, mode: os.FileMode(420), modTime: time.Unix(1512994626, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "keys/wnodepassword", size: 21, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x94, 0x4b, 0xc5, 0xc1, 0xf, 0x43, 0x6b, 0xab, 0xa2, 0x7d, 0x66, 0xae, 0xf8, 0x31, 0x63, 0xd0, 0x7b, 0xec, 0x4d, 0xd6, 0x91, 0x2, 0x29, 0x12, 0x9b, 0x43, 0x43, 0xba, 0x6a, 0x84, 0x4f, 0x25}} return a, nil } @@ -383,8 +405,8 @@ func testdataJailCommandsJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "testdata/jail/commands.js", size: 7677, mode: os.FileMode(420), modTime: time.Unix(1504624601, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "testdata/jail/commands.js", size: 7677, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4a, 0x74, 0x1c, 0xb8, 0xbc, 0x8f, 0x6, 0xd3, 0x3f, 0x2d, 0x3f, 0xde, 0xe2, 0x1c, 0xb7, 0x96, 0x13, 0x2a, 0x43, 0xe5, 0xdf, 0xa1, 0x4a, 0xb9, 0xda, 0xa1, 0x36, 0x69, 0x7d, 0xbb, 0x2c, 0x3a}} return a, nil } @@ -403,8 +425,8 @@ func testdataJailStatusJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "testdata/jail/status.js", size: 3402, mode: os.FileMode(420), modTime: time.Unix(1504624601, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "testdata/jail/status.js", size: 3402, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x35, 0x35, 0xca, 0xeb, 0xac, 0x18, 0xe2, 0x16, 0x7f, 0xaa, 0x34, 0x9c, 0xcd, 0xb2, 0x5a, 0x39, 0xc3, 0x5, 0xb8, 0x30, 0x81, 0x39, 0x9f, 0x15, 0x2d, 0x14, 0x1a, 0xef, 0x4e, 0x41, 0x65, 0xaa}} return a, nil } @@ -423,8 +445,8 @@ func testdataJailTxSendContextNoMessageIdJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "testdata/jail/tx-send/context-no-message-id.js", size: 1793, mode: os.FileMode(420), modTime: time.Unix(1504624601, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "testdata/jail/tx-send/context-no-message-id.js", size: 1793, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7d, 0x5f, 0x44, 0x87, 0xd0, 0x35, 0x3c, 0xe, 0xc3, 0x4c, 0xc8, 0x7f, 0x1a, 0x64, 0x92, 0xa, 0x8e, 0x4a, 0xd3, 0x73, 0x59, 0xe0, 0x9b, 0xd2, 0xa2, 0x2b, 0xd4, 0xa9, 0x25, 0xaf, 0xbb, 0x7b}} return a, nil } @@ -443,8 +465,8 @@ func testdataJailTxSendMessageIdNoContextJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "testdata/jail/tx-send/message-id-no-context.js", size: 1875, mode: os.FileMode(420), modTime: time.Unix(1504624601, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "testdata/jail/tx-send/message-id-no-context.js", size: 1875, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2, 0xcd, 0x94, 0x54, 0xf5, 0xc0, 0x62, 0x7c, 0x17, 0xa8, 0x2b, 0xf4, 0xf2, 0x87, 0x4f, 0x3d, 0x5d, 0xb9, 0x59, 0x8f, 0x13, 0xe4, 0xac, 0xb1, 0xd5, 0xfa, 0x29, 0x93, 0xbe, 0x45, 0x3, 0x4f}} return a, nil } @@ -463,8 +485,8 @@ func testdataJailTxSendNoMessageIdOrContextJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "testdata/jail/tx-send/no-message-id-or-context.js", size: 1354, mode: os.FileMode(420), modTime: time.Unix(1504624601, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "testdata/jail/tx-send/no-message-id-or-context.js", size: 1354, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0x1d, 0xcc, 0x30, 0x33, 0xc2, 0x4a, 0xc1, 0x4c, 0x8c, 0x9d, 0x58, 0x47, 0x3a, 0x24, 0x36, 0xbb, 0x33, 0xec, 0x80, 0x7e, 0xb5, 0xc5, 0x91, 0x24, 0xf5, 0xe, 0x81, 0xc7, 0x83, 0xf, 0x19}} return a, nil } @@ -483,8 +505,8 @@ func testdataJailTxSendTxSendJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "testdata/jail/tx-send/tx-send.js", size: 3343, mode: os.FileMode(420), modTime: time.Unix(1512651934, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "testdata/jail/tx-send/tx-send.js", size: 3343, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb1, 0xf8, 0x43, 0xf2, 0x8a, 0x6d, 0x84, 0x5, 0x3, 0xe8, 0xb2, 0x3, 0x66, 0x98, 0x4, 0xbe, 0x81, 0xc6, 0x83, 0xfd, 0x13, 0xd5, 0xa6, 0x30, 0x36, 0x34, 0x34, 0xb7, 0x4e, 0x5c, 0xf0, 0x29}} return a, nil } @@ -503,8 +525,8 @@ func testdataNodeTestSol() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "testdata/node/test.sol", size: 119, mode: os.FileMode(420), modTime: time.Unix(1504624601, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "testdata/node/test.sol", size: 119, mode: os.FileMode(436), modTime: time.Unix(1515152500, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1e, 0x9f, 0x45, 0xd8, 0xc3, 0xbb, 0xe2, 0x33, 0x7a, 0x78, 0x38, 0x99, 0x70, 0x6c, 0x53, 0xea, 0x3e, 0x2c, 0xd0, 0x1d, 0x7e, 0x6, 0x71, 0xb7, 0xc0, 0x27, 0x61, 0x2, 0xbe, 0xba, 0xe3, 0x15}} return a, nil } @@ -512,8 +534,8 @@ func testdataNodeTestSol() (*asset, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) @@ -523,6 +545,12 @@ func Asset(name string) ([]byte, error) { return nil, fmt.Errorf("Asset %s not found", name) } +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + // MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables. func MustAsset(name string) []byte { @@ -534,12 +562,18 @@ func MustAsset(name string) []byte { return a } +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + // AssetInfo loads and returns the asset info for the given name. // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) @@ -549,6 +583,33 @@ func AssetInfo(name string) (os.FileInfo, error) { return nil, fmt.Errorf("AssetInfo %s not found", name) } +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) @@ -561,25 +622,47 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ "scripts/README.md": scriptsReadmeMd, + "scripts/web3.js": scriptsWeb3Js, + "config/cht.json": configChtJson, + "config/public-chain-accounts.json": configPublicChainAccountsJson, + "config/status-chain-accounts.json": configStatusChainAccountsJson, + "config/status-chain-genesis.json": configStatusChainGenesisJson, + "config/test-data.json": configTestDataJson, + + "keys/bootnode.key": keysBootnodeKey, + "keys/firebaseauthkey": keysFirebaseauthkey, + "keys/test-account1-status-chain.pk": keysTestAccount1StatusChainPk, + "keys/test-account1.pk": keysTestAccount1Pk, + "keys/test-account2-status-chain.pk": keysTestAccount2StatusChainPk, + "keys/test-account2.pk": keysTestAccount2Pk, + "keys/test-account3-before-eip55.pk": keysTestAccount3BeforeEip55Pk, + "keys/wnodepassword": keysWnodepassword, + "testdata/jail/commands.js": testdataJailCommandsJs, + "testdata/jail/status.js": testdataJailStatusJs, + "testdata/jail/tx-send/context-no-message-id.js": testdataJailTxSendContextNoMessageIdJs, + "testdata/jail/tx-send/message-id-no-context.js": testdataJailTxSendMessageIdNoContextJs, + "testdata/jail/tx-send/no-message-id-or-context.js": testdataJailTxSendNoMessageIdOrContextJs, + "testdata/jail/tx-send/tx-send.js": testdataJailTxSendTxSendJs, + "testdata/node/test.sol": testdataNodeTestSol, } @@ -592,15 +675,15 @@ var _bindata = map[string]func() (*asset, error){ // img/ // a.png // b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -622,36 +705,38 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ "config": &bintree{nil, map[string]*bintree{ - "cht.json": &bintree{configChtJson, map[string]*bintree{}}, + "cht.json": &bintree{configChtJson, map[string]*bintree{}}, "public-chain-accounts.json": &bintree{configPublicChainAccountsJson, map[string]*bintree{}}, "status-chain-accounts.json": &bintree{configStatusChainAccountsJson, map[string]*bintree{}}, - "status-chain-genesis.json": &bintree{configStatusChainGenesisJson, map[string]*bintree{}}, - "test-data.json": &bintree{configTestDataJson, map[string]*bintree{}}, + "status-chain-genesis.json": &bintree{configStatusChainGenesisJson, map[string]*bintree{}}, + "test-data.json": &bintree{configTestDataJson, map[string]*bintree{}}, }}, "keys": &bintree{nil, map[string]*bintree{ - "firebaseauthkey": &bintree{keysFirebaseauthkey, map[string]*bintree{}}, + "bootnode.key": &bintree{keysBootnodeKey, map[string]*bintree{}}, + "firebaseauthkey": &bintree{keysFirebaseauthkey, map[string]*bintree{}}, "test-account1-status-chain.pk": &bintree{keysTestAccount1StatusChainPk, map[string]*bintree{}}, - "test-account1.pk": &bintree{keysTestAccount1Pk, map[string]*bintree{}}, + "test-account1.pk": &bintree{keysTestAccount1Pk, map[string]*bintree{}}, "test-account2-status-chain.pk": &bintree{keysTestAccount2StatusChainPk, map[string]*bintree{}}, - "test-account2.pk": &bintree{keysTestAccount2Pk, map[string]*bintree{}}, + "test-account2.pk": &bintree{keysTestAccount2Pk, map[string]*bintree{}}, "test-account3-before-eip55.pk": &bintree{keysTestAccount3BeforeEip55Pk, map[string]*bintree{}}, - "wnodepassword": &bintree{keysWnodepassword, map[string]*bintree{}}, + "wnodepassword": &bintree{keysWnodepassword, map[string]*bintree{}}, }}, "scripts": &bintree{nil, map[string]*bintree{ "README.md": &bintree{scriptsReadmeMd, map[string]*bintree{}}, - "web3.js": &bintree{scriptsWeb3Js, map[string]*bintree{}}, + "web3.js": &bintree{scriptsWeb3Js, map[string]*bintree{}}, }}, "testdata": &bintree{nil, map[string]*bintree{ "jail": &bintree{nil, map[string]*bintree{ "commands.js": &bintree{testdataJailCommandsJs, map[string]*bintree{}}, - "status.js": &bintree{testdataJailStatusJs, map[string]*bintree{}}, + "status.js": &bintree{testdataJailStatusJs, map[string]*bintree{}}, "tx-send": &bintree{nil, map[string]*bintree{ - "context-no-message-id.js": &bintree{testdataJailTxSendContextNoMessageIdJs, map[string]*bintree{}}, - "message-id-no-context.js": &bintree{testdataJailTxSendMessageIdNoContextJs, map[string]*bintree{}}, + "context-no-message-id.js": &bintree{testdataJailTxSendContextNoMessageIdJs, map[string]*bintree{}}, + "message-id-no-context.js": &bintree{testdataJailTxSendMessageIdNoContextJs, map[string]*bintree{}}, "no-message-id-or-context.js": &bintree{testdataJailTxSendNoMessageIdOrContextJs, map[string]*bintree{}}, - "tx-send.js": &bintree{testdataJailTxSendTxSendJs, map[string]*bintree{}}, + "tx-send.js": &bintree{testdataJailTxSendTxSendJs, map[string]*bintree{}}, }}, }}, "node": &bintree{nil, map[string]*bintree{ @@ -660,7 +745,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ }}, }} -// RestoreAsset restores an asset under the given directory +// RestoreAsset restores an asset under the given directory. func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { @@ -678,14 +763,10 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) } -// RestoreAssets restores an asset under the given directory recursively +// RestoreAssets restores an asset under the given directory recursively. func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File @@ -703,7 +784,6 @@ func RestoreAssets(dir, name string) error { } func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) } -