Skip to content

Commit c886c95

Browse files
fjlcooganb
authored andcommitted
all: update generated code (#15808)
* core/types, core/vm, eth, tests: regenerate gencodec files * Makefile: update devtools target Install protoc-gen-go and print reminders about npm, solc and protoc. Also switch to github.com/kevinburke/go-bindata because it's more maintained. * contracts/ens: update contracts and regenerate with solidity v0.4.19 The newer upstream version of the FIFSRegistrar contract doesn't set the resolver anymore. The resolver is now deployed separately. * contracts/release: regenerate with solidity v0.4.19 * contracts/chequebook: fix fallback and regenerate with solidity v0.4.19 The contract didn't have a fallback function, payments would be rejected when compiled with newer solidity. References to 'mortal' and 'owned' use the local file system so we can compile without network access. * p2p/discv5: regenerate with recent stringer * cmd/faucet: regenerate * dashboard: regenerate * eth/tracers: regenerate * internal/jsre/deps: regenerate * dashboard: avoid sed -i because it's not portable * accounts/usbwallet/internal/trezor: fix go generate warnings
1 parent a5fe5cc commit c886c95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2086
-1378
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ clean:
4545

4646
devtools:
4747
env GOBIN= go get -u golang.org/x/tools/cmd/stringer
48-
env GOBIN= go get -u github.com/jteeuwen/go-bindata/go-bindata
48+
env GOBIN= go get -u github.com/kevinburke/go-bindata/go-bindata
4949
env GOBIN= go get -u github.com/fjl/gencodec
50+
env GOBIN= go get -u github.com/golang/protobuf/protoc-gen-go
5051
env GOBIN= go install ./cmd/abigen
52+
@type "npm" 2> /dev/null || echo 'Please install node.js and npm'
53+
@type "solc" 2> /dev/null || echo 'Please install solc'
54+
@type "protoc" 2> /dev/null || echo 'Please install protoc'
5155

5256
# Cross Compilation Targets (xgo)
5357

accounts/usbwallet/internal/trezor/messages.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// https://github.com/trezor/trezor-common/blob/master/protob/messages.proto
33
// dated 28.07.2017, commit dd8ec3231fb5f7992360aff9bdfe30bb58130f4b.
44

5+
syntax = "proto2";
6+
57
/**
68
* Messages for TREZOR communication
79
*/

accounts/usbwallet/internal/trezor/trezor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// wallets. The wire protocol spec can be found on the SatoshiLabs website:
1919
// https://doc.satoshilabs.com/trezor-tech/api-protobuf.html
2020

21-
//go:generate protoc --go_out=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,import_path=trezor:. types.proto messages.proto
21+
//go:generate protoc --go_out=import_path=trezor:. types.proto messages.proto
2222

2323
// Package trezor contains the wire protocol wrapper in Go.
2424
package trezor

accounts/usbwallet/internal/trezor/types.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// https://github.com/trezor/trezor-common/blob/master/protob/types.proto
33
// dated 28.07.2017, commit dd8ec3231fb5f7992360aff9bdfe30bb58130f4b.
44

5+
syntax = "proto2";
6+
57
/**
68
* Types for TREZOR communication
79
*

cmd/faucet/faucet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package main
1919

2020
//go:generate go-bindata -nometadata -o website.go faucet.html
21+
//go:generate gofmt -w -s website.go
2122

2223
import (
2324
"bytes"

cmd/faucet/website.go

Lines changed: 10 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/chequebook/cheque.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// as well as (auto)depositing ether to the chequebook contract.
2222
package chequebook
2323

24-
//go:generate abigen --sol contract/chequebook.sol --pkg contract --out contract/chequebook.go
24+
//go:generate abigen --sol contract/chequebook.sol --exc contract/mortal.sol:mortal,contract/owned.sol:owned --pkg contract --out contract/chequebook.go
2525
//go:generate go run ./gencode.go
2626

2727
import (

contracts/chequebook/contract/chequebook.go

Lines changed: 4 additions & 317 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/chequebook/contract/chequebook.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pragma solidity ^0.4.18;
22

3-
import "https://github.com/ethereum/solidity/std/mortal.sol";
3+
import "./mortal.sol";
44

55
/// @title Chequebook for Ethereum micropayments
66
/// @author Daniel A. Nagy <[email protected]>
@@ -11,6 +11,9 @@ contract chequebook is mortal {
1111
/// @notice Overdraft event
1212
event Overdraft(address deadbeat);
1313

14+
// Allow sending ether to the chequebook.
15+
function() public payable { }
16+
1417
/// @notice Cash cheque
1518
///
1619
/// @param beneficiary beneficiary address
@@ -19,8 +22,7 @@ contract chequebook is mortal {
1922
/// @param sig_r signature parameter r
2023
/// @param sig_s signature parameter s
2124
/// The digital signature is calculated on the concatenated triplet of contract address, beneficiary address and cumulative amount
22-
function cash(address beneficiary, uint256 amount,
23-
uint8 sig_v, bytes32 sig_r, bytes32 sig_s) {
25+
function cash(address beneficiary, uint256 amount, uint8 sig_v, bytes32 sig_r, bytes32 sig_s) public {
2426
// Check if the cheque is old.
2527
// Only cheques that are more recent than the last cashed one are considered.
2628
require(amount > sent[beneficiary]);
@@ -31,7 +33,7 @@ contract chequebook is mortal {
3133
// and the cumulative amount on the last cashed cheque to beneficiary.
3234
uint256 diff = amount - sent[beneficiary];
3335
if (diff <= this.balance) {
34-
// update the cumulative amount before sending
36+
// update the cumulative amount before sending
3537
sent[beneficiary] = amount;
3638
beneficiary.transfer(diff);
3739
} else {

contracts/chequebook/contract/code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ package contract
22

33
// ContractDeployedCode is used to detect suicides. This constant needs to be
44
// updated when the contract code is changed.
5-
const ContractDeployedCode = "0x606060405260e060020a600035046341c0e1b581146100315780637bf786f814610059578063fbf788d614610071575b005b61002f60005433600160a060020a03908116911614156100bd57600054600160a060020a0316ff5b6100ab60043560016020526000908152604090205481565b61002f600435602435604435606435608435600160a060020a03851660009081526001602052604081205485116100bf575b505050505050565b60408051918252519081900360200190f35b565b50604080516c0100000000000000000000000030600160a060020a0390811682028352881602601482015260288101869052815190819003604801812080825260ff861660208381019190915282840186905260608301859052925190926001926080818101939182900301816000866161da5a03f11561000257505060405151600054600160a060020a0390811691161461015a576100a3565b600160a060020a038681166000908152600160205260409020543090911631908603106101b357604060008181208790559051600160a060020a0388169190819081818181818881f1935050505015156100a357610002565b60005460408051600160a060020a03929092168252517f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f9789181900360200190a185600160a060020a0316ff"
5+
const ContractDeployedCode = "0x6060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a7230582014e927522ca5cd8f68529ac4d3b9cdf36d40e09d8a33b70008248d1abebf79680029"

0 commit comments

Comments
 (0)