mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
Merge branch 'master' into DoEstimateGasFix
This commit is contained in:
commit
346c8ba792
545 changed files with 33702 additions and 9324 deletions
27
.gitea/workflows/release-azure-cleanup.yml
Normal file
27
.gitea/workflows/release-azure-cleanup.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
### Note we cannot use cron-triggered builds right now, Gitea seems to have
|
||||||
|
### a few bugs in that area. So this workflow is scheduled using an external
|
||||||
|
### triggering mechanism and workflow_dispatch.
|
||||||
|
#
|
||||||
|
# schedule:
|
||||||
|
# - cron: '0 15 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
azure-cleanup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.24
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Run cleanup script
|
||||||
|
run: |
|
||||||
|
go run build/ci.go purge -store gethstore/builds -days 14
|
||||||
|
env:
|
||||||
|
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
|
||||||
46
.gitea/workflows/release-ppa.yml
Normal file
46
.gitea/workflows/release-ppa.yml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
### Note we cannot use cron-triggered builds right now, Gitea seems to have
|
||||||
|
### a few bugs in that area. So this workflow is scheduled using an external
|
||||||
|
### triggering mechanism and workflow_dispatch.
|
||||||
|
#
|
||||||
|
# schedule:
|
||||||
|
# - cron: '0 16 * * *'
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ppa:
|
||||||
|
name: PPA Upload
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Show environment
|
||||||
|
run: |
|
||||||
|
env
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.24
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Install deb toolchain
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get -yq --no-install-suggests --no-install-recommends install devscripts debhelper dput fakeroot
|
||||||
|
|
||||||
|
- name: Add launchpad to known_hosts
|
||||||
|
run: |
|
||||||
|
echo '|1|7SiYPr9xl3uctzovOTj4gMwAC1M=|t6ReES75Bo/PxlOPJ6/GsGbTrM0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0aKz5UTUndYgIGG7dQBV+HaeuEZJ2xPHo2DS2iSKvUL4xNMSAY4UguNW+pX56nAQmZKIZZ8MaEvSj6zMEDiq6HFfn5JcTlM80UwlnyKe8B8p7Nk06PPQLrnmQt5fh0HmEcZx+JU9TZsfCHPnX7MNz4ELfZE6cFsclClrKim3BHUIGq//t93DllB+h4O9LHjEUsQ1Sr63irDLSutkLJD6RXchjROXkNirlcNVHH/jwLWR5RcYilNX7S5bIkK8NlWPjsn/8Ua5O7I9/YoE97PpO6i73DTGLh5H9JN/SITwCKBkgSDWUt61uPK3Y11Gty7o2lWsBjhBUm2Y38CBsoGmBw==' >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Run ci.go
|
||||||
|
run: |
|
||||||
|
go run build/ci.go debsrc -upload ethereum/ethereum -sftp-user geth-ci -signer "Go Ethereum Linux Builder <geth-ci@ethereum.org>"
|
||||||
|
env:
|
||||||
|
PPA_SIGNING_KEY: ${{ secrets.PPA_SIGNING_KEY }}
|
||||||
|
PPA_SSH_KEY: ${{ secrets.PPA_SSH_KEY }}
|
||||||
179
.gitea/workflows/release.yml
Normal file
179
.gitea/workflows/release.yml
Normal file
|
|
@ -0,0 +1,179 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linux-intel:
|
||||||
|
name: Linux Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.24
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Install cross toolchain
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
|
||||||
|
|
||||||
|
- name: Build (amd64)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go install -static -arch amd64 -dlgo
|
||||||
|
|
||||||
|
- name: Create/upload archive (amd64)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go archive -arch amd64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
||||||
|
rm -f build/bin/*
|
||||||
|
env:
|
||||||
|
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
|
||||||
|
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build (386)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go install -static -arch 386 -dlgo
|
||||||
|
|
||||||
|
- name: Create/upload archive (386)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go archive -arch 386 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
||||||
|
rm -f build/bin/*
|
||||||
|
env:
|
||||||
|
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
|
||||||
|
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
|
||||||
|
|
||||||
|
linux-arm:
|
||||||
|
name: Linux Build (arm)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.24
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Install cross toolchain
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get -yq --no-install-suggests --no-install-recommends install gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
||||||
|
ln -s /usr/include/asm-generic /usr/include/asm
|
||||||
|
|
||||||
|
- name: Build (arm64)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go install -static -dlgo -arch arm64 -cc aarch64-linux-gnu-gcc
|
||||||
|
|
||||||
|
- name: Create/upload archive (arm64)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
||||||
|
rm -fr build/bin/*
|
||||||
|
env:
|
||||||
|
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
|
||||||
|
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Run build (arm5)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go install -static -dlgo -arch arm -cc arm-linux-gnueabi-gcc
|
||||||
|
env:
|
||||||
|
GOARM: "5"
|
||||||
|
|
||||||
|
- name: Create/upload archive (arm5)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
||||||
|
env:
|
||||||
|
GOARM: "5"
|
||||||
|
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
|
||||||
|
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Run build (arm6)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go install -static -dlgo -arch arm -cc arm-linux-gnueabi-gcc
|
||||||
|
env:
|
||||||
|
GOARM: "6"
|
||||||
|
|
||||||
|
- name: Create/upload archive (arm6)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
||||||
|
rm -fr build/bin/*
|
||||||
|
env:
|
||||||
|
GOARM: "6"
|
||||||
|
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
|
||||||
|
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Run build (arm7)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go install -static -dlgo -arch arm -cc arm-linux-gnueabi-gcc
|
||||||
|
env:
|
||||||
|
GOARM: "7"
|
||||||
|
|
||||||
|
- name: Create/upload archive (arm7)
|
||||||
|
run: |
|
||||||
|
go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
|
||||||
|
rm -fr build/bin/*
|
||||||
|
env:
|
||||||
|
GOARM: "7"
|
||||||
|
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
|
||||||
|
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
|
||||||
|
|
||||||
|
windows:
|
||||||
|
name: Windows Build
|
||||||
|
runs-on: "win-11"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.24
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
# Note: gcc.exe only works properly if the corresponding bin/ directory is
|
||||||
|
# contained in PATH.
|
||||||
|
|
||||||
|
- name: "Build (amd64)"
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
set PATH=%GETH_MINGW%\bin;%PATH%
|
||||||
|
go run build/ci.go install -dlgo -arch amd64 -cc %GETH_MINGW%\bin\gcc.exe
|
||||||
|
env:
|
||||||
|
GETH_MINGW: 'C:\msys64\mingw64'
|
||||||
|
|
||||||
|
- name: "Build (386)"
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
set PATH=%GETH_MINGW%\bin;%PATH%
|
||||||
|
go run build/ci.go install -dlgo -arch 386 -cc %GETH_MINGW%\bin\gcc.exe
|
||||||
|
env:
|
||||||
|
GETH_MINGW: 'C:\msys64\mingw32'
|
||||||
|
|
||||||
|
docker:
|
||||||
|
name: Docker Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: 1.24
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Run docker build
|
||||||
|
env:
|
||||||
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
|
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
go run build/ci.go dockerx -platform linux/amd64,linux/arm64,linux/riscv64 -upload
|
||||||
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
|
|
@ -19,7 +19,7 @@ eth/tracers/ @s1na
|
||||||
ethclient/ @fjl
|
ethclient/ @fjl
|
||||||
ethdb/ @rjl493456442
|
ethdb/ @rjl493456442
|
||||||
event/ @fjl
|
event/ @fjl
|
||||||
trie/ @rjl493456442
|
trie/ @rjl493456442 @gballet
|
||||||
triedb/ @rjl493456442
|
triedb/ @rjl493456442
|
||||||
core/tracing/ @s1na
|
core/tracing/ @s1na
|
||||||
graphql/ @s1na
|
graphql/ @s1na
|
||||||
|
|
@ -29,5 +29,5 @@ miner/ @MariusVanDerWijden @fjl @rjl493456442
|
||||||
node/ @fjl
|
node/ @fjl
|
||||||
p2p/ @fjl @zsfelfoldi
|
p2p/ @fjl @zsfelfoldi
|
||||||
rlp/ @fjl
|
rlp/ @fjl
|
||||||
params/ @fjl @karalabe @gballet @rjl493456442 @zsfelfoldi
|
params/ @fjl @gballet @rjl493456442 @zsfelfoldi
|
||||||
rpc/ @fjl
|
rpc/ @fjl
|
||||||
|
|
|
||||||
36
.github/workflows/go.yml
vendored
36
.github/workflows/go.yml
vendored
|
|
@ -1,18 +1,20 @@
|
||||||
name: i386 linux tests
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches:
|
||||||
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches:
|
||||||
|
- master
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted-ghr
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: false
|
||||||
|
|
||||||
# Cache build tools to avoid downloading them each time
|
# Cache build tools to avoid downloading them each time
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
|
|
@ -23,7 +25,7 @@ jobs:
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.23.0
|
go-version: 1.25
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Run linters
|
- name: Run linters
|
||||||
|
|
@ -32,17 +34,25 @@ jobs:
|
||||||
go run build/ci.go check_generate
|
go run build/ci.go check_generate
|
||||||
go run build/ci.go check_baddeps
|
go run build/ci.go check_baddeps
|
||||||
|
|
||||||
build:
|
test:
|
||||||
runs-on: self-hosted
|
name: Test
|
||||||
|
needs: lint
|
||||||
|
runs-on: self-hosted-ghr
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go:
|
||||||
|
- '1.25'
|
||||||
|
- '1.24'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.24.0
|
go-version: ${{ matrix.go }}
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -short ./...
|
run: go test ./...
|
||||||
env:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: 386
|
|
||||||
|
|
|
||||||
23
.github/workflows/validate_pr.yml
vendored
Normal file
23
.github/workflows/validate_pr.yml
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
name: PR Format Validation
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, edited, synchronize]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate-pr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check PR Title Format
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const prTitle = context.payload.pull_request.title;
|
||||||
|
const titleRegex = /^(\.?[\w\s,{}/]+): .+/;
|
||||||
|
|
||||||
|
if (!titleRegex.test(prTitle)) {
|
||||||
|
core.setFailed(`PR title "${prTitle}" does not match required format: directory, ...: description`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('✅ PR title format is valid');
|
||||||
7
.mailmap
7
.mailmap
|
|
@ -50,6 +50,10 @@ Boqin Qin <bobbqqin@bupt.edu.cn> <Bobbqqin@gmail.com>
|
||||||
|
|
||||||
Casey Detrio <cdetrio@gmail.com>
|
Casey Detrio <cdetrio@gmail.com>
|
||||||
|
|
||||||
|
Charlotte <tqpcharlie@proton.me>
|
||||||
|
Charlotte <tqpcharlie@proton.me> <Zachinquarantine@protonmail.com>
|
||||||
|
Charlotte <tqpcharlie@proton.me> <zachinquarantine@yahoo.com>
|
||||||
|
|
||||||
Cheng Li <lob4tt@gmail.com>
|
Cheng Li <lob4tt@gmail.com>
|
||||||
|
|
||||||
Chris Ziogas <ziogaschr@gmail.com>
|
Chris Ziogas <ziogaschr@gmail.com>
|
||||||
|
|
@ -301,9 +305,6 @@ Yohann Léon <sybiload@gmail.com>
|
||||||
yzb <335357057@qq.com>
|
yzb <335357057@qq.com>
|
||||||
yzb <335357057@qq.com> <flyingyzb@gmail.com>
|
yzb <335357057@qq.com> <flyingyzb@gmail.com>
|
||||||
|
|
||||||
Zachinquarantine <Zachinquarantine@protonmail.com>
|
|
||||||
Zachinquarantine <Zachinquarantine@protonmail.com> <zachinquarantine@yahoo.com>
|
|
||||||
|
|
||||||
Ziyuan Zhong <zzy.albert@163.com>
|
Ziyuan Zhong <zzy.albert@163.com>
|
||||||
|
|
||||||
Zsolt Felföldi <zsfelfoldi@gmail.com>
|
Zsolt Felföldi <zsfelfoldi@gmail.com>
|
||||||
|
|
|
||||||
115
.travis.yml
115
.travis.yml
|
|
@ -1,115 +0,0 @@
|
||||||
language: go
|
|
||||||
go_import_path: github.com/ethereum/go-ethereum
|
|
||||||
sudo: false
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
# This builder create and push the Docker images for all architectures
|
|
||||||
- stage: build
|
|
||||||
if: type = push
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
dist: focal
|
|
||||||
go: 1.24.x
|
|
||||||
env:
|
|
||||||
- docker
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
git:
|
|
||||||
submodules: false # avoid cloning ethereum/tests
|
|
||||||
before_install:
|
|
||||||
- export DOCKER_CLI_EXPERIMENTAL=enabled
|
|
||||||
script:
|
|
||||||
- go run build/ci.go dockerx -platform "linux/amd64,linux/arm64,linux/riscv64" -hub ethereum/client-go -upload
|
|
||||||
|
|
||||||
# This builder does the Linux Azure uploads
|
|
||||||
- stage: build
|
|
||||||
if: type = push
|
|
||||||
os: linux
|
|
||||||
dist: focal
|
|
||||||
sudo: required
|
|
||||||
go: 1.24.x
|
|
||||||
env:
|
|
||||||
- azure-linux
|
|
||||||
git:
|
|
||||||
submodules: false # avoid cloning ethereum/tests
|
|
||||||
script:
|
|
||||||
# build amd64
|
|
||||||
- go run build/ci.go install -dlgo
|
|
||||||
- go run build/ci.go archive -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
|
|
||||||
|
|
||||||
# build 386
|
|
||||||
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
|
|
||||||
- git status --porcelain
|
|
||||||
- go run build/ci.go install -dlgo -arch 386
|
|
||||||
- go run build/ci.go archive -arch 386 -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
|
|
||||||
|
|
||||||
# Switch over GCC to cross compilation (breaks 386, hence why do it here only)
|
|
||||||
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
|
||||||
- sudo ln -s /usr/include/asm-generic /usr/include/asm
|
|
||||||
|
|
||||||
- GOARM=5 go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabi-gcc
|
|
||||||
- GOARM=5 go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
|
|
||||||
- GOARM=6 go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabi-gcc
|
|
||||||
- GOARM=6 go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
|
|
||||||
- GOARM=7 go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabihf-gcc
|
|
||||||
- GOARM=7 go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
|
|
||||||
- go run build/ci.go install -dlgo -arch arm64 -cc aarch64-linux-gnu-gcc
|
|
||||||
- go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
|
|
||||||
|
|
||||||
# These builders run the tests
|
|
||||||
- stage: build
|
|
||||||
if: type = push
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
dist: focal
|
|
||||||
go: 1.24.x
|
|
||||||
script:
|
|
||||||
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES
|
|
||||||
|
|
||||||
- stage: build
|
|
||||||
if: type = push
|
|
||||||
os: linux
|
|
||||||
dist: focal
|
|
||||||
go: 1.23.x
|
|
||||||
script:
|
|
||||||
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES
|
|
||||||
|
|
||||||
# This builder does the Ubuntu PPA nightly uploads
|
|
||||||
- stage: build
|
|
||||||
if: type = cron || (type = push && tag ~= /^v[0-9]/)
|
|
||||||
os: linux
|
|
||||||
dist: focal
|
|
||||||
go: 1.24.x
|
|
||||||
env:
|
|
||||||
- ubuntu-ppa
|
|
||||||
git:
|
|
||||||
submodules: false # avoid cloning ethereum/tests
|
|
||||||
before_install:
|
|
||||||
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends install devscripts debhelper dput fakeroot
|
|
||||||
script:
|
|
||||||
- echo '|1|7SiYPr9xl3uctzovOTj4gMwAC1M=|t6ReES75Bo/PxlOPJ6/GsGbTrM0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0aKz5UTUndYgIGG7dQBV+HaeuEZJ2xPHo2DS2iSKvUL4xNMSAY4UguNW+pX56nAQmZKIZZ8MaEvSj6zMEDiq6HFfn5JcTlM80UwlnyKe8B8p7Nk06PPQLrnmQt5fh0HmEcZx+JU9TZsfCHPnX7MNz4ELfZE6cFsclClrKim3BHUIGq//t93DllB+h4O9LHjEUsQ1Sr63irDLSutkLJD6RXchjROXkNirlcNVHH/jwLWR5RcYilNX7S5bIkK8NlWPjsn/8Ua5O7I9/YoE97PpO6i73DTGLh5H9JN/SITwCKBkgSDWUt61uPK3Y11Gty7o2lWsBjhBUm2Y38CBsoGmBw==' >> ~/.ssh/known_hosts
|
|
||||||
- go run build/ci.go debsrc -upload ethereum/ethereum -sftp-user geth-ci -signer "Go Ethereum Linux Builder <geth-ci@ethereum.org>"
|
|
||||||
|
|
||||||
# This builder does the Azure archive purges to avoid accumulating junk
|
|
||||||
- stage: build
|
|
||||||
if: type = cron
|
|
||||||
os: linux
|
|
||||||
dist: focal
|
|
||||||
go: 1.24.x
|
|
||||||
env:
|
|
||||||
- azure-purge
|
|
||||||
git:
|
|
||||||
submodules: false # avoid cloning ethereum/tests
|
|
||||||
script:
|
|
||||||
- go run build/ci.go purge -store gethstore/builds -days 14
|
|
||||||
|
|
||||||
# This builder executes race tests
|
|
||||||
- stage: build
|
|
||||||
if: type = cron
|
|
||||||
os: linux
|
|
||||||
dist: focal
|
|
||||||
go: 1.24.x
|
|
||||||
env:
|
|
||||||
- racetests
|
|
||||||
script:
|
|
||||||
- travis_wait 60 go run build/ci.go test -race $TEST_PACKAGES
|
|
||||||
2
AUTHORS
2
AUTHORS
|
|
@ -123,6 +123,7 @@ Ceyhun Onur <ceyhun.onur@avalabs.org>
|
||||||
chabashilah <doumodoumo@gmail.com>
|
chabashilah <doumodoumo@gmail.com>
|
||||||
changhong <changhong.yu@shanbay.com>
|
changhong <changhong.yu@shanbay.com>
|
||||||
Charles Cooper <cooper.charles.m@gmail.com>
|
Charles Cooper <cooper.charles.m@gmail.com>
|
||||||
|
Charlotte <tqpcharlie@proton.me>
|
||||||
Chase Wright <mysticryuujin@gmail.com>
|
Chase Wright <mysticryuujin@gmail.com>
|
||||||
Chawin Aiemvaravutigul <nick41746@hotmail.com>
|
Chawin Aiemvaravutigul <nick41746@hotmail.com>
|
||||||
Chen Quan <terasum@163.com>
|
Chen Quan <terasum@163.com>
|
||||||
|
|
@ -839,7 +840,6 @@ ywzqwwt <39263032+ywzqwwt@users.noreply.github.com>
|
||||||
yzb <335357057@qq.com>
|
yzb <335357057@qq.com>
|
||||||
zaccoding <zaccoding725@gmail.com>
|
zaccoding <zaccoding725@gmail.com>
|
||||||
Zach <zach.ramsay@gmail.com>
|
Zach <zach.ramsay@gmail.com>
|
||||||
Zachinquarantine <Zachinquarantine@protonmail.com>
|
|
||||||
zah <zahary@gmail.com>
|
zah <zahary@gmail.com>
|
||||||
Zahoor Mohamed <zahoor@zahoor.in>
|
Zahoor Mohamed <zahoor@zahoor.in>
|
||||||
Zak Cole <zak@beattiecole.com>
|
Zak Cole <zak@beattiecole.com>
|
||||||
|
|
|
||||||
8
Makefile
8
Makefile
|
|
@ -2,7 +2,7 @@
|
||||||
# with Go source code. If you know what GOPATH is then you probably
|
# with Go source code. If you know what GOPATH is then you probably
|
||||||
# don't need to bother with make.
|
# don't need to bother with make.
|
||||||
|
|
||||||
.PHONY: geth all test lint fmt clean devtools help
|
.PHONY: geth evm all test lint fmt clean devtools help
|
||||||
|
|
||||||
GOBIN = ./build/bin
|
GOBIN = ./build/bin
|
||||||
GO ?= latest
|
GO ?= latest
|
||||||
|
|
@ -14,6 +14,12 @@ geth:
|
||||||
@echo "Done building."
|
@echo "Done building."
|
||||||
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
||||||
|
|
||||||
|
#? evm: Build evm.
|
||||||
|
evm:
|
||||||
|
$(GORUN) build/ci.go install ./cmd/evm
|
||||||
|
@echo "Done building."
|
||||||
|
@echo "Run \"$(GOBIN)/evm\" to launch evm."
|
||||||
|
|
||||||
#? all: Build all packages and executables.
|
#? all: Build all packages and executables.
|
||||||
all:
|
all:
|
||||||
$(GORUN) build/ci.go install
|
$(GORUN) build/ci.go install
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ accessible from the outside.
|
||||||
|
|
||||||
As a developer, sooner rather than later you'll want to start interacting with `geth` and the
|
As a developer, sooner rather than later you'll want to start interacting with `geth` and the
|
||||||
Ethereum network via your own programs and not manually through the console. To aid
|
Ethereum network via your own programs and not manually through the console. To aid
|
||||||
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://ethereum.github.io/execution-apis/api-documentation/)
|
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://ethereum.org/en/developers/docs/apis/json-rpc/)
|
||||||
and [`geth` specific APIs](https://geth.ethereum.org/docs/interacting-with-geth/rpc)).
|
and [`geth` specific APIs](https://geth.ethereum.org/docs/interacting-with-geth/rpc)).
|
||||||
These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based
|
These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based
|
||||||
platforms, and named pipes on Windows).
|
platforms, and named pipes on Windows).
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
intRegex = regexp.MustCompile(`(u)?int([0-9]*)`)
|
||||||
|
)
|
||||||
|
|
||||||
func isKeyWord(arg string) bool {
|
func isKeyWord(arg string) bool {
|
||||||
switch arg {
|
switch arg {
|
||||||
case "break":
|
case "break":
|
||||||
|
|
@ -299,7 +303,7 @@ func bindBasicType(kind abi.Type) string {
|
||||||
case abi.AddressTy:
|
case abi.AddressTy:
|
||||||
return "common.Address"
|
return "common.Address"
|
||||||
case abi.IntTy, abi.UintTy:
|
case abi.IntTy, abi.UintTy:
|
||||||
parts := regexp.MustCompile(`(u)?int([0-9]*)`).FindStringSubmatch(kind.String())
|
parts := intRegex.FindStringSubmatch(kind.String())
|
||||||
switch parts[2] {
|
switch parts[2] {
|
||||||
case "8", "16", "32", "64":
|
case "8", "16", "32", "64":
|
||||||
return fmt.Sprintf("%sint%s", parts[1], parts[2])
|
return fmt.Sprintf("%sint%s", parts[1], parts[2])
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ func TestBindingV2ConvertedV1Tests(t *testing.T) {
|
||||||
}
|
}
|
||||||
// Set this environment variable to regenerate the test outputs.
|
// Set this environment variable to regenerate the test outputs.
|
||||||
if os.Getenv("WRITE_TEST_FILES") != "" {
|
if os.Getenv("WRITE_TEST_FILES") != "" {
|
||||||
if err := os.WriteFile((fname), []byte(have), 0666); err != nil {
|
if err := os.WriteFile(fname, []byte(have), 0666); err != nil {
|
||||||
t.Fatalf("err writing expected output to file: %v\n", err)
|
t.Fatalf("err writing expected output to file: %v\n", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,8 @@ var (
|
||||||
|
|
||||||
{{range .Calls}}
|
{{range .Calls}}
|
||||||
// Pack{{.Normalized.Name}} is the Go binding used to pack the parameters required for calling
|
// Pack{{.Normalized.Name}} is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x{{printf "%x" .Original.ID}}.
|
// the contract method with ID 0x{{printf "%x" .Original.ID}}. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: {{.Original.String}}
|
// Solidity: {{.Original.String}}
|
||||||
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Pack{{.Normalized.Name}}({{range .Normalized.Inputs}} {{.Name}} {{bindtype .Type $structs}}, {{end}}) []byte {
|
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Pack{{.Normalized.Name}}({{range .Normalized.Inputs}} {{.Name}} {{bindtype .Type $structs}}, {{end}}) []byte {
|
||||||
|
|
@ -101,6 +102,15 @@ var (
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPack{{.Normalized.Name}} is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x{{printf "%x" .Original.ID}}. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: {{.Original.String}}
|
||||||
|
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) TryPack{{.Normalized.Name}}({{range .Normalized.Inputs}} {{.Name}} {{bindtype .Type $structs}}, {{end}}) ([]byte, error) {
|
||||||
|
return {{ decapitalise $contract.Type}}.abi.Pack("{{.Original.Name}}" {{range .Normalized.Inputs}}, {{.Name}}{{end}})
|
||||||
|
}
|
||||||
|
|
||||||
{{/* Unpack method is needed only when there are return args */}}
|
{{/* Unpack method is needed only when there are return args */}}
|
||||||
{{if .Normalized.Outputs }}
|
{{if .Normalized.Outputs }}
|
||||||
{{ if .Structured }}
|
{{ if .Structured }}
|
||||||
|
|
@ -133,8 +143,7 @@ var (
|
||||||
outstruct.{{capitalise .Name}} = *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
|
outstruct.{{capitalise .Name}} = *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
return *outstruct, err
|
return *outstruct, nil{{else}}
|
||||||
{{else}}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return {{range $i, $_ := .Normalized.Outputs}}{{if ispointertype .Type}}new({{underlyingbindtype .Type }}), {{else}}*new({{bindtype .Type $structs}}), {{end}}{{end}} err
|
return {{range $i, $_ := .Normalized.Outputs}}{{if ispointertype .Type}}new({{underlyingbindtype .Type }}), {{else}}*new({{bindtype .Type $structs}}), {{end}}{{end}} err
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +154,7 @@ var (
|
||||||
out{{$i}} := *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
|
out{{$i}} := *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
return {{range $i, $t := .Normalized.Outputs}}out{{$i}}, {{end}} err
|
return {{range $i, $t := .Normalized.Outputs}}out{{$i}}, {{end}} nil
|
||||||
{{- end}}
|
{{- end}}
|
||||||
}
|
}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *CallbackParam) Instance(backend bind.ContractBackend, addr common.Addre
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackTest is the Go binding used to pack the parameters required for calling
|
// PackTest is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xd7a5aba2.
|
// the contract method with ID 0xd7a5aba2. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function test(function callback) returns()
|
// Solidity: function test(function callback) returns()
|
||||||
func (callbackParam *CallbackParam) PackTest(callback [24]byte) []byte {
|
func (callbackParam *CallbackParam) PackTest(callback [24]byte) []byte {
|
||||||
|
|
@ -62,3 +63,12 @@ func (callbackParam *CallbackParam) PackTest(callback [24]byte) []byte {
|
||||||
}
|
}
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTest is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xd7a5aba2. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function test(function callback) returns()
|
||||||
|
func (callbackParam *CallbackParam) TryPackTest(callback [24]byte) ([]byte, error) {
|
||||||
|
return callbackParam.abi.Pack("test", callback)
|
||||||
|
}
|
||||||
|
|
|
||||||
111
accounts/abi/abigen/testdata/v2/crowdsale.go.txt
vendored
111
accounts/abi/abigen/testdata/v2/crowdsale.go.txt
vendored
|
|
@ -64,7 +64,8 @@ func (crowdsale *Crowdsale) PackConstructor(ifSuccessfulSendTo common.Address, f
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackAmountRaised is the Go binding used to pack the parameters required for calling
|
// PackAmountRaised is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x7b3e5e7b.
|
// the contract method with ID 0x7b3e5e7b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function amountRaised() returns(uint256)
|
// Solidity: function amountRaised() returns(uint256)
|
||||||
func (crowdsale *Crowdsale) PackAmountRaised() []byte {
|
func (crowdsale *Crowdsale) PackAmountRaised() []byte {
|
||||||
|
|
@ -75,6 +76,15 @@ func (crowdsale *Crowdsale) PackAmountRaised() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAmountRaised is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x7b3e5e7b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function amountRaised() returns(uint256)
|
||||||
|
func (crowdsale *Crowdsale) TryPackAmountRaised() ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("amountRaised")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackAmountRaised is the Go binding that unpacks the parameters returned
|
// UnpackAmountRaised is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x7b3e5e7b.
|
// from invoking the contract method with ID 0x7b3e5e7b.
|
||||||
//
|
//
|
||||||
|
|
@ -85,11 +95,12 @@ func (crowdsale *Crowdsale) UnpackAmountRaised(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackBeneficiary is the Go binding used to pack the parameters required for calling
|
// PackBeneficiary is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x38af3eed.
|
// the contract method with ID 0x38af3eed. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function beneficiary() returns(address)
|
// Solidity: function beneficiary() returns(address)
|
||||||
func (crowdsale *Crowdsale) PackBeneficiary() []byte {
|
func (crowdsale *Crowdsale) PackBeneficiary() []byte {
|
||||||
|
|
@ -100,6 +111,15 @@ func (crowdsale *Crowdsale) PackBeneficiary() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackBeneficiary is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x38af3eed. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function beneficiary() returns(address)
|
||||||
|
func (crowdsale *Crowdsale) TryPackBeneficiary() ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("beneficiary")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackBeneficiary is the Go binding that unpacks the parameters returned
|
// UnpackBeneficiary is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x38af3eed.
|
// from invoking the contract method with ID 0x38af3eed.
|
||||||
//
|
//
|
||||||
|
|
@ -110,11 +130,12 @@ func (crowdsale *Crowdsale) UnpackBeneficiary(data []byte) (common.Address, erro
|
||||||
return *new(common.Address), err
|
return *new(common.Address), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackCheckGoalReached is the Go binding used to pack the parameters required for calling
|
// PackCheckGoalReached is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x01cb3b20.
|
// the contract method with ID 0x01cb3b20. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function checkGoalReached() returns()
|
// Solidity: function checkGoalReached() returns()
|
||||||
func (crowdsale *Crowdsale) PackCheckGoalReached() []byte {
|
func (crowdsale *Crowdsale) PackCheckGoalReached() []byte {
|
||||||
|
|
@ -125,8 +146,18 @@ func (crowdsale *Crowdsale) PackCheckGoalReached() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackCheckGoalReached is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x01cb3b20. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function checkGoalReached() returns()
|
||||||
|
func (crowdsale *Crowdsale) TryPackCheckGoalReached() ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("checkGoalReached")
|
||||||
|
}
|
||||||
|
|
||||||
// PackDeadline is the Go binding used to pack the parameters required for calling
|
// PackDeadline is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x29dcb0cf.
|
// the contract method with ID 0x29dcb0cf. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function deadline() returns(uint256)
|
// Solidity: function deadline() returns(uint256)
|
||||||
func (crowdsale *Crowdsale) PackDeadline() []byte {
|
func (crowdsale *Crowdsale) PackDeadline() []byte {
|
||||||
|
|
@ -137,6 +168,15 @@ func (crowdsale *Crowdsale) PackDeadline() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDeadline is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x29dcb0cf. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function deadline() returns(uint256)
|
||||||
|
func (crowdsale *Crowdsale) TryPackDeadline() ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("deadline")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDeadline is the Go binding that unpacks the parameters returned
|
// UnpackDeadline is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x29dcb0cf.
|
// from invoking the contract method with ID 0x29dcb0cf.
|
||||||
//
|
//
|
||||||
|
|
@ -147,11 +187,12 @@ func (crowdsale *Crowdsale) UnpackDeadline(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackFunders is the Go binding used to pack the parameters required for calling
|
// PackFunders is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xdc0d3dff.
|
// the contract method with ID 0xdc0d3dff. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function funders(uint256 ) returns(address addr, uint256 amount)
|
// Solidity: function funders(uint256 ) returns(address addr, uint256 amount)
|
||||||
func (crowdsale *Crowdsale) PackFunders(arg0 *big.Int) []byte {
|
func (crowdsale *Crowdsale) PackFunders(arg0 *big.Int) []byte {
|
||||||
|
|
@ -162,6 +203,15 @@ func (crowdsale *Crowdsale) PackFunders(arg0 *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFunders is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xdc0d3dff. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function funders(uint256 ) returns(address addr, uint256 amount)
|
||||||
|
func (crowdsale *Crowdsale) TryPackFunders(arg0 *big.Int) ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("funders", arg0)
|
||||||
|
}
|
||||||
|
|
||||||
// FundersOutput serves as a container for the return parameters of contract
|
// FundersOutput serves as a container for the return parameters of contract
|
||||||
// method Funders.
|
// method Funders.
|
||||||
type FundersOutput struct {
|
type FundersOutput struct {
|
||||||
|
|
@ -181,12 +231,12 @@ func (crowdsale *Crowdsale) UnpackFunders(data []byte) (FundersOutput, error) {
|
||||||
}
|
}
|
||||||
outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
||||||
outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackFundingGoal is the Go binding used to pack the parameters required for calling
|
// PackFundingGoal is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x7a3a0e84.
|
// the contract method with ID 0x7a3a0e84. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function fundingGoal() returns(uint256)
|
// Solidity: function fundingGoal() returns(uint256)
|
||||||
func (crowdsale *Crowdsale) PackFundingGoal() []byte {
|
func (crowdsale *Crowdsale) PackFundingGoal() []byte {
|
||||||
|
|
@ -197,6 +247,15 @@ func (crowdsale *Crowdsale) PackFundingGoal() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFundingGoal is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x7a3a0e84. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function fundingGoal() returns(uint256)
|
||||||
|
func (crowdsale *Crowdsale) TryPackFundingGoal() ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("fundingGoal")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackFundingGoal is the Go binding that unpacks the parameters returned
|
// UnpackFundingGoal is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x7a3a0e84.
|
// from invoking the contract method with ID 0x7a3a0e84.
|
||||||
//
|
//
|
||||||
|
|
@ -207,11 +266,12 @@ func (crowdsale *Crowdsale) UnpackFundingGoal(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackPrice is the Go binding used to pack the parameters required for calling
|
// PackPrice is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xa035b1fe.
|
// the contract method with ID 0xa035b1fe. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function price() returns(uint256)
|
// Solidity: function price() returns(uint256)
|
||||||
func (crowdsale *Crowdsale) PackPrice() []byte {
|
func (crowdsale *Crowdsale) PackPrice() []byte {
|
||||||
|
|
@ -222,6 +282,15 @@ func (crowdsale *Crowdsale) PackPrice() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackPrice is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xa035b1fe. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function price() returns(uint256)
|
||||||
|
func (crowdsale *Crowdsale) TryPackPrice() ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("price")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackPrice is the Go binding that unpacks the parameters returned
|
// UnpackPrice is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xa035b1fe.
|
// from invoking the contract method with ID 0xa035b1fe.
|
||||||
//
|
//
|
||||||
|
|
@ -232,11 +301,12 @@ func (crowdsale *Crowdsale) UnpackPrice(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackTokenReward is the Go binding used to pack the parameters required for calling
|
// PackTokenReward is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x6e66f6e9.
|
// the contract method with ID 0x6e66f6e9. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function tokenReward() returns(address)
|
// Solidity: function tokenReward() returns(address)
|
||||||
func (crowdsale *Crowdsale) PackTokenReward() []byte {
|
func (crowdsale *Crowdsale) PackTokenReward() []byte {
|
||||||
|
|
@ -247,6 +317,15 @@ func (crowdsale *Crowdsale) PackTokenReward() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTokenReward is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x6e66f6e9. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function tokenReward() returns(address)
|
||||||
|
func (crowdsale *Crowdsale) TryPackTokenReward() ([]byte, error) {
|
||||||
|
return crowdsale.abi.Pack("tokenReward")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackTokenReward is the Go binding that unpacks the parameters returned
|
// UnpackTokenReward is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x6e66f6e9.
|
// from invoking the contract method with ID 0x6e66f6e9.
|
||||||
//
|
//
|
||||||
|
|
@ -257,7 +336,7 @@ func (crowdsale *Crowdsale) UnpackTokenReward(data []byte) (common.Address, erro
|
||||||
return *new(common.Address), err
|
return *new(common.Address), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CrowdsaleFundTransfer represents a FundTransfer event raised by the Crowdsale contract.
|
// CrowdsaleFundTransfer represents a FundTransfer event raised by the Crowdsale contract.
|
||||||
|
|
|
||||||
206
accounts/abi/abigen/testdata/v2/dao.go.txt
vendored
206
accounts/abi/abigen/testdata/v2/dao.go.txt
vendored
|
|
@ -64,7 +64,8 @@ func (dAO *DAO) PackConstructor(minimumQuorumForProposals *big.Int, minutesForDe
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackChangeMembership is the Go binding used to pack the parameters required for calling
|
// PackChangeMembership is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x9644fcbd.
|
// the contract method with ID 0x9644fcbd. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function changeMembership(address targetMember, bool canVote, string memberName) returns()
|
// Solidity: function changeMembership(address targetMember, bool canVote, string memberName) returns()
|
||||||
func (dAO *DAO) PackChangeMembership(targetMember common.Address, canVote bool, memberName string) []byte {
|
func (dAO *DAO) PackChangeMembership(targetMember common.Address, canVote bool, memberName string) []byte {
|
||||||
|
|
@ -75,8 +76,18 @@ func (dAO *DAO) PackChangeMembership(targetMember common.Address, canVote bool,
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackChangeMembership is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x9644fcbd. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function changeMembership(address targetMember, bool canVote, string memberName) returns()
|
||||||
|
func (dAO *DAO) TryPackChangeMembership(targetMember common.Address, canVote bool, memberName string) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("changeMembership", targetMember, canVote, memberName)
|
||||||
|
}
|
||||||
|
|
||||||
// PackChangeVotingRules is the Go binding used to pack the parameters required for calling
|
// PackChangeVotingRules is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xbcca1fd3.
|
// the contract method with ID 0xbcca1fd3. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function changeVotingRules(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority) returns()
|
// Solidity: function changeVotingRules(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority) returns()
|
||||||
func (dAO *DAO) PackChangeVotingRules(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int) []byte {
|
func (dAO *DAO) PackChangeVotingRules(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int) []byte {
|
||||||
|
|
@ -87,8 +98,18 @@ func (dAO *DAO) PackChangeVotingRules(minimumQuorumForProposals *big.Int, minute
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackChangeVotingRules is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xbcca1fd3. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function changeVotingRules(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority) returns()
|
||||||
|
func (dAO *DAO) TryPackChangeVotingRules(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("changeVotingRules", minimumQuorumForProposals, minutesForDebate, marginOfVotesForMajority)
|
||||||
|
}
|
||||||
|
|
||||||
// PackCheckProposalCode is the Go binding used to pack the parameters required for calling
|
// PackCheckProposalCode is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xeceb2945.
|
// the contract method with ID 0xeceb2945. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
|
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
|
||||||
func (dAO *DAO) PackCheckProposalCode(proposalNumber *big.Int, beneficiary common.Address, etherAmount *big.Int, transactionBytecode []byte) []byte {
|
func (dAO *DAO) PackCheckProposalCode(proposalNumber *big.Int, beneficiary common.Address, etherAmount *big.Int, transactionBytecode []byte) []byte {
|
||||||
|
|
@ -99,6 +120,15 @@ func (dAO *DAO) PackCheckProposalCode(proposalNumber *big.Int, beneficiary commo
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackCheckProposalCode is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xeceb2945. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
|
||||||
|
func (dAO *DAO) TryPackCheckProposalCode(proposalNumber *big.Int, beneficiary common.Address, etherAmount *big.Int, transactionBytecode []byte) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("checkProposalCode", proposalNumber, beneficiary, etherAmount, transactionBytecode)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackCheckProposalCode is the Go binding that unpacks the parameters returned
|
// UnpackCheckProposalCode is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xeceb2945.
|
// from invoking the contract method with ID 0xeceb2945.
|
||||||
//
|
//
|
||||||
|
|
@ -109,11 +139,12 @@ func (dAO *DAO) UnpackCheckProposalCode(data []byte) (bool, error) {
|
||||||
return *new(bool), err
|
return *new(bool), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDebatingPeriodInMinutes is the Go binding used to pack the parameters required for calling
|
// PackDebatingPeriodInMinutes is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x69bd3436.
|
// the contract method with ID 0x69bd3436. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function debatingPeriodInMinutes() returns(uint256)
|
// Solidity: function debatingPeriodInMinutes() returns(uint256)
|
||||||
func (dAO *DAO) PackDebatingPeriodInMinutes() []byte {
|
func (dAO *DAO) PackDebatingPeriodInMinutes() []byte {
|
||||||
|
|
@ -124,6 +155,15 @@ func (dAO *DAO) PackDebatingPeriodInMinutes() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDebatingPeriodInMinutes is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x69bd3436. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function debatingPeriodInMinutes() returns(uint256)
|
||||||
|
func (dAO *DAO) TryPackDebatingPeriodInMinutes() ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("debatingPeriodInMinutes")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDebatingPeriodInMinutes is the Go binding that unpacks the parameters returned
|
// UnpackDebatingPeriodInMinutes is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x69bd3436.
|
// from invoking the contract method with ID 0x69bd3436.
|
||||||
//
|
//
|
||||||
|
|
@ -134,11 +174,12 @@ func (dAO *DAO) UnpackDebatingPeriodInMinutes(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackExecuteProposal is the Go binding used to pack the parameters required for calling
|
// PackExecuteProposal is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x237e9492.
|
// the contract method with ID 0x237e9492. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
|
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
|
||||||
func (dAO *DAO) PackExecuteProposal(proposalNumber *big.Int, transactionBytecode []byte) []byte {
|
func (dAO *DAO) PackExecuteProposal(proposalNumber *big.Int, transactionBytecode []byte) []byte {
|
||||||
|
|
@ -149,6 +190,15 @@ func (dAO *DAO) PackExecuteProposal(proposalNumber *big.Int, transactionBytecode
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackExecuteProposal is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x237e9492. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
|
||||||
|
func (dAO *DAO) TryPackExecuteProposal(proposalNumber *big.Int, transactionBytecode []byte) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("executeProposal", proposalNumber, transactionBytecode)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackExecuteProposal is the Go binding that unpacks the parameters returned
|
// UnpackExecuteProposal is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x237e9492.
|
// from invoking the contract method with ID 0x237e9492.
|
||||||
//
|
//
|
||||||
|
|
@ -159,11 +209,12 @@ func (dAO *DAO) UnpackExecuteProposal(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackMajorityMargin is the Go binding used to pack the parameters required for calling
|
// PackMajorityMargin is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xaa02a90f.
|
// the contract method with ID 0xaa02a90f. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function majorityMargin() returns(int256)
|
// Solidity: function majorityMargin() returns(int256)
|
||||||
func (dAO *DAO) PackMajorityMargin() []byte {
|
func (dAO *DAO) PackMajorityMargin() []byte {
|
||||||
|
|
@ -174,6 +225,15 @@ func (dAO *DAO) PackMajorityMargin() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackMajorityMargin is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xaa02a90f. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function majorityMargin() returns(int256)
|
||||||
|
func (dAO *DAO) TryPackMajorityMargin() ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("majorityMargin")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackMajorityMargin is the Go binding that unpacks the parameters returned
|
// UnpackMajorityMargin is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xaa02a90f.
|
// from invoking the contract method with ID 0xaa02a90f.
|
||||||
//
|
//
|
||||||
|
|
@ -184,11 +244,12 @@ func (dAO *DAO) UnpackMajorityMargin(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackMemberId is the Go binding used to pack the parameters required for calling
|
// PackMemberId is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x39106821.
|
// the contract method with ID 0x39106821. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function memberId(address ) returns(uint256)
|
// Solidity: function memberId(address ) returns(uint256)
|
||||||
func (dAO *DAO) PackMemberId(arg0 common.Address) []byte {
|
func (dAO *DAO) PackMemberId(arg0 common.Address) []byte {
|
||||||
|
|
@ -199,6 +260,15 @@ func (dAO *DAO) PackMemberId(arg0 common.Address) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackMemberId is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x39106821. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function memberId(address ) returns(uint256)
|
||||||
|
func (dAO *DAO) TryPackMemberId(arg0 common.Address) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("memberId", arg0)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackMemberId is the Go binding that unpacks the parameters returned
|
// UnpackMemberId is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x39106821.
|
// from invoking the contract method with ID 0x39106821.
|
||||||
//
|
//
|
||||||
|
|
@ -209,11 +279,12 @@ func (dAO *DAO) UnpackMemberId(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackMembers is the Go binding used to pack the parameters required for calling
|
// PackMembers is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x5daf08ca.
|
// the contract method with ID 0x5daf08ca. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
|
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
|
||||||
func (dAO *DAO) PackMembers(arg0 *big.Int) []byte {
|
func (dAO *DAO) PackMembers(arg0 *big.Int) []byte {
|
||||||
|
|
@ -224,6 +295,15 @@ func (dAO *DAO) PackMembers(arg0 *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackMembers is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x5daf08ca. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
|
||||||
|
func (dAO *DAO) TryPackMembers(arg0 *big.Int) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("members", arg0)
|
||||||
|
}
|
||||||
|
|
||||||
// MembersOutput serves as a container for the return parameters of contract
|
// MembersOutput serves as a container for the return parameters of contract
|
||||||
// method Members.
|
// method Members.
|
||||||
type MembersOutput struct {
|
type MembersOutput struct {
|
||||||
|
|
@ -247,12 +327,12 @@ func (dAO *DAO) UnpackMembers(data []byte) (MembersOutput, error) {
|
||||||
outstruct.CanVote = *abi.ConvertType(out[1], new(bool)).(*bool)
|
outstruct.CanVote = *abi.ConvertType(out[1], new(bool)).(*bool)
|
||||||
outstruct.Name = *abi.ConvertType(out[2], new(string)).(*string)
|
outstruct.Name = *abi.ConvertType(out[2], new(string)).(*string)
|
||||||
outstruct.MemberSince = abi.ConvertType(out[3], new(big.Int)).(*big.Int)
|
outstruct.MemberSince = abi.ConvertType(out[3], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackMinimumQuorum is the Go binding used to pack the parameters required for calling
|
// PackMinimumQuorum is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x8160f0b5.
|
// the contract method with ID 0x8160f0b5. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function minimumQuorum() returns(uint256)
|
// Solidity: function minimumQuorum() returns(uint256)
|
||||||
func (dAO *DAO) PackMinimumQuorum() []byte {
|
func (dAO *DAO) PackMinimumQuorum() []byte {
|
||||||
|
|
@ -263,6 +343,15 @@ func (dAO *DAO) PackMinimumQuorum() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackMinimumQuorum is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x8160f0b5. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function minimumQuorum() returns(uint256)
|
||||||
|
func (dAO *DAO) TryPackMinimumQuorum() ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("minimumQuorum")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackMinimumQuorum is the Go binding that unpacks the parameters returned
|
// UnpackMinimumQuorum is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x8160f0b5.
|
// from invoking the contract method with ID 0x8160f0b5.
|
||||||
//
|
//
|
||||||
|
|
@ -273,11 +362,12 @@ func (dAO *DAO) UnpackMinimumQuorum(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackNewProposal is the Go binding used to pack the parameters required for calling
|
// PackNewProposal is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xb1050da5.
|
// the contract method with ID 0xb1050da5. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
|
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
|
||||||
func (dAO *DAO) PackNewProposal(beneficiary common.Address, etherAmount *big.Int, jobDescription string, transactionBytecode []byte) []byte {
|
func (dAO *DAO) PackNewProposal(beneficiary common.Address, etherAmount *big.Int, jobDescription string, transactionBytecode []byte) []byte {
|
||||||
|
|
@ -288,6 +378,15 @@ func (dAO *DAO) PackNewProposal(beneficiary common.Address, etherAmount *big.Int
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNewProposal is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xb1050da5. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
|
||||||
|
func (dAO *DAO) TryPackNewProposal(beneficiary common.Address, etherAmount *big.Int, jobDescription string, transactionBytecode []byte) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("newProposal", beneficiary, etherAmount, jobDescription, transactionBytecode)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackNewProposal is the Go binding that unpacks the parameters returned
|
// UnpackNewProposal is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xb1050da5.
|
// from invoking the contract method with ID 0xb1050da5.
|
||||||
//
|
//
|
||||||
|
|
@ -298,11 +397,12 @@ func (dAO *DAO) UnpackNewProposal(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackNumProposals is the Go binding used to pack the parameters required for calling
|
// PackNumProposals is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x400e3949.
|
// the contract method with ID 0x400e3949. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function numProposals() returns(uint256)
|
// Solidity: function numProposals() returns(uint256)
|
||||||
func (dAO *DAO) PackNumProposals() []byte {
|
func (dAO *DAO) PackNumProposals() []byte {
|
||||||
|
|
@ -313,6 +413,15 @@ func (dAO *DAO) PackNumProposals() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNumProposals is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x400e3949. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function numProposals() returns(uint256)
|
||||||
|
func (dAO *DAO) TryPackNumProposals() ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("numProposals")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackNumProposals is the Go binding that unpacks the parameters returned
|
// UnpackNumProposals is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x400e3949.
|
// from invoking the contract method with ID 0x400e3949.
|
||||||
//
|
//
|
||||||
|
|
@ -323,11 +432,12 @@ func (dAO *DAO) UnpackNumProposals(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackOwner is the Go binding used to pack the parameters required for calling
|
// PackOwner is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x8da5cb5b.
|
// the contract method with ID 0x8da5cb5b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function owner() returns(address)
|
// Solidity: function owner() returns(address)
|
||||||
func (dAO *DAO) PackOwner() []byte {
|
func (dAO *DAO) PackOwner() []byte {
|
||||||
|
|
@ -338,6 +448,15 @@ func (dAO *DAO) PackOwner() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackOwner is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x8da5cb5b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function owner() returns(address)
|
||||||
|
func (dAO *DAO) TryPackOwner() ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("owner")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackOwner is the Go binding that unpacks the parameters returned
|
// UnpackOwner is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x8da5cb5b.
|
// from invoking the contract method with ID 0x8da5cb5b.
|
||||||
//
|
//
|
||||||
|
|
@ -348,11 +467,12 @@ func (dAO *DAO) UnpackOwner(data []byte) (common.Address, error) {
|
||||||
return *new(common.Address), err
|
return *new(common.Address), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackProposals is the Go binding used to pack the parameters required for calling
|
// PackProposals is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x013cf08b.
|
// the contract method with ID 0x013cf08b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
|
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
|
||||||
func (dAO *DAO) PackProposals(arg0 *big.Int) []byte {
|
func (dAO *DAO) PackProposals(arg0 *big.Int) []byte {
|
||||||
|
|
@ -363,6 +483,15 @@ func (dAO *DAO) PackProposals(arg0 *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackProposals is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x013cf08b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
|
||||||
|
func (dAO *DAO) TryPackProposals(arg0 *big.Int) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("proposals", arg0)
|
||||||
|
}
|
||||||
|
|
||||||
// ProposalsOutput serves as a container for the return parameters of contract
|
// ProposalsOutput serves as a container for the return parameters of contract
|
||||||
// method Proposals.
|
// method Proposals.
|
||||||
type ProposalsOutput struct {
|
type ProposalsOutput struct {
|
||||||
|
|
@ -396,12 +525,12 @@ func (dAO *DAO) UnpackProposals(data []byte) (ProposalsOutput, error) {
|
||||||
outstruct.NumberOfVotes = abi.ConvertType(out[6], new(big.Int)).(*big.Int)
|
outstruct.NumberOfVotes = abi.ConvertType(out[6], new(big.Int)).(*big.Int)
|
||||||
outstruct.CurrentResult = abi.ConvertType(out[7], new(big.Int)).(*big.Int)
|
outstruct.CurrentResult = abi.ConvertType(out[7], new(big.Int)).(*big.Int)
|
||||||
outstruct.ProposalHash = *abi.ConvertType(out[8], new([32]byte)).(*[32]byte)
|
outstruct.ProposalHash = *abi.ConvertType(out[8], new([32]byte)).(*[32]byte)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackTransferOwnership is the Go binding used to pack the parameters required for calling
|
// PackTransferOwnership is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xf2fde38b.
|
// the contract method with ID 0xf2fde38b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function transferOwnership(address newOwner) returns()
|
// Solidity: function transferOwnership(address newOwner) returns()
|
||||||
func (dAO *DAO) PackTransferOwnership(newOwner common.Address) []byte {
|
func (dAO *DAO) PackTransferOwnership(newOwner common.Address) []byte {
|
||||||
|
|
@ -412,8 +541,18 @@ func (dAO *DAO) PackTransferOwnership(newOwner common.Address) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTransferOwnership is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xf2fde38b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function transferOwnership(address newOwner) returns()
|
||||||
|
func (dAO *DAO) TryPackTransferOwnership(newOwner common.Address) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("transferOwnership", newOwner)
|
||||||
|
}
|
||||||
|
|
||||||
// PackVote is the Go binding used to pack the parameters required for calling
|
// PackVote is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xd3c0715b.
|
// the contract method with ID 0xd3c0715b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
|
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
|
||||||
func (dAO *DAO) PackVote(proposalNumber *big.Int, supportsProposal bool, justificationText string) []byte {
|
func (dAO *DAO) PackVote(proposalNumber *big.Int, supportsProposal bool, justificationText string) []byte {
|
||||||
|
|
@ -424,6 +563,15 @@ func (dAO *DAO) PackVote(proposalNumber *big.Int, supportsProposal bool, justifi
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackVote is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xd3c0715b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
|
||||||
|
func (dAO *DAO) TryPackVote(proposalNumber *big.Int, supportsProposal bool, justificationText string) ([]byte, error) {
|
||||||
|
return dAO.abi.Pack("vote", proposalNumber, supportsProposal, justificationText)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackVote is the Go binding that unpacks the parameters returned
|
// UnpackVote is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xd3c0715b.
|
// from invoking the contract method with ID 0xd3c0715b.
|
||||||
//
|
//
|
||||||
|
|
@ -434,7 +582,7 @@ func (dAO *DAO) UnpackVote(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DAOChangeOfRules represents a ChangeOfRules event raised by the DAO contract.
|
// DAOChangeOfRules represents a ChangeOfRules event raised by the DAO contract.
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *DeeplyNestedArray) Instance(backend bind.ContractBackend, addr common.A
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDeepUint64Array is the Go binding used to pack the parameters required for calling
|
// PackDeepUint64Array is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x98ed1856.
|
// the contract method with ID 0x98ed1856. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function deepUint64Array(uint256 , uint256 , uint256 ) view returns(uint64)
|
// Solidity: function deepUint64Array(uint256 , uint256 , uint256 ) view returns(uint64)
|
||||||
func (deeplyNestedArray *DeeplyNestedArray) PackDeepUint64Array(arg0 *big.Int, arg1 *big.Int, arg2 *big.Int) []byte {
|
func (deeplyNestedArray *DeeplyNestedArray) PackDeepUint64Array(arg0 *big.Int, arg1 *big.Int, arg2 *big.Int) []byte {
|
||||||
|
|
@ -63,6 +64,15 @@ func (deeplyNestedArray *DeeplyNestedArray) PackDeepUint64Array(arg0 *big.Int, a
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDeepUint64Array is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x98ed1856. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function deepUint64Array(uint256 , uint256 , uint256 ) view returns(uint64)
|
||||||
|
func (deeplyNestedArray *DeeplyNestedArray) TryPackDeepUint64Array(arg0 *big.Int, arg1 *big.Int, arg2 *big.Int) ([]byte, error) {
|
||||||
|
return deeplyNestedArray.abi.Pack("deepUint64Array", arg0, arg1, arg2)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDeepUint64Array is the Go binding that unpacks the parameters returned
|
// UnpackDeepUint64Array is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x98ed1856.
|
// from invoking the contract method with ID 0x98ed1856.
|
||||||
//
|
//
|
||||||
|
|
@ -73,11 +83,12 @@ func (deeplyNestedArray *DeeplyNestedArray) UnpackDeepUint64Array(data []byte) (
|
||||||
return *new(uint64), err
|
return *new(uint64), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64)
|
out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackRetrieveDeepArray is the Go binding used to pack the parameters required for calling
|
// PackRetrieveDeepArray is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x8ed4573a.
|
// the contract method with ID 0x8ed4573a. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function retrieveDeepArray() view returns(uint64[3][4][5])
|
// Solidity: function retrieveDeepArray() view returns(uint64[3][4][5])
|
||||||
func (deeplyNestedArray *DeeplyNestedArray) PackRetrieveDeepArray() []byte {
|
func (deeplyNestedArray *DeeplyNestedArray) PackRetrieveDeepArray() []byte {
|
||||||
|
|
@ -88,6 +99,15 @@ func (deeplyNestedArray *DeeplyNestedArray) PackRetrieveDeepArray() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackRetrieveDeepArray is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x8ed4573a. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function retrieveDeepArray() view returns(uint64[3][4][5])
|
||||||
|
func (deeplyNestedArray *DeeplyNestedArray) TryPackRetrieveDeepArray() ([]byte, error) {
|
||||||
|
return deeplyNestedArray.abi.Pack("retrieveDeepArray")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackRetrieveDeepArray is the Go binding that unpacks the parameters returned
|
// UnpackRetrieveDeepArray is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x8ed4573a.
|
// from invoking the contract method with ID 0x8ed4573a.
|
||||||
//
|
//
|
||||||
|
|
@ -98,11 +118,12 @@ func (deeplyNestedArray *DeeplyNestedArray) UnpackRetrieveDeepArray(data []byte)
|
||||||
return *new([5][4][3]uint64), err
|
return *new([5][4][3]uint64), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new([5][4][3]uint64)).(*[5][4][3]uint64)
|
out0 := *abi.ConvertType(out[0], new([5][4][3]uint64)).(*[5][4][3]uint64)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackStoreDeepUintArray is the Go binding used to pack the parameters required for calling
|
// PackStoreDeepUintArray is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x34424855.
|
// the contract method with ID 0x34424855. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function storeDeepUintArray(uint64[3][4][5] arr) returns()
|
// Solidity: function storeDeepUintArray(uint64[3][4][5] arr) returns()
|
||||||
func (deeplyNestedArray *DeeplyNestedArray) PackStoreDeepUintArray(arr [5][4][3]uint64) []byte {
|
func (deeplyNestedArray *DeeplyNestedArray) PackStoreDeepUintArray(arr [5][4][3]uint64) []byte {
|
||||||
|
|
@ -112,3 +133,12 @@ func (deeplyNestedArray *DeeplyNestedArray) PackStoreDeepUintArray(arr [5][4][3]
|
||||||
}
|
}
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackStoreDeepUintArray is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x34424855. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function storeDeepUintArray(uint64[3][4][5] arr) returns()
|
||||||
|
func (deeplyNestedArray *DeeplyNestedArray) TryPackStoreDeepUintArray(arr [5][4][3]uint64) ([]byte, error) {
|
||||||
|
return deeplyNestedArray.abi.Pack("storeDeepUintArray", arr)
|
||||||
|
}
|
||||||
|
|
|
||||||
15
accounts/abi/abigen/testdata/v2/getter.go.txt
vendored
15
accounts/abi/abigen/testdata/v2/getter.go.txt
vendored
|
|
@ -52,7 +52,8 @@ func (c *Getter) Instance(backend bind.ContractBackend, addr common.Address) *bi
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackGetter is the Go binding used to pack the parameters required for calling
|
// PackGetter is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x993a04b7.
|
// the contract method with ID 0x993a04b7. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function getter() returns(string, int256, bytes32)
|
// Solidity: function getter() returns(string, int256, bytes32)
|
||||||
func (getter *Getter) PackGetter() []byte {
|
func (getter *Getter) PackGetter() []byte {
|
||||||
|
|
@ -63,6 +64,15 @@ func (getter *Getter) PackGetter() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackGetter is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x993a04b7. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function getter() returns(string, int256, bytes32)
|
||||||
|
func (getter *Getter) TryPackGetter() ([]byte, error) {
|
||||||
|
return getter.abi.Pack("getter")
|
||||||
|
}
|
||||||
|
|
||||||
// GetterOutput serves as a container for the return parameters of contract
|
// GetterOutput serves as a container for the return parameters of contract
|
||||||
// method Getter.
|
// method Getter.
|
||||||
type GetterOutput struct {
|
type GetterOutput struct {
|
||||||
|
|
@ -84,6 +94,5 @@ func (getter *Getter) UnpackGetter(data []byte) (GetterOutput, error) {
|
||||||
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
|
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
outstruct.Arg2 = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
|
outstruct.Arg2 = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *IdentifierCollision) Instance(backend bind.ContractBackend, addr common
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackMyVar is the Go binding used to pack the parameters required for calling
|
// PackMyVar is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x4ef1f0ad.
|
// the contract method with ID 0x4ef1f0ad. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function MyVar() view returns(uint256)
|
// Solidity: function MyVar() view returns(uint256)
|
||||||
func (identifierCollision *IdentifierCollision) PackMyVar() []byte {
|
func (identifierCollision *IdentifierCollision) PackMyVar() []byte {
|
||||||
|
|
@ -63,6 +64,15 @@ func (identifierCollision *IdentifierCollision) PackMyVar() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackMyVar is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x4ef1f0ad. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function MyVar() view returns(uint256)
|
||||||
|
func (identifierCollision *IdentifierCollision) TryPackMyVar() ([]byte, error) {
|
||||||
|
return identifierCollision.abi.Pack("MyVar")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackMyVar is the Go binding that unpacks the parameters returned
|
// UnpackMyVar is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x4ef1f0ad.
|
// from invoking the contract method with ID 0x4ef1f0ad.
|
||||||
//
|
//
|
||||||
|
|
@ -73,11 +83,12 @@ func (identifierCollision *IdentifierCollision) UnpackMyVar(data []byte) (*big.I
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackPubVar is the Go binding used to pack the parameters required for calling
|
// PackPubVar is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x01ad4d87.
|
// the contract method with ID 0x01ad4d87. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function _myVar() view returns(uint256)
|
// Solidity: function _myVar() view returns(uint256)
|
||||||
func (identifierCollision *IdentifierCollision) PackPubVar() []byte {
|
func (identifierCollision *IdentifierCollision) PackPubVar() []byte {
|
||||||
|
|
@ -88,6 +99,15 @@ func (identifierCollision *IdentifierCollision) PackPubVar() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackPubVar is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x01ad4d87. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function _myVar() view returns(uint256)
|
||||||
|
func (identifierCollision *IdentifierCollision) TryPackPubVar() ([]byte, error) {
|
||||||
|
return identifierCollision.abi.Pack("_myVar")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackPubVar is the Go binding that unpacks the parameters returned
|
// UnpackPubVar is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x01ad4d87.
|
// from invoking the contract method with ID 0x01ad4d87.
|
||||||
//
|
//
|
||||||
|
|
@ -98,5 +118,5 @@ func (identifierCollision *IdentifierCollision) UnpackPubVar(data []byte) (*big.
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,8 @@ func (c *InputChecker) Instance(backend bind.ContractBackend, addr common.Addres
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackAnonInput is the Go binding used to pack the parameters required for calling
|
// PackAnonInput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x3e708e82.
|
// the contract method with ID 0x3e708e82. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function anonInput(string ) returns()
|
// Solidity: function anonInput(string ) returns()
|
||||||
func (inputChecker *InputChecker) PackAnonInput(arg0 string) []byte {
|
func (inputChecker *InputChecker) PackAnonInput(arg0 string) []byte {
|
||||||
|
|
@ -62,8 +63,18 @@ func (inputChecker *InputChecker) PackAnonInput(arg0 string) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAnonInput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x3e708e82. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function anonInput(string ) returns()
|
||||||
|
func (inputChecker *InputChecker) TryPackAnonInput(arg0 string) ([]byte, error) {
|
||||||
|
return inputChecker.abi.Pack("anonInput", arg0)
|
||||||
|
}
|
||||||
|
|
||||||
// PackAnonInputs is the Go binding used to pack the parameters required for calling
|
// PackAnonInputs is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x28160527.
|
// the contract method with ID 0x28160527. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function anonInputs(string , string ) returns()
|
// Solidity: function anonInputs(string , string ) returns()
|
||||||
func (inputChecker *InputChecker) PackAnonInputs(arg0 string, arg1 string) []byte {
|
func (inputChecker *InputChecker) PackAnonInputs(arg0 string, arg1 string) []byte {
|
||||||
|
|
@ -74,8 +85,18 @@ func (inputChecker *InputChecker) PackAnonInputs(arg0 string, arg1 string) []byt
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAnonInputs is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x28160527. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function anonInputs(string , string ) returns()
|
||||||
|
func (inputChecker *InputChecker) TryPackAnonInputs(arg0 string, arg1 string) ([]byte, error) {
|
||||||
|
return inputChecker.abi.Pack("anonInputs", arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// PackMixedInputs is the Go binding used to pack the parameters required for calling
|
// PackMixedInputs is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xc689ebdc.
|
// the contract method with ID 0xc689ebdc. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function mixedInputs(string , string str) returns()
|
// Solidity: function mixedInputs(string , string str) returns()
|
||||||
func (inputChecker *InputChecker) PackMixedInputs(arg0 string, str string) []byte {
|
func (inputChecker *InputChecker) PackMixedInputs(arg0 string, str string) []byte {
|
||||||
|
|
@ -86,8 +107,18 @@ func (inputChecker *InputChecker) PackMixedInputs(arg0 string, str string) []byt
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackMixedInputs is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xc689ebdc. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function mixedInputs(string , string str) returns()
|
||||||
|
func (inputChecker *InputChecker) TryPackMixedInputs(arg0 string, str string) ([]byte, error) {
|
||||||
|
return inputChecker.abi.Pack("mixedInputs", arg0, str)
|
||||||
|
}
|
||||||
|
|
||||||
// PackNamedInput is the Go binding used to pack the parameters required for calling
|
// PackNamedInput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x0d402005.
|
// the contract method with ID 0x0d402005. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function namedInput(string str) returns()
|
// Solidity: function namedInput(string str) returns()
|
||||||
func (inputChecker *InputChecker) PackNamedInput(str string) []byte {
|
func (inputChecker *InputChecker) PackNamedInput(str string) []byte {
|
||||||
|
|
@ -98,8 +129,18 @@ func (inputChecker *InputChecker) PackNamedInput(str string) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNamedInput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x0d402005. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function namedInput(string str) returns()
|
||||||
|
func (inputChecker *InputChecker) TryPackNamedInput(str string) ([]byte, error) {
|
||||||
|
return inputChecker.abi.Pack("namedInput", str)
|
||||||
|
}
|
||||||
|
|
||||||
// PackNamedInputs is the Go binding used to pack the parameters required for calling
|
// PackNamedInputs is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x63c796ed.
|
// the contract method with ID 0x63c796ed. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function namedInputs(string str1, string str2) returns()
|
// Solidity: function namedInputs(string str1, string str2) returns()
|
||||||
func (inputChecker *InputChecker) PackNamedInputs(str1 string, str2 string) []byte {
|
func (inputChecker *InputChecker) PackNamedInputs(str1 string, str2 string) []byte {
|
||||||
|
|
@ -110,8 +151,18 @@ func (inputChecker *InputChecker) PackNamedInputs(str1 string, str2 string) []by
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNamedInputs is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x63c796ed. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function namedInputs(string str1, string str2) returns()
|
||||||
|
func (inputChecker *InputChecker) TryPackNamedInputs(str1 string, str2 string) ([]byte, error) {
|
||||||
|
return inputChecker.abi.Pack("namedInputs", str1, str2)
|
||||||
|
}
|
||||||
|
|
||||||
// PackNoInput is the Go binding used to pack the parameters required for calling
|
// PackNoInput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x53539029.
|
// the contract method with ID 0x53539029. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function noInput() returns()
|
// Solidity: function noInput() returns()
|
||||||
func (inputChecker *InputChecker) PackNoInput() []byte {
|
func (inputChecker *InputChecker) PackNoInput() []byte {
|
||||||
|
|
@ -121,3 +172,12 @@ func (inputChecker *InputChecker) PackNoInput() []byte {
|
||||||
}
|
}
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNoInput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x53539029. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function noInput() returns()
|
||||||
|
func (inputChecker *InputChecker) TryPackNoInput() ([]byte, error) {
|
||||||
|
return inputChecker.abi.Pack("noInput")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ func (interactor *Interactor) PackConstructor(str string) []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDeployString is the Go binding used to pack the parameters required for calling
|
// PackDeployString is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x6874e809.
|
// the contract method with ID 0x6874e809. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function deployString() returns(string)
|
// Solidity: function deployString() returns(string)
|
||||||
func (interactor *Interactor) PackDeployString() []byte {
|
func (interactor *Interactor) PackDeployString() []byte {
|
||||||
|
|
@ -75,6 +76,15 @@ func (interactor *Interactor) PackDeployString() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDeployString is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x6874e809. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function deployString() returns(string)
|
||||||
|
func (interactor *Interactor) TryPackDeployString() ([]byte, error) {
|
||||||
|
return interactor.abi.Pack("deployString")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDeployString is the Go binding that unpacks the parameters returned
|
// UnpackDeployString is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x6874e809.
|
// from invoking the contract method with ID 0x6874e809.
|
||||||
//
|
//
|
||||||
|
|
@ -85,11 +95,12 @@ func (interactor *Interactor) UnpackDeployString(data []byte) (string, error) {
|
||||||
return *new(string), err
|
return *new(string), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackTransact is the Go binding used to pack the parameters required for calling
|
// PackTransact is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xd736c513.
|
// the contract method with ID 0xd736c513. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function transact(string str) returns()
|
// Solidity: function transact(string str) returns()
|
||||||
func (interactor *Interactor) PackTransact(str string) []byte {
|
func (interactor *Interactor) PackTransact(str string) []byte {
|
||||||
|
|
@ -100,8 +111,18 @@ func (interactor *Interactor) PackTransact(str string) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTransact is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xd736c513. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function transact(string str) returns()
|
||||||
|
func (interactor *Interactor) TryPackTransact(str string) ([]byte, error) {
|
||||||
|
return interactor.abi.Pack("transact", str)
|
||||||
|
}
|
||||||
|
|
||||||
// PackTransactString is the Go binding used to pack the parameters required for calling
|
// PackTransactString is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x0d86a0e1.
|
// the contract method with ID 0x0d86a0e1. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function transactString() returns(string)
|
// Solidity: function transactString() returns(string)
|
||||||
func (interactor *Interactor) PackTransactString() []byte {
|
func (interactor *Interactor) PackTransactString() []byte {
|
||||||
|
|
@ -112,6 +133,15 @@ func (interactor *Interactor) PackTransactString() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTransactString is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x0d86a0e1. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function transactString() returns(string)
|
||||||
|
func (interactor *Interactor) TryPackTransactString() ([]byte, error) {
|
||||||
|
return interactor.abi.Pack("transactString")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackTransactString is the Go binding that unpacks the parameters returned
|
// UnpackTransactString is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x0d86a0e1.
|
// from invoking the contract method with ID 0x0d86a0e1.
|
||||||
//
|
//
|
||||||
|
|
@ -122,5 +152,5 @@ func (interactor *Interactor) UnpackTransactString(data []byte) (string, error)
|
||||||
return *new(string), err
|
return *new(string), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,8 @@ func (c *NameConflict) Instance(backend bind.ContractBackend, addr common.Addres
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackAddRequest is the Go binding used to pack the parameters required for calling
|
// PackAddRequest is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xcce7b048.
|
// the contract method with ID 0xcce7b048. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function addRequest((bytes,bytes) req) pure returns()
|
// Solidity: function addRequest((bytes,bytes) req) pure returns()
|
||||||
func (nameConflict *NameConflict) PackAddRequest(req Oraclerequest) []byte {
|
func (nameConflict *NameConflict) PackAddRequest(req Oraclerequest) []byte {
|
||||||
|
|
@ -69,8 +70,18 @@ func (nameConflict *NameConflict) PackAddRequest(req Oraclerequest) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAddRequest is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xcce7b048. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function addRequest((bytes,bytes) req) pure returns()
|
||||||
|
func (nameConflict *NameConflict) TryPackAddRequest(req Oraclerequest) ([]byte, error) {
|
||||||
|
return nameConflict.abi.Pack("addRequest", req)
|
||||||
|
}
|
||||||
|
|
||||||
// PackGetRequest is the Go binding used to pack the parameters required for calling
|
// PackGetRequest is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xc2bb515f.
|
// the contract method with ID 0xc2bb515f. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function getRequest() pure returns((bytes,bytes))
|
// Solidity: function getRequest() pure returns((bytes,bytes))
|
||||||
func (nameConflict *NameConflict) PackGetRequest() []byte {
|
func (nameConflict *NameConflict) PackGetRequest() []byte {
|
||||||
|
|
@ -81,6 +92,15 @@ func (nameConflict *NameConflict) PackGetRequest() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackGetRequest is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xc2bb515f. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function getRequest() pure returns((bytes,bytes))
|
||||||
|
func (nameConflict *NameConflict) TryPackGetRequest() ([]byte, error) {
|
||||||
|
return nameConflict.abi.Pack("getRequest")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackGetRequest is the Go binding that unpacks the parameters returned
|
// UnpackGetRequest is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xc2bb515f.
|
// from invoking the contract method with ID 0xc2bb515f.
|
||||||
//
|
//
|
||||||
|
|
@ -91,7 +111,7 @@ func (nameConflict *NameConflict) UnpackGetRequest(data []byte) (Oraclerequest,
|
||||||
return *new(Oraclerequest), err
|
return *new(Oraclerequest), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(Oraclerequest)).(*Oraclerequest)
|
out0 := *abi.ConvertType(out[0], new(Oraclerequest)).(*Oraclerequest)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NameConflictLog represents a log event raised by the NameConflict contract.
|
// NameConflictLog represents a log event raised by the NameConflict contract.
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *NumericMethodName) Instance(backend bind.ContractBackend, addr common.A
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackE1test is the Go binding used to pack the parameters required for calling
|
// PackE1test is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xffa02795.
|
// the contract method with ID 0xffa02795. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function _1test() pure returns()
|
// Solidity: function _1test() pure returns()
|
||||||
func (numericMethodName *NumericMethodName) PackE1test() []byte {
|
func (numericMethodName *NumericMethodName) PackE1test() []byte {
|
||||||
|
|
@ -63,8 +64,18 @@ func (numericMethodName *NumericMethodName) PackE1test() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackE1test is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xffa02795. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function _1test() pure returns()
|
||||||
|
func (numericMethodName *NumericMethodName) TryPackE1test() ([]byte, error) {
|
||||||
|
return numericMethodName.abi.Pack("_1test")
|
||||||
|
}
|
||||||
|
|
||||||
// PackE1test0 is the Go binding used to pack the parameters required for calling
|
// PackE1test0 is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xd02767c7.
|
// the contract method with ID 0xd02767c7. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function __1test() pure returns()
|
// Solidity: function __1test() pure returns()
|
||||||
func (numericMethodName *NumericMethodName) PackE1test0() []byte {
|
func (numericMethodName *NumericMethodName) PackE1test0() []byte {
|
||||||
|
|
@ -75,8 +86,18 @@ func (numericMethodName *NumericMethodName) PackE1test0() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackE1test0 is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xd02767c7. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function __1test() pure returns()
|
||||||
|
func (numericMethodName *NumericMethodName) TryPackE1test0() ([]byte, error) {
|
||||||
|
return numericMethodName.abi.Pack("__1test")
|
||||||
|
}
|
||||||
|
|
||||||
// PackE2test is the Go binding used to pack the parameters required for calling
|
// PackE2test is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x9d993132.
|
// the contract method with ID 0x9d993132. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function __2test() pure returns()
|
// Solidity: function __2test() pure returns()
|
||||||
func (numericMethodName *NumericMethodName) PackE2test() []byte {
|
func (numericMethodName *NumericMethodName) PackE2test() []byte {
|
||||||
|
|
@ -87,6 +108,15 @@ func (numericMethodName *NumericMethodName) PackE2test() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackE2test is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x9d993132. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function __2test() pure returns()
|
||||||
|
func (numericMethodName *NumericMethodName) TryPackE2test() ([]byte, error) {
|
||||||
|
return numericMethodName.abi.Pack("__2test")
|
||||||
|
}
|
||||||
|
|
||||||
// NumericMethodNameE1TestEvent represents a _1TestEvent event raised by the NumericMethodName contract.
|
// NumericMethodNameE1TestEvent represents a _1TestEvent event raised by the NumericMethodName contract.
|
||||||
type NumericMethodNameE1TestEvent struct {
|
type NumericMethodNameE1TestEvent struct {
|
||||||
Param common.Address
|
Param common.Address
|
||||||
|
|
|
||||||
100
accounts/abi/abigen/testdata/v2/outputchecker.go.txt
vendored
100
accounts/abi/abigen/testdata/v2/outputchecker.go.txt
vendored
|
|
@ -51,7 +51,8 @@ func (c *OutputChecker) Instance(backend bind.ContractBackend, addr common.Addre
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackAnonOutput is the Go binding used to pack the parameters required for calling
|
// PackAnonOutput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x008bda05.
|
// the contract method with ID 0x008bda05. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function anonOutput() returns(string)
|
// Solidity: function anonOutput() returns(string)
|
||||||
func (outputChecker *OutputChecker) PackAnonOutput() []byte {
|
func (outputChecker *OutputChecker) PackAnonOutput() []byte {
|
||||||
|
|
@ -62,6 +63,15 @@ func (outputChecker *OutputChecker) PackAnonOutput() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAnonOutput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x008bda05. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function anonOutput() returns(string)
|
||||||
|
func (outputChecker *OutputChecker) TryPackAnonOutput() ([]byte, error) {
|
||||||
|
return outputChecker.abi.Pack("anonOutput")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackAnonOutput is the Go binding that unpacks the parameters returned
|
// UnpackAnonOutput is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x008bda05.
|
// from invoking the contract method with ID 0x008bda05.
|
||||||
//
|
//
|
||||||
|
|
@ -72,11 +82,12 @@ func (outputChecker *OutputChecker) UnpackAnonOutput(data []byte) (string, error
|
||||||
return *new(string), err
|
return *new(string), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackAnonOutputs is the Go binding used to pack the parameters required for calling
|
// PackAnonOutputs is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x3c401115.
|
// the contract method with ID 0x3c401115. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function anonOutputs() returns(string, string)
|
// Solidity: function anonOutputs() returns(string, string)
|
||||||
func (outputChecker *OutputChecker) PackAnonOutputs() []byte {
|
func (outputChecker *OutputChecker) PackAnonOutputs() []byte {
|
||||||
|
|
@ -87,6 +98,15 @@ func (outputChecker *OutputChecker) PackAnonOutputs() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAnonOutputs is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x3c401115. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function anonOutputs() returns(string, string)
|
||||||
|
func (outputChecker *OutputChecker) TryPackAnonOutputs() ([]byte, error) {
|
||||||
|
return outputChecker.abi.Pack("anonOutputs")
|
||||||
|
}
|
||||||
|
|
||||||
// AnonOutputsOutput serves as a container for the return parameters of contract
|
// AnonOutputsOutput serves as a container for the return parameters of contract
|
||||||
// method AnonOutputs.
|
// method AnonOutputs.
|
||||||
type AnonOutputsOutput struct {
|
type AnonOutputsOutput struct {
|
||||||
|
|
@ -106,12 +126,12 @@ func (outputChecker *OutputChecker) UnpackAnonOutputs(data []byte) (AnonOutputsO
|
||||||
}
|
}
|
||||||
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
|
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
outstruct.Arg1 = *abi.ConvertType(out[1], new(string)).(*string)
|
outstruct.Arg1 = *abi.ConvertType(out[1], new(string)).(*string)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackCollidingOutputs is the Go binding used to pack the parameters required for calling
|
// PackCollidingOutputs is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xeccbc1ee.
|
// the contract method with ID 0xeccbc1ee. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function collidingOutputs() returns(string str, string Str)
|
// Solidity: function collidingOutputs() returns(string str, string Str)
|
||||||
func (outputChecker *OutputChecker) PackCollidingOutputs() []byte {
|
func (outputChecker *OutputChecker) PackCollidingOutputs() []byte {
|
||||||
|
|
@ -122,6 +142,15 @@ func (outputChecker *OutputChecker) PackCollidingOutputs() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackCollidingOutputs is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xeccbc1ee. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function collidingOutputs() returns(string str, string Str)
|
||||||
|
func (outputChecker *OutputChecker) TryPackCollidingOutputs() ([]byte, error) {
|
||||||
|
return outputChecker.abi.Pack("collidingOutputs")
|
||||||
|
}
|
||||||
|
|
||||||
// CollidingOutputsOutput serves as a container for the return parameters of contract
|
// CollidingOutputsOutput serves as a container for the return parameters of contract
|
||||||
// method CollidingOutputs.
|
// method CollidingOutputs.
|
||||||
type CollidingOutputsOutput struct {
|
type CollidingOutputsOutput struct {
|
||||||
|
|
@ -141,12 +170,12 @@ func (outputChecker *OutputChecker) UnpackCollidingOutputs(data []byte) (Collidi
|
||||||
}
|
}
|
||||||
outstruct.Str = *abi.ConvertType(out[0], new(string)).(*string)
|
outstruct.Str = *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
outstruct.Str0 = *abi.ConvertType(out[1], new(string)).(*string)
|
outstruct.Str0 = *abi.ConvertType(out[1], new(string)).(*string)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackMixedOutputs is the Go binding used to pack the parameters required for calling
|
// PackMixedOutputs is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x21b77b44.
|
// the contract method with ID 0x21b77b44. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function mixedOutputs() returns(string, string str)
|
// Solidity: function mixedOutputs() returns(string, string str)
|
||||||
func (outputChecker *OutputChecker) PackMixedOutputs() []byte {
|
func (outputChecker *OutputChecker) PackMixedOutputs() []byte {
|
||||||
|
|
@ -157,6 +186,15 @@ func (outputChecker *OutputChecker) PackMixedOutputs() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackMixedOutputs is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x21b77b44. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function mixedOutputs() returns(string, string str)
|
||||||
|
func (outputChecker *OutputChecker) TryPackMixedOutputs() ([]byte, error) {
|
||||||
|
return outputChecker.abi.Pack("mixedOutputs")
|
||||||
|
}
|
||||||
|
|
||||||
// MixedOutputsOutput serves as a container for the return parameters of contract
|
// MixedOutputsOutput serves as a container for the return parameters of contract
|
||||||
// method MixedOutputs.
|
// method MixedOutputs.
|
||||||
type MixedOutputsOutput struct {
|
type MixedOutputsOutput struct {
|
||||||
|
|
@ -176,12 +214,12 @@ func (outputChecker *OutputChecker) UnpackMixedOutputs(data []byte) (MixedOutput
|
||||||
}
|
}
|
||||||
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
|
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
outstruct.Str = *abi.ConvertType(out[1], new(string)).(*string)
|
outstruct.Str = *abi.ConvertType(out[1], new(string)).(*string)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackNamedOutput is the Go binding used to pack the parameters required for calling
|
// PackNamedOutput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x5e632bd5.
|
// the contract method with ID 0x5e632bd5. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function namedOutput() returns(string str)
|
// Solidity: function namedOutput() returns(string str)
|
||||||
func (outputChecker *OutputChecker) PackNamedOutput() []byte {
|
func (outputChecker *OutputChecker) PackNamedOutput() []byte {
|
||||||
|
|
@ -192,6 +230,15 @@ func (outputChecker *OutputChecker) PackNamedOutput() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNamedOutput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x5e632bd5. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function namedOutput() returns(string str)
|
||||||
|
func (outputChecker *OutputChecker) TryPackNamedOutput() ([]byte, error) {
|
||||||
|
return outputChecker.abi.Pack("namedOutput")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackNamedOutput is the Go binding that unpacks the parameters returned
|
// UnpackNamedOutput is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x5e632bd5.
|
// from invoking the contract method with ID 0x5e632bd5.
|
||||||
//
|
//
|
||||||
|
|
@ -202,11 +249,12 @@ func (outputChecker *OutputChecker) UnpackNamedOutput(data []byte) (string, erro
|
||||||
return *new(string), err
|
return *new(string), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackNamedOutputs is the Go binding used to pack the parameters required for calling
|
// PackNamedOutputs is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x7970a189.
|
// the contract method with ID 0x7970a189. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function namedOutputs() returns(string str1, string str2)
|
// Solidity: function namedOutputs() returns(string str1, string str2)
|
||||||
func (outputChecker *OutputChecker) PackNamedOutputs() []byte {
|
func (outputChecker *OutputChecker) PackNamedOutputs() []byte {
|
||||||
|
|
@ -217,6 +265,15 @@ func (outputChecker *OutputChecker) PackNamedOutputs() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNamedOutputs is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x7970a189. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function namedOutputs() returns(string str1, string str2)
|
||||||
|
func (outputChecker *OutputChecker) TryPackNamedOutputs() ([]byte, error) {
|
||||||
|
return outputChecker.abi.Pack("namedOutputs")
|
||||||
|
}
|
||||||
|
|
||||||
// NamedOutputsOutput serves as a container for the return parameters of contract
|
// NamedOutputsOutput serves as a container for the return parameters of contract
|
||||||
// method NamedOutputs.
|
// method NamedOutputs.
|
||||||
type NamedOutputsOutput struct {
|
type NamedOutputsOutput struct {
|
||||||
|
|
@ -236,12 +293,12 @@ func (outputChecker *OutputChecker) UnpackNamedOutputs(data []byte) (NamedOutput
|
||||||
}
|
}
|
||||||
outstruct.Str1 = *abi.ConvertType(out[0], new(string)).(*string)
|
outstruct.Str1 = *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
outstruct.Str2 = *abi.ConvertType(out[1], new(string)).(*string)
|
outstruct.Str2 = *abi.ConvertType(out[1], new(string)).(*string)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackNoOutput is the Go binding used to pack the parameters required for calling
|
// PackNoOutput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x625f0306.
|
// the contract method with ID 0x625f0306. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function noOutput() returns()
|
// Solidity: function noOutput() returns()
|
||||||
func (outputChecker *OutputChecker) PackNoOutput() []byte {
|
func (outputChecker *OutputChecker) PackNoOutput() []byte {
|
||||||
|
|
@ -251,3 +308,12 @@ func (outputChecker *OutputChecker) PackNoOutput() []byte {
|
||||||
}
|
}
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackNoOutput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x625f0306. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function noOutput() returns()
|
||||||
|
func (outputChecker *OutputChecker) TryPackNoOutput() ([]byte, error) {
|
||||||
|
return outputChecker.abi.Pack("noOutput")
|
||||||
|
}
|
||||||
|
|
|
||||||
24
accounts/abi/abigen/testdata/v2/overload.go.txt
vendored
24
accounts/abi/abigen/testdata/v2/overload.go.txt
vendored
|
|
@ -52,7 +52,8 @@ func (c *Overload) Instance(backend bind.ContractBackend, addr common.Address) *
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackFoo is the Go binding used to pack the parameters required for calling
|
// PackFoo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x04bc52f8.
|
// the contract method with ID 0x04bc52f8. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function foo(uint256 i, uint256 j) returns()
|
// Solidity: function foo(uint256 i, uint256 j) returns()
|
||||||
func (overload *Overload) PackFoo(i *big.Int, j *big.Int) []byte {
|
func (overload *Overload) PackFoo(i *big.Int, j *big.Int) []byte {
|
||||||
|
|
@ -63,8 +64,18 @@ func (overload *Overload) PackFoo(i *big.Int, j *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFoo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x04bc52f8. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function foo(uint256 i, uint256 j) returns()
|
||||||
|
func (overload *Overload) TryPackFoo(i *big.Int, j *big.Int) ([]byte, error) {
|
||||||
|
return overload.abi.Pack("foo", i, j)
|
||||||
|
}
|
||||||
|
|
||||||
// PackFoo0 is the Go binding used to pack the parameters required for calling
|
// PackFoo0 is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2fbebd38.
|
// the contract method with ID 0x2fbebd38. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function foo(uint256 i) returns()
|
// Solidity: function foo(uint256 i) returns()
|
||||||
func (overload *Overload) PackFoo0(i *big.Int) []byte {
|
func (overload *Overload) PackFoo0(i *big.Int) []byte {
|
||||||
|
|
@ -75,6 +86,15 @@ func (overload *Overload) PackFoo0(i *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFoo0 is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2fbebd38. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function foo(uint256 i) returns()
|
||||||
|
func (overload *Overload) TryPackFoo0(i *big.Int) ([]byte, error) {
|
||||||
|
return overload.abi.Pack("foo0", i)
|
||||||
|
}
|
||||||
|
|
||||||
// OverloadBar represents a bar event raised by the Overload contract.
|
// OverloadBar represents a bar event raised by the Overload contract.
|
||||||
type OverloadBar struct {
|
type OverloadBar struct {
|
||||||
I *big.Int
|
I *big.Int
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *RangeKeyword) Instance(backend bind.ContractBackend, addr common.Addres
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackFunctionWithKeywordParameter is the Go binding used to pack the parameters required for calling
|
// PackFunctionWithKeywordParameter is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x527a119f.
|
// the contract method with ID 0x527a119f. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function functionWithKeywordParameter(uint256 range) pure returns()
|
// Solidity: function functionWithKeywordParameter(uint256 range) pure returns()
|
||||||
func (rangeKeyword *RangeKeyword) PackFunctionWithKeywordParameter(arg0 *big.Int) []byte {
|
func (rangeKeyword *RangeKeyword) PackFunctionWithKeywordParameter(arg0 *big.Int) []byte {
|
||||||
|
|
@ -62,3 +63,12 @@ func (rangeKeyword *RangeKeyword) PackFunctionWithKeywordParameter(arg0 *big.Int
|
||||||
}
|
}
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFunctionWithKeywordParameter is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x527a119f. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function functionWithKeywordParameter(uint256 range) pure returns()
|
||||||
|
func (rangeKeyword *RangeKeyword) TryPackFunctionWithKeywordParameter(arg0 *big.Int) ([]byte, error) {
|
||||||
|
return rangeKeyword.abi.Pack("functionWithKeywordParameter", arg0)
|
||||||
|
}
|
||||||
|
|
|
||||||
56
accounts/abi/abigen/testdata/v2/slicer.go.txt
vendored
56
accounts/abi/abigen/testdata/v2/slicer.go.txt
vendored
|
|
@ -52,7 +52,8 @@ func (c *Slicer) Instance(backend bind.ContractBackend, addr common.Address) *bi
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackEchoAddresses is the Go binding used to pack the parameters required for calling
|
// PackEchoAddresses is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xbe1127a3.
|
// the contract method with ID 0xbe1127a3. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function echoAddresses(address[] input) returns(address[] output)
|
// Solidity: function echoAddresses(address[] input) returns(address[] output)
|
||||||
func (slicer *Slicer) PackEchoAddresses(input []common.Address) []byte {
|
func (slicer *Slicer) PackEchoAddresses(input []common.Address) []byte {
|
||||||
|
|
@ -63,6 +64,15 @@ func (slicer *Slicer) PackEchoAddresses(input []common.Address) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackEchoAddresses is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xbe1127a3. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function echoAddresses(address[] input) returns(address[] output)
|
||||||
|
func (slicer *Slicer) TryPackEchoAddresses(input []common.Address) ([]byte, error) {
|
||||||
|
return slicer.abi.Pack("echoAddresses", input)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackEchoAddresses is the Go binding that unpacks the parameters returned
|
// UnpackEchoAddresses is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xbe1127a3.
|
// from invoking the contract method with ID 0xbe1127a3.
|
||||||
//
|
//
|
||||||
|
|
@ -73,11 +83,12 @@ func (slicer *Slicer) UnpackEchoAddresses(data []byte) ([]common.Address, error)
|
||||||
return *new([]common.Address), err
|
return *new([]common.Address), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)
|
out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackEchoBools is the Go binding used to pack the parameters required for calling
|
// PackEchoBools is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xf637e589.
|
// the contract method with ID 0xf637e589. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function echoBools(bool[] input) returns(bool[] output)
|
// Solidity: function echoBools(bool[] input) returns(bool[] output)
|
||||||
func (slicer *Slicer) PackEchoBools(input []bool) []byte {
|
func (slicer *Slicer) PackEchoBools(input []bool) []byte {
|
||||||
|
|
@ -88,6 +99,15 @@ func (slicer *Slicer) PackEchoBools(input []bool) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackEchoBools is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xf637e589. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function echoBools(bool[] input) returns(bool[] output)
|
||||||
|
func (slicer *Slicer) TryPackEchoBools(input []bool) ([]byte, error) {
|
||||||
|
return slicer.abi.Pack("echoBools", input)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackEchoBools is the Go binding that unpacks the parameters returned
|
// UnpackEchoBools is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xf637e589.
|
// from invoking the contract method with ID 0xf637e589.
|
||||||
//
|
//
|
||||||
|
|
@ -98,11 +118,12 @@ func (slicer *Slicer) UnpackEchoBools(data []byte) ([]bool, error) {
|
||||||
return *new([]bool), err
|
return *new([]bool), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new([]bool)).(*[]bool)
|
out0 := *abi.ConvertType(out[0], new([]bool)).(*[]bool)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackEchoFancyInts is the Go binding used to pack the parameters required for calling
|
// PackEchoFancyInts is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xd88becc0.
|
// the contract method with ID 0xd88becc0. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function echoFancyInts(uint24[23] input) returns(uint24[23] output)
|
// Solidity: function echoFancyInts(uint24[23] input) returns(uint24[23] output)
|
||||||
func (slicer *Slicer) PackEchoFancyInts(input [23]*big.Int) []byte {
|
func (slicer *Slicer) PackEchoFancyInts(input [23]*big.Int) []byte {
|
||||||
|
|
@ -113,6 +134,15 @@ func (slicer *Slicer) PackEchoFancyInts(input [23]*big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackEchoFancyInts is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xd88becc0. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function echoFancyInts(uint24[23] input) returns(uint24[23] output)
|
||||||
|
func (slicer *Slicer) TryPackEchoFancyInts(input [23]*big.Int) ([]byte, error) {
|
||||||
|
return slicer.abi.Pack("echoFancyInts", input)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackEchoFancyInts is the Go binding that unpacks the parameters returned
|
// UnpackEchoFancyInts is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xd88becc0.
|
// from invoking the contract method with ID 0xd88becc0.
|
||||||
//
|
//
|
||||||
|
|
@ -123,11 +153,12 @@ func (slicer *Slicer) UnpackEchoFancyInts(data []byte) ([23]*big.Int, error) {
|
||||||
return *new([23]*big.Int), err
|
return *new([23]*big.Int), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new([23]*big.Int)).(*[23]*big.Int)
|
out0 := *abi.ConvertType(out[0], new([23]*big.Int)).(*[23]*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackEchoInts is the Go binding used to pack the parameters required for calling
|
// PackEchoInts is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xe15a3db7.
|
// the contract method with ID 0xe15a3db7. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function echoInts(int256[] input) returns(int256[] output)
|
// Solidity: function echoInts(int256[] input) returns(int256[] output)
|
||||||
func (slicer *Slicer) PackEchoInts(input []*big.Int) []byte {
|
func (slicer *Slicer) PackEchoInts(input []*big.Int) []byte {
|
||||||
|
|
@ -138,6 +169,15 @@ func (slicer *Slicer) PackEchoInts(input []*big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackEchoInts is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xe15a3db7. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function echoInts(int256[] input) returns(int256[] output)
|
||||||
|
func (slicer *Slicer) TryPackEchoInts(input []*big.Int) ([]byte, error) {
|
||||||
|
return slicer.abi.Pack("echoInts", input)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackEchoInts is the Go binding that unpacks the parameters returned
|
// UnpackEchoInts is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xe15a3db7.
|
// from invoking the contract method with ID 0xe15a3db7.
|
||||||
//
|
//
|
||||||
|
|
@ -148,5 +188,5 @@ func (slicer *Slicer) UnpackEchoInts(data []byte) ([]*big.Int, error) {
|
||||||
return *new([]*big.Int), err
|
return *new([]*big.Int), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int)
|
out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
116
accounts/abi/abigen/testdata/v2/structs-abi.go.txt
vendored
116
accounts/abi/abigen/testdata/v2/structs-abi.go.txt
vendored
|
|
@ -1,116 +0,0 @@
|
||||||
// Code generated via abigen V2 - DO NOT EDIT.
|
|
||||||
// This file is a generated binding and any manual changes will be lost.
|
|
||||||
|
|
||||||
package v1bindtests
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"errors"
|
|
||||||
"math/big"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
|
||||||
"github.com/ethereum/go-ethereum/accounts/abi/bind/v2"
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
|
||||||
var (
|
|
||||||
_ = bytes.Equal
|
|
||||||
_ = errors.New
|
|
||||||
_ = big.NewInt
|
|
||||||
_ = common.Big1
|
|
||||||
_ = types.BloomLookup
|
|
||||||
_ = abi.ConvertType
|
|
||||||
)
|
|
||||||
|
|
||||||
// Struct0 is an auto generated low-level Go binding around an user-defined struct.
|
|
||||||
type Struct0 struct {
|
|
||||||
B [32]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
// StructsMetaData contains all meta data concerning the Structs contract.
|
|
||||||
var StructsMetaData = bind.MetaData{
|
|
||||||
ABI: "[{\"inputs\":[],\"name\":\"F\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"B\",\"type\":\"bytes32\"}],\"internalType\":\"structStructs.A[]\",\"name\":\"a\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"c\",\"type\":\"uint256[]\"},{\"internalType\":\"bool[]\",\"name\":\"d\",\"type\":\"bool[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"G\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"B\",\"type\":\"bytes32\"}],\"internalType\":\"structStructs.A[]\",\"name\":\"a\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
|
|
||||||
ID: "Structs",
|
|
||||||
}
|
|
||||||
|
|
||||||
// Structs is an auto generated Go binding around an Ethereum contract.
|
|
||||||
type Structs struct {
|
|
||||||
abi abi.ABI
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewStructs creates a new instance of Structs.
|
|
||||||
func NewStructs() *Structs {
|
|
||||||
parsed, err := StructsMetaData.ParseABI()
|
|
||||||
if err != nil {
|
|
||||||
panic(errors.New("invalid ABI: " + err.Error()))
|
|
||||||
}
|
|
||||||
return &Structs{abi: *parsed}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Instance creates a wrapper for a deployed contract instance at the given address.
|
|
||||||
<<<<<<< HEAD
|
|
||||||
// Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc.
|
|
||||||
func (c *Structs) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {
|
|
||||||
return bind.NewBoundContract(addr, c.abi, backend, backend, backend)
|
|
||||||
=======
|
|
||||||
// Use this to create the instance object passed to abigen v2 library functions Call,
|
|
||||||
// Transact, etc.
|
|
||||||
func (c *Structs) Instance(backend bind.ContractBackend, addr common.Address) bind.BoundContract {
|
|
||||||
return bind.NewBoundContract(backend, addr, c.abi)
|
|
||||||
>>>>>>> 854c25e086 (accounts/abi/abigen: improve v2 template)
|
|
||||||
}
|
|
||||||
|
|
||||||
// F is the Go binding used to pack the parameters required for calling
|
|
||||||
// the contract method 0x28811f59.
|
|
||||||
//
|
|
||||||
// Solidity: function F() view returns((bytes32)[] a, uint256[] c, bool[] d)
|
|
||||||
func (structs *Structs) PackF() ([]byte, error) {
|
|
||||||
return structs.abi.Pack("F")
|
|
||||||
}
|
|
||||||
|
|
||||||
// FOutput serves as a container for the return parameters of contract
|
|
||||||
// method F.
|
|
||||||
type FOutput struct {
|
|
||||||
A []Struct0
|
|
||||||
C []*big.Int
|
|
||||||
D []bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnpackF is the Go binding that unpacks the parameters returned
|
|
||||||
// from invoking the contract method with ID 0x28811f59.
|
|
||||||
//
|
|
||||||
// Solidity: function F() view returns((bytes32)[] a, uint256[] c, bool[] d)
|
|
||||||
func (structs *Structs) UnpackF(data []byte) (*FOutput, error) {
|
|
||||||
out, err := structs.abi.Unpack("F", data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
ret := new(FOutput)
|
|
||||||
ret.A = *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
|
|
||||||
ret.C = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int)
|
|
||||||
ret.D = *abi.ConvertType(out[2], new([]bool)).(*[]bool)
|
|
||||||
return ret, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// G is the Go binding used to pack the parameters required for calling
|
|
||||||
// the contract method 0x6fecb623.
|
|
||||||
//
|
|
||||||
// Solidity: function G() view returns((bytes32)[] a)
|
|
||||||
func (structs *Structs) PackG() ([]byte, error) {
|
|
||||||
return structs.abi.Pack("G")
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnpackG is the Go binding that unpacks the parameters returned
|
|
||||||
// from invoking the contract method with ID 0x6fecb623.
|
|
||||||
//
|
|
||||||
// Solidity: function G() view returns((bytes32)[] a)
|
|
||||||
func (structs *Structs) UnpackG(data []byte) (*[]Struct0, error) {
|
|
||||||
out, err := structs.abi.Unpack("G", data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
out0 := *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
|
|
||||||
return &out0, nil
|
|
||||||
}
|
|
||||||
29
accounts/abi/abigen/testdata/v2/structs.go.txt
vendored
29
accounts/abi/abigen/testdata/v2/structs.go.txt
vendored
|
|
@ -57,7 +57,8 @@ func (c *Structs) Instance(backend bind.ContractBackend, addr common.Address) *b
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackF is the Go binding used to pack the parameters required for calling
|
// PackF is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x28811f59.
|
// the contract method with ID 0x28811f59. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function F() view returns((bytes32)[] a, uint256[] c, bool[] d)
|
// Solidity: function F() view returns((bytes32)[] a, uint256[] c, bool[] d)
|
||||||
func (structs *Structs) PackF() []byte {
|
func (structs *Structs) PackF() []byte {
|
||||||
|
|
@ -68,6 +69,15 @@ func (structs *Structs) PackF() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackF is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x28811f59. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function F() view returns((bytes32)[] a, uint256[] c, bool[] d)
|
||||||
|
func (structs *Structs) TryPackF() ([]byte, error) {
|
||||||
|
return structs.abi.Pack("F")
|
||||||
|
}
|
||||||
|
|
||||||
// FOutput serves as a container for the return parameters of contract
|
// FOutput serves as a container for the return parameters of contract
|
||||||
// method F.
|
// method F.
|
||||||
type FOutput struct {
|
type FOutput struct {
|
||||||
|
|
@ -89,12 +99,12 @@ func (structs *Structs) UnpackF(data []byte) (FOutput, error) {
|
||||||
outstruct.A = *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
|
outstruct.A = *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
|
||||||
outstruct.C = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int)
|
outstruct.C = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int)
|
||||||
outstruct.D = *abi.ConvertType(out[2], new([]bool)).(*[]bool)
|
outstruct.D = *abi.ConvertType(out[2], new([]bool)).(*[]bool)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackG is the Go binding used to pack the parameters required for calling
|
// PackG is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x6fecb623.
|
// the contract method with ID 0x6fecb623. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function G() view returns((bytes32)[] a)
|
// Solidity: function G() view returns((bytes32)[] a)
|
||||||
func (structs *Structs) PackG() []byte {
|
func (structs *Structs) PackG() []byte {
|
||||||
|
|
@ -105,6 +115,15 @@ func (structs *Structs) PackG() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackG is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x6fecb623. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function G() view returns((bytes32)[] a)
|
||||||
|
func (structs *Structs) TryPackG() ([]byte, error) {
|
||||||
|
return structs.abi.Pack("G")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackG is the Go binding that unpacks the parameters returned
|
// UnpackG is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x6fecb623.
|
// from invoking the contract method with ID 0x6fecb623.
|
||||||
//
|
//
|
||||||
|
|
@ -115,5 +134,5 @@ func (structs *Structs) UnpackG(data []byte) ([]Struct0, error) {
|
||||||
return *new([]Struct0), err
|
return *new([]Struct0), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
|
out0 := *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
124
accounts/abi/abigen/testdata/v2/token.go.txt
vendored
124
accounts/abi/abigen/testdata/v2/token.go.txt
vendored
|
|
@ -64,7 +64,8 @@ func (token *Token) PackConstructor(initialSupply *big.Int, tokenName string, de
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackAllowance is the Go binding used to pack the parameters required for calling
|
// PackAllowance is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xdd62ed3e.
|
// the contract method with ID 0xdd62ed3e. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function allowance(address , address ) returns(uint256)
|
// Solidity: function allowance(address , address ) returns(uint256)
|
||||||
func (token *Token) PackAllowance(arg0 common.Address, arg1 common.Address) []byte {
|
func (token *Token) PackAllowance(arg0 common.Address, arg1 common.Address) []byte {
|
||||||
|
|
@ -75,6 +76,15 @@ func (token *Token) PackAllowance(arg0 common.Address, arg1 common.Address) []by
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAllowance is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xdd62ed3e. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function allowance(address , address ) returns(uint256)
|
||||||
|
func (token *Token) TryPackAllowance(arg0 common.Address, arg1 common.Address) ([]byte, error) {
|
||||||
|
return token.abi.Pack("allowance", arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackAllowance is the Go binding that unpacks the parameters returned
|
// UnpackAllowance is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xdd62ed3e.
|
// from invoking the contract method with ID 0xdd62ed3e.
|
||||||
//
|
//
|
||||||
|
|
@ -85,11 +95,12 @@ func (token *Token) UnpackAllowance(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackApproveAndCall is the Go binding used to pack the parameters required for calling
|
// PackApproveAndCall is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xcae9ca51.
|
// the contract method with ID 0xcae9ca51. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns(bool success)
|
// Solidity: function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns(bool success)
|
||||||
func (token *Token) PackApproveAndCall(spender common.Address, value *big.Int, extraData []byte) []byte {
|
func (token *Token) PackApproveAndCall(spender common.Address, value *big.Int, extraData []byte) []byte {
|
||||||
|
|
@ -100,6 +111,15 @@ func (token *Token) PackApproveAndCall(spender common.Address, value *big.Int, e
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackApproveAndCall is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xcae9ca51. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns(bool success)
|
||||||
|
func (token *Token) TryPackApproveAndCall(spender common.Address, value *big.Int, extraData []byte) ([]byte, error) {
|
||||||
|
return token.abi.Pack("approveAndCall", spender, value, extraData)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackApproveAndCall is the Go binding that unpacks the parameters returned
|
// UnpackApproveAndCall is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xcae9ca51.
|
// from invoking the contract method with ID 0xcae9ca51.
|
||||||
//
|
//
|
||||||
|
|
@ -110,11 +130,12 @@ func (token *Token) UnpackApproveAndCall(data []byte) (bool, error) {
|
||||||
return *new(bool), err
|
return *new(bool), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackBalanceOf is the Go binding used to pack the parameters required for calling
|
// PackBalanceOf is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x70a08231.
|
// the contract method with ID 0x70a08231. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function balanceOf(address ) returns(uint256)
|
// Solidity: function balanceOf(address ) returns(uint256)
|
||||||
func (token *Token) PackBalanceOf(arg0 common.Address) []byte {
|
func (token *Token) PackBalanceOf(arg0 common.Address) []byte {
|
||||||
|
|
@ -125,6 +146,15 @@ func (token *Token) PackBalanceOf(arg0 common.Address) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackBalanceOf is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x70a08231. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function balanceOf(address ) returns(uint256)
|
||||||
|
func (token *Token) TryPackBalanceOf(arg0 common.Address) ([]byte, error) {
|
||||||
|
return token.abi.Pack("balanceOf", arg0)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackBalanceOf is the Go binding that unpacks the parameters returned
|
// UnpackBalanceOf is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x70a08231.
|
// from invoking the contract method with ID 0x70a08231.
|
||||||
//
|
//
|
||||||
|
|
@ -135,11 +165,12 @@ func (token *Token) UnpackBalanceOf(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDecimals is the Go binding used to pack the parameters required for calling
|
// PackDecimals is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x313ce567.
|
// the contract method with ID 0x313ce567. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function decimals() returns(uint8)
|
// Solidity: function decimals() returns(uint8)
|
||||||
func (token *Token) PackDecimals() []byte {
|
func (token *Token) PackDecimals() []byte {
|
||||||
|
|
@ -150,6 +181,15 @@ func (token *Token) PackDecimals() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDecimals is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x313ce567. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function decimals() returns(uint8)
|
||||||
|
func (token *Token) TryPackDecimals() ([]byte, error) {
|
||||||
|
return token.abi.Pack("decimals")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDecimals is the Go binding that unpacks the parameters returned
|
// UnpackDecimals is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x313ce567.
|
// from invoking the contract method with ID 0x313ce567.
|
||||||
//
|
//
|
||||||
|
|
@ -160,11 +200,12 @@ func (token *Token) UnpackDecimals(data []byte) (uint8, error) {
|
||||||
return *new(uint8), err
|
return *new(uint8), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
|
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackName is the Go binding used to pack the parameters required for calling
|
// PackName is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x06fdde03.
|
// the contract method with ID 0x06fdde03. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function name() returns(string)
|
// Solidity: function name() returns(string)
|
||||||
func (token *Token) PackName() []byte {
|
func (token *Token) PackName() []byte {
|
||||||
|
|
@ -175,6 +216,15 @@ func (token *Token) PackName() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackName is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x06fdde03. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function name() returns(string)
|
||||||
|
func (token *Token) TryPackName() ([]byte, error) {
|
||||||
|
return token.abi.Pack("name")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackName is the Go binding that unpacks the parameters returned
|
// UnpackName is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x06fdde03.
|
// from invoking the contract method with ID 0x06fdde03.
|
||||||
//
|
//
|
||||||
|
|
@ -185,11 +235,12 @@ func (token *Token) UnpackName(data []byte) (string, error) {
|
||||||
return *new(string), err
|
return *new(string), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackSpentAllowance is the Go binding used to pack the parameters required for calling
|
// PackSpentAllowance is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xdc3080f2.
|
// the contract method with ID 0xdc3080f2. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function spentAllowance(address , address ) returns(uint256)
|
// Solidity: function spentAllowance(address , address ) returns(uint256)
|
||||||
func (token *Token) PackSpentAllowance(arg0 common.Address, arg1 common.Address) []byte {
|
func (token *Token) PackSpentAllowance(arg0 common.Address, arg1 common.Address) []byte {
|
||||||
|
|
@ -200,6 +251,15 @@ func (token *Token) PackSpentAllowance(arg0 common.Address, arg1 common.Address)
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackSpentAllowance is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xdc3080f2. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function spentAllowance(address , address ) returns(uint256)
|
||||||
|
func (token *Token) TryPackSpentAllowance(arg0 common.Address, arg1 common.Address) ([]byte, error) {
|
||||||
|
return token.abi.Pack("spentAllowance", arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackSpentAllowance is the Go binding that unpacks the parameters returned
|
// UnpackSpentAllowance is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xdc3080f2.
|
// from invoking the contract method with ID 0xdc3080f2.
|
||||||
//
|
//
|
||||||
|
|
@ -210,11 +270,12 @@ func (token *Token) UnpackSpentAllowance(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackSymbol is the Go binding used to pack the parameters required for calling
|
// PackSymbol is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x95d89b41.
|
// the contract method with ID 0x95d89b41. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function symbol() returns(string)
|
// Solidity: function symbol() returns(string)
|
||||||
func (token *Token) PackSymbol() []byte {
|
func (token *Token) PackSymbol() []byte {
|
||||||
|
|
@ -225,6 +286,15 @@ func (token *Token) PackSymbol() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackSymbol is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x95d89b41. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function symbol() returns(string)
|
||||||
|
func (token *Token) TryPackSymbol() ([]byte, error) {
|
||||||
|
return token.abi.Pack("symbol")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackSymbol is the Go binding that unpacks the parameters returned
|
// UnpackSymbol is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x95d89b41.
|
// from invoking the contract method with ID 0x95d89b41.
|
||||||
//
|
//
|
||||||
|
|
@ -235,11 +305,12 @@ func (token *Token) UnpackSymbol(data []byte) (string, error) {
|
||||||
return *new(string), err
|
return *new(string), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
out0 := *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackTransfer is the Go binding used to pack the parameters required for calling
|
// PackTransfer is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xa9059cbb.
|
// the contract method with ID 0xa9059cbb. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function transfer(address _to, uint256 _value) returns()
|
// Solidity: function transfer(address _to, uint256 _value) returns()
|
||||||
func (token *Token) PackTransfer(to common.Address, value *big.Int) []byte {
|
func (token *Token) PackTransfer(to common.Address, value *big.Int) []byte {
|
||||||
|
|
@ -250,8 +321,18 @@ func (token *Token) PackTransfer(to common.Address, value *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTransfer is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xa9059cbb. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function transfer(address _to, uint256 _value) returns()
|
||||||
|
func (token *Token) TryPackTransfer(to common.Address, value *big.Int) ([]byte, error) {
|
||||||
|
return token.abi.Pack("transfer", to, value)
|
||||||
|
}
|
||||||
|
|
||||||
// PackTransferFrom is the Go binding used to pack the parameters required for calling
|
// PackTransferFrom is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x23b872dd.
|
// the contract method with ID 0x23b872dd. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool success)
|
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool success)
|
||||||
func (token *Token) PackTransferFrom(from common.Address, to common.Address, value *big.Int) []byte {
|
func (token *Token) PackTransferFrom(from common.Address, to common.Address, value *big.Int) []byte {
|
||||||
|
|
@ -262,6 +343,15 @@ func (token *Token) PackTransferFrom(from common.Address, to common.Address, val
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTransferFrom is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x23b872dd. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool success)
|
||||||
|
func (token *Token) TryPackTransferFrom(from common.Address, to common.Address, value *big.Int) ([]byte, error) {
|
||||||
|
return token.abi.Pack("transferFrom", from, to, value)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackTransferFrom is the Go binding that unpacks the parameters returned
|
// UnpackTransferFrom is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x23b872dd.
|
// from invoking the contract method with ID 0x23b872dd.
|
||||||
//
|
//
|
||||||
|
|
@ -272,7 +362,7 @@ func (token *Token) UnpackTransferFrom(data []byte) (bool, error) {
|
||||||
return *new(bool), err
|
return *new(bool), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TokenTransfer represents a Transfer event raised by the Token contract.
|
// TokenTransfer represents a Transfer event raised by the Token contract.
|
||||||
|
|
|
||||||
39
accounts/abi/abigen/testdata/v2/tuple.go.txt
vendored
39
accounts/abi/abigen/testdata/v2/tuple.go.txt
vendored
|
|
@ -77,7 +77,8 @@ func (c *Tuple) Instance(backend bind.ContractBackend, addr common.Address) *bin
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackFunc1 is the Go binding used to pack the parameters required for calling
|
// PackFunc1 is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x443c79b4.
|
// the contract method with ID 0x443c79b4. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function func1((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) pure returns((uint256,uint256[],(uint256,uint256)[]), (uint256,uint256)[2][], (uint256,uint256)[][2], (uint256,uint256[],(uint256,uint256)[])[], uint256[])
|
// Solidity: function func1((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) pure returns((uint256,uint256[],(uint256,uint256)[]), (uint256,uint256)[2][], (uint256,uint256)[][2], (uint256,uint256[],(uint256,uint256)[])[], uint256[])
|
||||||
func (tuple *Tuple) PackFunc1(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) []byte {
|
func (tuple *Tuple) PackFunc1(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) []byte {
|
||||||
|
|
@ -88,6 +89,15 @@ func (tuple *Tuple) PackFunc1(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFunc1 is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x443c79b4. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function func1((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) pure returns((uint256,uint256[],(uint256,uint256)[]), (uint256,uint256)[2][], (uint256,uint256)[][2], (uint256,uint256[],(uint256,uint256)[])[], uint256[])
|
||||||
|
func (tuple *Tuple) TryPackFunc1(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) ([]byte, error) {
|
||||||
|
return tuple.abi.Pack("func1", a, b, c, d, e)
|
||||||
|
}
|
||||||
|
|
||||||
// Func1Output serves as a container for the return parameters of contract
|
// Func1Output serves as a container for the return parameters of contract
|
||||||
// method Func1.
|
// method Func1.
|
||||||
type Func1Output struct {
|
type Func1Output struct {
|
||||||
|
|
@ -113,12 +123,12 @@ func (tuple *Tuple) UnpackFunc1(data []byte) (Func1Output, error) {
|
||||||
outstruct.Arg2 = *abi.ConvertType(out[2], new([2][]TupleT)).(*[2][]TupleT)
|
outstruct.Arg2 = *abi.ConvertType(out[2], new([2][]TupleT)).(*[2][]TupleT)
|
||||||
outstruct.Arg3 = *abi.ConvertType(out[3], new([]TupleS)).(*[]TupleS)
|
outstruct.Arg3 = *abi.ConvertType(out[3], new([]TupleS)).(*[]TupleS)
|
||||||
outstruct.Arg4 = *abi.ConvertType(out[4], new([]*big.Int)).(*[]*big.Int)
|
outstruct.Arg4 = *abi.ConvertType(out[4], new([]*big.Int)).(*[]*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackFunc2 is the Go binding used to pack the parameters required for calling
|
// PackFunc2 is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xd0062cdd.
|
// the contract method with ID 0xd0062cdd. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function func2((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) returns()
|
// Solidity: function func2((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) returns()
|
||||||
func (tuple *Tuple) PackFunc2(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) []byte {
|
func (tuple *Tuple) PackFunc2(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) []byte {
|
||||||
|
|
@ -129,8 +139,18 @@ func (tuple *Tuple) PackFunc2(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFunc2 is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xd0062cdd. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function func2((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) returns()
|
||||||
|
func (tuple *Tuple) TryPackFunc2(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) ([]byte, error) {
|
||||||
|
return tuple.abi.Pack("func2", a, b, c, d, e)
|
||||||
|
}
|
||||||
|
|
||||||
// PackFunc3 is the Go binding used to pack the parameters required for calling
|
// PackFunc3 is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xe4d9a43b.
|
// the contract method with ID 0xe4d9a43b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function func3((uint16,uint16)[] ) pure returns()
|
// Solidity: function func3((uint16,uint16)[] ) pure returns()
|
||||||
func (tuple *Tuple) PackFunc3(arg0 []TupleQ) []byte {
|
func (tuple *Tuple) PackFunc3(arg0 []TupleQ) []byte {
|
||||||
|
|
@ -141,6 +161,15 @@ func (tuple *Tuple) PackFunc3(arg0 []TupleQ) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFunc3 is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xe4d9a43b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function func3((uint16,uint16)[] ) pure returns()
|
||||||
|
func (tuple *Tuple) TryPackFunc3(arg0 []TupleQ) ([]byte, error) {
|
||||||
|
return tuple.abi.Pack("func3", arg0)
|
||||||
|
}
|
||||||
|
|
||||||
// TupleTupleEvent represents a TupleEvent event raised by the Tuple contract.
|
// TupleTupleEvent represents a TupleEvent event raised by the Tuple contract.
|
||||||
type TupleTupleEvent struct {
|
type TupleTupleEvent struct {
|
||||||
A TupleS
|
A TupleS
|
||||||
|
|
|
||||||
15
accounts/abi/abigen/testdata/v2/tupler.go.txt
vendored
15
accounts/abi/abigen/testdata/v2/tupler.go.txt
vendored
|
|
@ -52,7 +52,8 @@ func (c *Tupler) Instance(backend bind.ContractBackend, addr common.Address) *bi
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackTuple is the Go binding used to pack the parameters required for calling
|
// PackTuple is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x3175aae2.
|
// the contract method with ID 0x3175aae2. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function tuple() returns(string a, int256 b, bytes32 c)
|
// Solidity: function tuple() returns(string a, int256 b, bytes32 c)
|
||||||
func (tupler *Tupler) PackTuple() []byte {
|
func (tupler *Tupler) PackTuple() []byte {
|
||||||
|
|
@ -63,6 +64,15 @@ func (tupler *Tupler) PackTuple() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackTuple is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x3175aae2. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function tuple() returns(string a, int256 b, bytes32 c)
|
||||||
|
func (tupler *Tupler) TryPackTuple() ([]byte, error) {
|
||||||
|
return tupler.abi.Pack("tuple")
|
||||||
|
}
|
||||||
|
|
||||||
// TupleOutput serves as a container for the return parameters of contract
|
// TupleOutput serves as a container for the return parameters of contract
|
||||||
// method Tuple.
|
// method Tuple.
|
||||||
type TupleOutput struct {
|
type TupleOutput struct {
|
||||||
|
|
@ -84,6 +94,5 @@ func (tupler *Tupler) UnpackTuple(data []byte) (TupleOutput, error) {
|
||||||
outstruct.A = *abi.ConvertType(out[0], new(string)).(*string)
|
outstruct.A = *abi.ConvertType(out[0], new(string)).(*string)
|
||||||
outstruct.B = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.B = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
outstruct.C = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
|
outstruct.C = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
119
accounts/abi/abigen/testdata/v2/underscorer.go.txt
vendored
119
accounts/abi/abigen/testdata/v2/underscorer.go.txt
vendored
|
|
@ -52,7 +52,8 @@ func (c *Underscorer) Instance(backend bind.ContractBackend, addr common.Address
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackAllPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
// PackAllPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xb564b34d.
|
// the contract method with ID 0xb564b34d. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function AllPurelyUnderscoredOutput() view returns(int256 _, int256 __)
|
// Solidity: function AllPurelyUnderscoredOutput() view returns(int256 _, int256 __)
|
||||||
func (underscorer *Underscorer) PackAllPurelyUnderscoredOutput() []byte {
|
func (underscorer *Underscorer) PackAllPurelyUnderscoredOutput() []byte {
|
||||||
|
|
@ -63,6 +64,15 @@ func (underscorer *Underscorer) PackAllPurelyUnderscoredOutput() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackAllPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xb564b34d. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function AllPurelyUnderscoredOutput() view returns(int256 _, int256 __)
|
||||||
|
func (underscorer *Underscorer) TryPackAllPurelyUnderscoredOutput() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("AllPurelyUnderscoredOutput")
|
||||||
|
}
|
||||||
|
|
||||||
// AllPurelyUnderscoredOutputOutput serves as a container for the return parameters of contract
|
// AllPurelyUnderscoredOutputOutput serves as a container for the return parameters of contract
|
||||||
// method AllPurelyUnderscoredOutput.
|
// method AllPurelyUnderscoredOutput.
|
||||||
type AllPurelyUnderscoredOutputOutput struct {
|
type AllPurelyUnderscoredOutputOutput struct {
|
||||||
|
|
@ -82,12 +92,12 @@ func (underscorer *Underscorer) UnpackAllPurelyUnderscoredOutput(data []byte) (A
|
||||||
}
|
}
|
||||||
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackLowerLowerCollision is the Go binding used to pack the parameters required for calling
|
// PackLowerLowerCollision is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xe409ca45.
|
// the contract method with ID 0xe409ca45. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function LowerLowerCollision() view returns(int256 _res, int256 res)
|
// Solidity: function LowerLowerCollision() view returns(int256 _res, int256 res)
|
||||||
func (underscorer *Underscorer) PackLowerLowerCollision() []byte {
|
func (underscorer *Underscorer) PackLowerLowerCollision() []byte {
|
||||||
|
|
@ -98,6 +108,15 @@ func (underscorer *Underscorer) PackLowerLowerCollision() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackLowerLowerCollision is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xe409ca45. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function LowerLowerCollision() view returns(int256 _res, int256 res)
|
||||||
|
func (underscorer *Underscorer) TryPackLowerLowerCollision() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("LowerLowerCollision")
|
||||||
|
}
|
||||||
|
|
||||||
// LowerLowerCollisionOutput serves as a container for the return parameters of contract
|
// LowerLowerCollisionOutput serves as a container for the return parameters of contract
|
||||||
// method LowerLowerCollision.
|
// method LowerLowerCollision.
|
||||||
type LowerLowerCollisionOutput struct {
|
type LowerLowerCollisionOutput struct {
|
||||||
|
|
@ -117,12 +136,12 @@ func (underscorer *Underscorer) UnpackLowerLowerCollision(data []byte) (LowerLow
|
||||||
}
|
}
|
||||||
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackLowerUpperCollision is the Go binding used to pack the parameters required for calling
|
// PackLowerUpperCollision is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x03a59213.
|
// the contract method with ID 0x03a59213. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function LowerUpperCollision() view returns(int256 _res, int256 Res)
|
// Solidity: function LowerUpperCollision() view returns(int256 _res, int256 Res)
|
||||||
func (underscorer *Underscorer) PackLowerUpperCollision() []byte {
|
func (underscorer *Underscorer) PackLowerUpperCollision() []byte {
|
||||||
|
|
@ -133,6 +152,15 @@ func (underscorer *Underscorer) PackLowerUpperCollision() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackLowerUpperCollision is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x03a59213. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function LowerUpperCollision() view returns(int256 _res, int256 Res)
|
||||||
|
func (underscorer *Underscorer) TryPackLowerUpperCollision() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("LowerUpperCollision")
|
||||||
|
}
|
||||||
|
|
||||||
// LowerUpperCollisionOutput serves as a container for the return parameters of contract
|
// LowerUpperCollisionOutput serves as a container for the return parameters of contract
|
||||||
// method LowerUpperCollision.
|
// method LowerUpperCollision.
|
||||||
type LowerUpperCollisionOutput struct {
|
type LowerUpperCollisionOutput struct {
|
||||||
|
|
@ -152,12 +180,12 @@ func (underscorer *Underscorer) UnpackLowerUpperCollision(data []byte) (LowerUpp
|
||||||
}
|
}
|
||||||
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
// PackPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x9df48485.
|
// the contract method with ID 0x9df48485. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function PurelyUnderscoredOutput() view returns(int256 _, int256 res)
|
// Solidity: function PurelyUnderscoredOutput() view returns(int256 _, int256 res)
|
||||||
func (underscorer *Underscorer) PackPurelyUnderscoredOutput() []byte {
|
func (underscorer *Underscorer) PackPurelyUnderscoredOutput() []byte {
|
||||||
|
|
@ -168,6 +196,15 @@ func (underscorer *Underscorer) PackPurelyUnderscoredOutput() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x9df48485. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function PurelyUnderscoredOutput() view returns(int256 _, int256 res)
|
||||||
|
func (underscorer *Underscorer) TryPackPurelyUnderscoredOutput() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("PurelyUnderscoredOutput")
|
||||||
|
}
|
||||||
|
|
||||||
// PurelyUnderscoredOutputOutput serves as a container for the return parameters of contract
|
// PurelyUnderscoredOutputOutput serves as a container for the return parameters of contract
|
||||||
// method PurelyUnderscoredOutput.
|
// method PurelyUnderscoredOutput.
|
||||||
type PurelyUnderscoredOutputOutput struct {
|
type PurelyUnderscoredOutputOutput struct {
|
||||||
|
|
@ -187,12 +224,12 @@ func (underscorer *Underscorer) UnpackPurelyUnderscoredOutput(data []byte) (Pure
|
||||||
}
|
}
|
||||||
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Res = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Res = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
// PackUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x67e6633d.
|
// the contract method with ID 0x67e6633d. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function UnderscoredOutput() view returns(int256 _int, string _string)
|
// Solidity: function UnderscoredOutput() view returns(int256 _int, string _string)
|
||||||
func (underscorer *Underscorer) PackUnderscoredOutput() []byte {
|
func (underscorer *Underscorer) PackUnderscoredOutput() []byte {
|
||||||
|
|
@ -203,6 +240,15 @@ func (underscorer *Underscorer) PackUnderscoredOutput() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackUnderscoredOutput is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x67e6633d. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function UnderscoredOutput() view returns(int256 _int, string _string)
|
||||||
|
func (underscorer *Underscorer) TryPackUnderscoredOutput() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("UnderscoredOutput")
|
||||||
|
}
|
||||||
|
|
||||||
// UnderscoredOutputOutput serves as a container for the return parameters of contract
|
// UnderscoredOutputOutput serves as a container for the return parameters of contract
|
||||||
// method UnderscoredOutput.
|
// method UnderscoredOutput.
|
||||||
type UnderscoredOutputOutput struct {
|
type UnderscoredOutputOutput struct {
|
||||||
|
|
@ -222,12 +268,12 @@ func (underscorer *Underscorer) UnpackUnderscoredOutput(data []byte) (Underscore
|
||||||
}
|
}
|
||||||
outstruct.Int = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Int = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.String = *abi.ConvertType(out[1], new(string)).(*string)
|
outstruct.String = *abi.ConvertType(out[1], new(string)).(*string)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackUpperLowerCollision is the Go binding used to pack the parameters required for calling
|
// PackUpperLowerCollision is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xaf7486ab.
|
// the contract method with ID 0xaf7486ab. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function UpperLowerCollision() view returns(int256 _Res, int256 res)
|
// Solidity: function UpperLowerCollision() view returns(int256 _Res, int256 res)
|
||||||
func (underscorer *Underscorer) PackUpperLowerCollision() []byte {
|
func (underscorer *Underscorer) PackUpperLowerCollision() []byte {
|
||||||
|
|
@ -238,6 +284,15 @@ func (underscorer *Underscorer) PackUpperLowerCollision() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackUpperLowerCollision is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xaf7486ab. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function UpperLowerCollision() view returns(int256 _Res, int256 res)
|
||||||
|
func (underscorer *Underscorer) TryPackUpperLowerCollision() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("UpperLowerCollision")
|
||||||
|
}
|
||||||
|
|
||||||
// UpperLowerCollisionOutput serves as a container for the return parameters of contract
|
// UpperLowerCollisionOutput serves as a container for the return parameters of contract
|
||||||
// method UpperLowerCollision.
|
// method UpperLowerCollision.
|
||||||
type UpperLowerCollisionOutput struct {
|
type UpperLowerCollisionOutput struct {
|
||||||
|
|
@ -257,12 +312,12 @@ func (underscorer *Underscorer) UnpackUpperLowerCollision(data []byte) (UpperLow
|
||||||
}
|
}
|
||||||
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackUpperUpperCollision is the Go binding used to pack the parameters required for calling
|
// PackUpperUpperCollision is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xe02ab24d.
|
// the contract method with ID 0xe02ab24d. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function UpperUpperCollision() view returns(int256 _Res, int256 Res)
|
// Solidity: function UpperUpperCollision() view returns(int256 _Res, int256 Res)
|
||||||
func (underscorer *Underscorer) PackUpperUpperCollision() []byte {
|
func (underscorer *Underscorer) PackUpperUpperCollision() []byte {
|
||||||
|
|
@ -273,6 +328,15 @@ func (underscorer *Underscorer) PackUpperUpperCollision() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackUpperUpperCollision is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xe02ab24d. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function UpperUpperCollision() view returns(int256 _Res, int256 Res)
|
||||||
|
func (underscorer *Underscorer) TryPackUpperUpperCollision() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("UpperUpperCollision")
|
||||||
|
}
|
||||||
|
|
||||||
// UpperUpperCollisionOutput serves as a container for the return parameters of contract
|
// UpperUpperCollisionOutput serves as a container for the return parameters of contract
|
||||||
// method UpperUpperCollision.
|
// method UpperUpperCollision.
|
||||||
type UpperUpperCollisionOutput struct {
|
type UpperUpperCollisionOutput struct {
|
||||||
|
|
@ -292,12 +356,12 @@ func (underscorer *Underscorer) UnpackUpperUpperCollision(data []byte) (UpperUpp
|
||||||
}
|
}
|
||||||
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackUnderScoredFunc is the Go binding used to pack the parameters required for calling
|
// PackUnderScoredFunc is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x46546dbe.
|
// the contract method with ID 0x46546dbe. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function _under_scored_func() view returns(int256 _int)
|
// Solidity: function _under_scored_func() view returns(int256 _int)
|
||||||
func (underscorer *Underscorer) PackUnderScoredFunc() []byte {
|
func (underscorer *Underscorer) PackUnderScoredFunc() []byte {
|
||||||
|
|
@ -308,6 +372,15 @@ func (underscorer *Underscorer) PackUnderScoredFunc() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackUnderScoredFunc is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x46546dbe. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function _under_scored_func() view returns(int256 _int)
|
||||||
|
func (underscorer *Underscorer) TryPackUnderScoredFunc() ([]byte, error) {
|
||||||
|
return underscorer.abi.Pack("_under_scored_func")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackUnderScoredFunc is the Go binding that unpacks the parameters returned
|
// UnpackUnderScoredFunc is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x46546dbe.
|
// from invoking the contract method with ID 0x46546dbe.
|
||||||
//
|
//
|
||||||
|
|
@ -318,5 +391,5 @@ func (underscorer *Underscorer) UnpackUnderScoredFunc(data []byte) (*big.Int, er
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,8 @@ func (c *DB) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackGet is the Go binding used to pack the parameters required for calling
|
// PackGet is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x9507d39a.
|
// the contract method with ID 0x9507d39a. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function get(uint256 k) returns(uint256)
|
// Solidity: function get(uint256 k) returns(uint256)
|
||||||
func (dB *DB) PackGet(k *big.Int) []byte {
|
func (dB *DB) PackGet(k *big.Int) []byte {
|
||||||
|
|
@ -70,6 +71,15 @@ func (dB *DB) PackGet(k *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackGet is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x9507d39a. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function get(uint256 k) returns(uint256)
|
||||||
|
func (dB *DB) TryPackGet(k *big.Int) ([]byte, error) {
|
||||||
|
return dB.abi.Pack("get", k)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackGet is the Go binding that unpacks the parameters returned
|
// UnpackGet is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x9507d39a.
|
// from invoking the contract method with ID 0x9507d39a.
|
||||||
//
|
//
|
||||||
|
|
@ -80,11 +90,12 @@ func (dB *DB) UnpackGet(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackGetNamedStatParams is the Go binding used to pack the parameters required for calling
|
// PackGetNamedStatParams is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xe369ba3b.
|
// the contract method with ID 0xe369ba3b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function getNamedStatParams() view returns(uint256 gets, uint256 inserts, uint256 mods)
|
// Solidity: function getNamedStatParams() view returns(uint256 gets, uint256 inserts, uint256 mods)
|
||||||
func (dB *DB) PackGetNamedStatParams() []byte {
|
func (dB *DB) PackGetNamedStatParams() []byte {
|
||||||
|
|
@ -95,6 +106,15 @@ func (dB *DB) PackGetNamedStatParams() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackGetNamedStatParams is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xe369ba3b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function getNamedStatParams() view returns(uint256 gets, uint256 inserts, uint256 mods)
|
||||||
|
func (dB *DB) TryPackGetNamedStatParams() ([]byte, error) {
|
||||||
|
return dB.abi.Pack("getNamedStatParams")
|
||||||
|
}
|
||||||
|
|
||||||
// GetNamedStatParamsOutput serves as a container for the return parameters of contract
|
// GetNamedStatParamsOutput serves as a container for the return parameters of contract
|
||||||
// method GetNamedStatParams.
|
// method GetNamedStatParams.
|
||||||
type GetNamedStatParamsOutput struct {
|
type GetNamedStatParamsOutput struct {
|
||||||
|
|
@ -116,12 +136,12 @@ func (dB *DB) UnpackGetNamedStatParams(data []byte) (GetNamedStatParamsOutput, e
|
||||||
outstruct.Gets = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Gets = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Inserts = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Inserts = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
outstruct.Mods = abi.ConvertType(out[2], new(big.Int)).(*big.Int)
|
outstruct.Mods = abi.ConvertType(out[2], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackGetStatParams is the Go binding used to pack the parameters required for calling
|
// PackGetStatParams is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x6fcb9c70.
|
// the contract method with ID 0x6fcb9c70. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function getStatParams() view returns(uint256, uint256, uint256)
|
// Solidity: function getStatParams() view returns(uint256, uint256, uint256)
|
||||||
func (dB *DB) PackGetStatParams() []byte {
|
func (dB *DB) PackGetStatParams() []byte {
|
||||||
|
|
@ -132,6 +152,15 @@ func (dB *DB) PackGetStatParams() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackGetStatParams is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x6fcb9c70. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function getStatParams() view returns(uint256, uint256, uint256)
|
||||||
|
func (dB *DB) TryPackGetStatParams() ([]byte, error) {
|
||||||
|
return dB.abi.Pack("getStatParams")
|
||||||
|
}
|
||||||
|
|
||||||
// GetStatParamsOutput serves as a container for the return parameters of contract
|
// GetStatParamsOutput serves as a container for the return parameters of contract
|
||||||
// method GetStatParams.
|
// method GetStatParams.
|
||||||
type GetStatParamsOutput struct {
|
type GetStatParamsOutput struct {
|
||||||
|
|
@ -153,12 +182,12 @@ func (dB *DB) UnpackGetStatParams(data []byte) (GetStatParamsOutput, error) {
|
||||||
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
|
||||||
outstruct.Arg2 = abi.ConvertType(out[2], new(big.Int)).(*big.Int)
|
outstruct.Arg2 = abi.ConvertType(out[2], new(big.Int)).(*big.Int)
|
||||||
return *outstruct, err
|
return *outstruct, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackGetStatsStruct is the Go binding used to pack the parameters required for calling
|
// PackGetStatsStruct is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xee8161e0.
|
// the contract method with ID 0xee8161e0. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function getStatsStruct() view returns((uint256,uint256,uint256))
|
// Solidity: function getStatsStruct() view returns((uint256,uint256,uint256))
|
||||||
func (dB *DB) PackGetStatsStruct() []byte {
|
func (dB *DB) PackGetStatsStruct() []byte {
|
||||||
|
|
@ -169,6 +198,15 @@ func (dB *DB) PackGetStatsStruct() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackGetStatsStruct is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xee8161e0. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function getStatsStruct() view returns((uint256,uint256,uint256))
|
||||||
|
func (dB *DB) TryPackGetStatsStruct() ([]byte, error) {
|
||||||
|
return dB.abi.Pack("getStatsStruct")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackGetStatsStruct is the Go binding that unpacks the parameters returned
|
// UnpackGetStatsStruct is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xee8161e0.
|
// from invoking the contract method with ID 0xee8161e0.
|
||||||
//
|
//
|
||||||
|
|
@ -179,11 +217,12 @@ func (dB *DB) UnpackGetStatsStruct(data []byte) (DBStats, error) {
|
||||||
return *new(DBStats), err
|
return *new(DBStats), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new(DBStats)).(*DBStats)
|
out0 := *abi.ConvertType(out[0], new(DBStats)).(*DBStats)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackInsert is the Go binding used to pack the parameters required for calling
|
// PackInsert is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x1d834a1b.
|
// the contract method with ID 0x1d834a1b. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function insert(uint256 k, uint256 v) returns(uint256)
|
// Solidity: function insert(uint256 k, uint256 v) returns(uint256)
|
||||||
func (dB *DB) PackInsert(k *big.Int, v *big.Int) []byte {
|
func (dB *DB) PackInsert(k *big.Int, v *big.Int) []byte {
|
||||||
|
|
@ -194,6 +233,15 @@ func (dB *DB) PackInsert(k *big.Int, v *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackInsert is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x1d834a1b. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function insert(uint256 k, uint256 v) returns(uint256)
|
||||||
|
func (dB *DB) TryPackInsert(k *big.Int, v *big.Int) ([]byte, error) {
|
||||||
|
return dB.abi.Pack("insert", k, v)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackInsert is the Go binding that unpacks the parameters returned
|
// UnpackInsert is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x1d834a1b.
|
// from invoking the contract method with ID 0x1d834a1b.
|
||||||
//
|
//
|
||||||
|
|
@ -204,7 +252,7 @@ func (dB *DB) UnpackInsert(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBInsert represents a Insert event raised by the DB contract.
|
// DBInsert represents a Insert event raised by the DB contract.
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *C) Instance(backend bind.ContractBackend, addr common.Address) *bind.Bo
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackEmitMulti is the Go binding used to pack the parameters required for calling
|
// PackEmitMulti is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xcb493749.
|
// the contract method with ID 0xcb493749. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function EmitMulti() returns()
|
// Solidity: function EmitMulti() returns()
|
||||||
func (c *C) PackEmitMulti() []byte {
|
func (c *C) PackEmitMulti() []byte {
|
||||||
|
|
@ -63,8 +64,18 @@ func (c *C) PackEmitMulti() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackEmitMulti is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xcb493749. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function EmitMulti() returns()
|
||||||
|
func (c *C) TryPackEmitMulti() ([]byte, error) {
|
||||||
|
return c.abi.Pack("EmitMulti")
|
||||||
|
}
|
||||||
|
|
||||||
// PackEmitOne is the Go binding used to pack the parameters required for calling
|
// PackEmitOne is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xe8e49a71.
|
// the contract method with ID 0xe8e49a71. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function EmitOne() returns()
|
// Solidity: function EmitOne() returns()
|
||||||
func (c *C) PackEmitOne() []byte {
|
func (c *C) PackEmitOne() []byte {
|
||||||
|
|
@ -75,6 +86,15 @@ func (c *C) PackEmitOne() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackEmitOne is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xe8e49a71. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function EmitOne() returns()
|
||||||
|
func (c *C) TryPackEmitOne() ([]byte, error) {
|
||||||
|
return c.abi.Pack("EmitOne")
|
||||||
|
}
|
||||||
|
|
||||||
// CBasic1 represents a basic1 event raised by the C contract.
|
// CBasic1 represents a basic1 event raised by the C contract.
|
||||||
type CBasic1 struct {
|
type CBasic1 struct {
|
||||||
Id *big.Int
|
Id *big.Int
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,8 @@ func (c1 *C1) PackConstructor(v1 *big.Int, v2 *big.Int) []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256 res)
|
// Solidity: function Do(uint256 val) pure returns(uint256 res)
|
||||||
func (c1 *C1) PackDo(val *big.Int) []byte {
|
func (c1 *C1) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -79,6 +80,15 @@ func (c1 *C1) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256 res)
|
||||||
|
func (c1 *C1) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return c1.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -89,7 +99,7 @@ func (c1 *C1) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2MetaData contains all meta data concerning the C2 contract.
|
// C2MetaData contains all meta data concerning the C2 contract.
|
||||||
|
|
@ -136,7 +146,8 @@ func (c2 *C2) PackConstructor(v1 *big.Int, v2 *big.Int) []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256 res)
|
// Solidity: function Do(uint256 val) pure returns(uint256 res)
|
||||||
func (c2 *C2) PackDo(val *big.Int) []byte {
|
func (c2 *C2) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -147,6 +158,15 @@ func (c2 *C2) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256 res)
|
||||||
|
func (c2 *C2) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return c2.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -157,7 +177,7 @@ func (c2 *C2) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// L1MetaData contains all meta data concerning the L1 contract.
|
// L1MetaData contains all meta data concerning the L1 contract.
|
||||||
|
|
@ -188,7 +208,8 @@ func (c *L1) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256)
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
func (l1 *L1) PackDo(val *big.Int) []byte {
|
func (l1 *L1) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -199,6 +220,15 @@ func (l1 *L1) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
|
func (l1 *L1) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return l1.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -209,7 +239,7 @@ func (l1 *L1) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// L2MetaData contains all meta data concerning the L2 contract.
|
// L2MetaData contains all meta data concerning the L2 contract.
|
||||||
|
|
@ -243,7 +273,8 @@ func (c *L2) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256)
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
func (l2 *L2) PackDo(val *big.Int) []byte {
|
func (l2 *L2) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -254,6 +285,15 @@ func (l2 *L2) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
|
func (l2 *L2) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return l2.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -264,7 +304,7 @@ func (l2 *L2) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// L2bMetaData contains all meta data concerning the L2b contract.
|
// L2bMetaData contains all meta data concerning the L2b contract.
|
||||||
|
|
@ -298,7 +338,8 @@ func (c *L2b) Instance(backend bind.ContractBackend, addr common.Address) *bind.
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256)
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
func (l2b *L2b) PackDo(val *big.Int) []byte {
|
func (l2b *L2b) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -309,6 +350,15 @@ func (l2b *L2b) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
|
func (l2b *L2b) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return l2b.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -319,7 +369,7 @@ func (l2b *L2b) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// L3MetaData contains all meta data concerning the L3 contract.
|
// L3MetaData contains all meta data concerning the L3 contract.
|
||||||
|
|
@ -350,7 +400,8 @@ func (c *L3) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256)
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
func (l3 *L3) PackDo(val *big.Int) []byte {
|
func (l3 *L3) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -361,6 +412,15 @@ func (l3 *L3) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
|
func (l3 *L3) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return l3.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -371,7 +431,7 @@ func (l3 *L3) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// L4MetaData contains all meta data concerning the L4 contract.
|
// L4MetaData contains all meta data concerning the L4 contract.
|
||||||
|
|
@ -406,7 +466,8 @@ func (c *L4) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256)
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
func (l4 *L4) PackDo(val *big.Int) []byte {
|
func (l4 *L4) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -417,6 +478,15 @@ func (l4 *L4) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
|
func (l4 *L4) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return l4.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -427,7 +497,7 @@ func (l4 *L4) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// L4bMetaData contains all meta data concerning the L4b contract.
|
// L4bMetaData contains all meta data concerning the L4b contract.
|
||||||
|
|
@ -461,7 +531,8 @@ func (c *L4b) Instance(backend bind.ContractBackend, addr common.Address) *bind.
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackDo is the Go binding used to pack the parameters required for calling
|
// PackDo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0x2ad11272.
|
// the contract method with ID 0x2ad11272. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Do(uint256 val) pure returns(uint256)
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
func (l4b *L4b) PackDo(val *big.Int) []byte {
|
func (l4b *L4b) PackDo(val *big.Int) []byte {
|
||||||
|
|
@ -472,6 +543,15 @@ func (l4b *L4b) PackDo(val *big.Int) []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackDo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0x2ad11272. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Do(uint256 val) pure returns(uint256)
|
||||||
|
func (l4b *L4b) TryPackDo(val *big.Int) ([]byte, error) {
|
||||||
|
return l4b.abi.Pack("Do", val)
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackDo is the Go binding that unpacks the parameters returned
|
// UnpackDo is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x2ad11272.
|
// from invoking the contract method with ID 0x2ad11272.
|
||||||
//
|
//
|
||||||
|
|
@ -482,5 +562,5 @@ func (l4b *L4b) UnpackDo(data []byte) (*big.Int, error) {
|
||||||
return new(big.Int), err
|
return new(big.Int), err
|
||||||
}
|
}
|
||||||
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *C) Instance(backend bind.ContractBackend, addr common.Address) *bind.Bo
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackBar is the Go binding used to pack the parameters required for calling
|
// PackBar is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xb0a378b0.
|
// the contract method with ID 0xb0a378b0. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Bar() pure returns()
|
// Solidity: function Bar() pure returns()
|
||||||
func (c *C) PackBar() []byte {
|
func (c *C) PackBar() []byte {
|
||||||
|
|
@ -63,8 +64,18 @@ func (c *C) PackBar() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackBar is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xb0a378b0. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Bar() pure returns()
|
||||||
|
func (c *C) TryPackBar() ([]byte, error) {
|
||||||
|
return c.abi.Pack("Bar")
|
||||||
|
}
|
||||||
|
|
||||||
// PackFoo is the Go binding used to pack the parameters required for calling
|
// PackFoo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xbfb4ebcf.
|
// the contract method with ID 0xbfb4ebcf. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Foo() pure returns()
|
// Solidity: function Foo() pure returns()
|
||||||
func (c *C) PackFoo() []byte {
|
func (c *C) PackFoo() []byte {
|
||||||
|
|
@ -75,6 +86,15 @@ func (c *C) PackFoo() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFoo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xbfb4ebcf. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Foo() pure returns()
|
||||||
|
func (c *C) TryPackFoo() ([]byte, error) {
|
||||||
|
return c.abi.Pack("Foo")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackError attempts to decode the provided error data using user-defined
|
// UnpackError attempts to decode the provided error data using user-defined
|
||||||
// error definitions.
|
// error definitions.
|
||||||
func (c *C) UnpackError(raw []byte) (any, error) {
|
func (c *C) UnpackError(raw []byte) (any, error) {
|
||||||
|
|
@ -169,7 +189,8 @@ func (c *C2) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackFoo is the Go binding used to pack the parameters required for calling
|
// PackFoo is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xbfb4ebcf.
|
// the contract method with ID 0xbfb4ebcf. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function Foo() pure returns()
|
// Solidity: function Foo() pure returns()
|
||||||
func (c2 *C2) PackFoo() []byte {
|
func (c2 *C2) PackFoo() []byte {
|
||||||
|
|
@ -180,6 +201,15 @@ func (c2 *C2) PackFoo() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackFoo is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xbfb4ebcf. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function Foo() pure returns()
|
||||||
|
func (c2 *C2) TryPackFoo() ([]byte, error) {
|
||||||
|
return c2.abi.Pack("Foo")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackError attempts to decode the provided error data using user-defined
|
// UnpackError attempts to decode the provided error data using user-defined
|
||||||
// error definitions.
|
// error definitions.
|
||||||
func (c2 *C2) UnpackError(raw []byte) (any, error) {
|
func (c2 *C2) UnpackError(raw []byte) (any, error) {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ func (c *MyContract) Instance(backend bind.ContractBackend, addr common.Address)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackGetNums is the Go binding used to pack the parameters required for calling
|
// PackGetNums is the Go binding used to pack the parameters required for calling
|
||||||
// the contract method with ID 0xbd6d1007.
|
// the contract method with ID 0xbd6d1007. This method will panic if any
|
||||||
|
// invalid/nil inputs are passed.
|
||||||
//
|
//
|
||||||
// Solidity: function GetNums() pure returns(uint256[5])
|
// Solidity: function GetNums() pure returns(uint256[5])
|
||||||
func (myContract *MyContract) PackGetNums() []byte {
|
func (myContract *MyContract) PackGetNums() []byte {
|
||||||
|
|
@ -63,6 +64,15 @@ func (myContract *MyContract) PackGetNums() []byte {
|
||||||
return enc
|
return enc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TryPackGetNums is the Go binding used to pack the parameters required for calling
|
||||||
|
// the contract method with ID 0xbd6d1007. This method will return an error
|
||||||
|
// if any inputs are invalid/nil.
|
||||||
|
//
|
||||||
|
// Solidity: function GetNums() pure returns(uint256[5])
|
||||||
|
func (myContract *MyContract) TryPackGetNums() ([]byte, error) {
|
||||||
|
return myContract.abi.Pack("GetNums")
|
||||||
|
}
|
||||||
|
|
||||||
// UnpackGetNums is the Go binding that unpacks the parameters returned
|
// UnpackGetNums is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0xbd6d1007.
|
// from invoking the contract method with ID 0xbd6d1007.
|
||||||
//
|
//
|
||||||
|
|
@ -73,5 +83,5 @@ func (myContract *MyContract) UnpackGetNums(data []byte) ([5]*big.Int, error) {
|
||||||
return *new([5]*big.Int), err
|
return *new([5]*big.Int), err
|
||||||
}
|
}
|
||||||
out0 := *abi.ConvertType(out[0], new([5]*big.Int)).(*[5]*big.Int)
|
out0 := *abi.ConvertType(out[0], new([5]*big.Int)).(*[5]*big.Int)
|
||||||
return out0, err
|
return out0, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ package bind
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"math/big"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum"
|
"github.com/ethereum/go-ethereum"
|
||||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
||||||
|
|
@ -241,3 +242,27 @@ func DefaultDeployer(opts *TransactOpts, backend ContractBackend) DeployFn {
|
||||||
return addr, tx, nil
|
return addr, tx, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeployerWithNonceAssignment is basically identical to DefaultDeployer,
|
||||||
|
// but it additionally tracks the nonce to enable automatic assignment.
|
||||||
|
//
|
||||||
|
// This is especially useful when deploying multiple contracts
|
||||||
|
// from the same address — whether they are independent contracts
|
||||||
|
// or part of a dependency chain that must be deployed in order.
|
||||||
|
func DeployerWithNonceAssignment(opts *TransactOpts, backend ContractBackend) DeployFn {
|
||||||
|
var pendingNonce int64
|
||||||
|
if opts.Nonce != nil {
|
||||||
|
pendingNonce = opts.Nonce.Int64()
|
||||||
|
}
|
||||||
|
return func(input []byte, deployer []byte) (common.Address, *types.Transaction, error) {
|
||||||
|
if pendingNonce != 0 {
|
||||||
|
opts.Nonce = big.NewInt(pendingNonce)
|
||||||
|
}
|
||||||
|
addr, tx, err := DeployContract(opts, deployer, backend, input)
|
||||||
|
if err != nil {
|
||||||
|
return common.Address{}, nil, err
|
||||||
|
}
|
||||||
|
pendingNonce = int64(tx.Nonce() + 1)
|
||||||
|
return addr, tx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,14 @@ func makeTestDeployer(backend simulated.Client) func(input, deployer []byte) (co
|
||||||
return bind.DefaultDeployer(bind.NewKeyedTransactor(testKey, chainId), backend)
|
return bind.DefaultDeployer(bind.NewKeyedTransactor(testKey, chainId), backend)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// makeTestDeployerWithNonceAssignment is similar to makeTestDeployer,
|
||||||
|
// but it returns a deployer that automatically tracks nonce,
|
||||||
|
// enabling the deployment of multiple contracts from the same account.
|
||||||
|
func makeTestDeployerWithNonceAssignment(backend simulated.Client) func(input, deployer []byte) (common.Address, *types.Transaction, error) {
|
||||||
|
chainId, _ := backend.ChainID(context.Background())
|
||||||
|
return bind.DeployerWithNonceAssignment(bind.NewKeyedTransactor(testKey, chainId), backend)
|
||||||
|
}
|
||||||
|
|
||||||
// test that deploying a contract with library dependencies works,
|
// test that deploying a contract with library dependencies works,
|
||||||
// verifying by calling method on the deployed contract.
|
// verifying by calling method on the deployed contract.
|
||||||
func TestDeploymentLibraries(t *testing.T) {
|
func TestDeploymentLibraries(t *testing.T) {
|
||||||
|
|
@ -80,7 +88,7 @@ func TestDeploymentLibraries(t *testing.T) {
|
||||||
Contracts: []*bind.MetaData{&nested_libraries.C1MetaData},
|
Contracts: []*bind.MetaData{&nested_libraries.C1MetaData},
|
||||||
Inputs: map[string][]byte{nested_libraries.C1MetaData.ID: constructorInput},
|
Inputs: map[string][]byte{nested_libraries.C1MetaData.ID: constructorInput},
|
||||||
}
|
}
|
||||||
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployer(bindBackend.Client))
|
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployerWithNonceAssignment(bindBackend.Client))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %+v\n", err)
|
t.Fatalf("err: %+v\n", err)
|
||||||
}
|
}
|
||||||
|
|
@ -122,7 +130,7 @@ func TestDeploymentWithOverrides(t *testing.T) {
|
||||||
deploymentParams := &bind.DeploymentParams{
|
deploymentParams := &bind.DeploymentParams{
|
||||||
Contracts: nested_libraries.C1MetaData.Deps,
|
Contracts: nested_libraries.C1MetaData.Deps,
|
||||||
}
|
}
|
||||||
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployer(bindBackend))
|
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployerWithNonceAssignment(bindBackend))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %+v\n", err)
|
t.Fatalf("err: %+v\n", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ var (
|
||||||
errBadInt16 = errors.New("abi: improperly encoded int16 value")
|
errBadInt16 = errors.New("abi: improperly encoded int16 value")
|
||||||
errBadInt32 = errors.New("abi: improperly encoded int32 value")
|
errBadInt32 = errors.New("abi: improperly encoded int32 value")
|
||||||
errBadInt64 = errors.New("abi: improperly encoded int64 value")
|
errBadInt64 = errors.New("abi: improperly encoded int64 value")
|
||||||
|
errInvalidSign = errors.New("abi: negatively-signed value cannot be packed into uint parameter")
|
||||||
)
|
)
|
||||||
|
|
||||||
// formatSliceString formats the reflection kind with the given slice size
|
// formatSliceString formats the reflection kind with the given slice size
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,16 @@ func packBytesSlice(bytes []byte, l int) []byte {
|
||||||
// t.
|
// t.
|
||||||
func packElement(t Type, reflectValue reflect.Value) ([]byte, error) {
|
func packElement(t Type, reflectValue reflect.Value) ([]byte, error) {
|
||||||
switch t.T {
|
switch t.T {
|
||||||
case IntTy, UintTy:
|
case UintTy:
|
||||||
|
// make sure to not pack a negative value into a uint type.
|
||||||
|
if reflectValue.Kind() == reflect.Ptr {
|
||||||
|
val := new(big.Int).Set(reflectValue.Interface().(*big.Int))
|
||||||
|
if val.Sign() == -1 {
|
||||||
|
return nil, errInvalidSign
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return packNum(reflectValue), nil
|
||||||
|
case IntTy:
|
||||||
return packNum(reflectValue), nil
|
return packNum(reflectValue), nil
|
||||||
case StringTy:
|
case StringTy:
|
||||||
return packBytesSlice([]byte(reflectValue.String()), reflectValue.Len()), nil
|
return packBytesSlice([]byte(reflectValue.String()), reflectValue.Len()), nil
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,11 @@ func TestMethodPack(t *testing.T) {
|
||||||
if !bytes.Equal(packed, sig) {
|
if !bytes.Equal(packed, sig) {
|
||||||
t.Errorf("expected %x got %x", sig, packed)
|
t.Errorf("expected %x got %x", sig, packed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test that we can't pack a negative value for a parameter that is specified as a uint
|
||||||
|
if _, err := abi.Pack("send", big.NewInt(-1)); err == nil {
|
||||||
|
t.Fatal("expected error when trying to pack negative big.Int into uint256 value")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPackNumber(t *testing.T) {
|
func TestPackNumber(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ func ConvertType(in interface{}, proto interface{}) interface{} {
|
||||||
// indirect recursively dereferences the value until it either gets the value
|
// indirect recursively dereferences the value until it either gets the value
|
||||||
// or finds a big.Int
|
// or finds a big.Int
|
||||||
func indirect(v reflect.Value) reflect.Value {
|
func indirect(v reflect.Value) reflect.Value {
|
||||||
if v.Kind() == reflect.Ptr && v.Elem().Type() != reflect.TypeOf(big.Int{}) {
|
if v.Kind() == reflect.Ptr && v.Elem().Type() != reflect.TypeFor[big.Int]() {
|
||||||
return indirect(v.Elem())
|
return indirect(v.Elem())
|
||||||
}
|
}
|
||||||
return v
|
return v
|
||||||
|
|
@ -65,32 +65,32 @@ func reflectIntType(unsigned bool, size int) reflect.Type {
|
||||||
if unsigned {
|
if unsigned {
|
||||||
switch size {
|
switch size {
|
||||||
case 8:
|
case 8:
|
||||||
return reflect.TypeOf(uint8(0))
|
return reflect.TypeFor[uint8]()
|
||||||
case 16:
|
case 16:
|
||||||
return reflect.TypeOf(uint16(0))
|
return reflect.TypeFor[uint16]()
|
||||||
case 32:
|
case 32:
|
||||||
return reflect.TypeOf(uint32(0))
|
return reflect.TypeFor[uint32]()
|
||||||
case 64:
|
case 64:
|
||||||
return reflect.TypeOf(uint64(0))
|
return reflect.TypeFor[uint64]()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch size {
|
switch size {
|
||||||
case 8:
|
case 8:
|
||||||
return reflect.TypeOf(int8(0))
|
return reflect.TypeFor[int8]()
|
||||||
case 16:
|
case 16:
|
||||||
return reflect.TypeOf(int16(0))
|
return reflect.TypeFor[int16]()
|
||||||
case 32:
|
case 32:
|
||||||
return reflect.TypeOf(int32(0))
|
return reflect.TypeFor[int32]()
|
||||||
case 64:
|
case 64:
|
||||||
return reflect.TypeOf(int64(0))
|
return reflect.TypeFor[int64]()
|
||||||
}
|
}
|
||||||
return reflect.TypeOf(&big.Int{})
|
return reflect.TypeFor[*big.Int]()
|
||||||
}
|
}
|
||||||
|
|
||||||
// mustArrayToByteSlice creates a new byte slice with the exact same size as value
|
// mustArrayToByteSlice creates a new byte slice with the exact same size as value
|
||||||
// and copies the bytes in value to the new slice.
|
// and copies the bytes in value to the new slice.
|
||||||
func mustArrayToByteSlice(value reflect.Value) reflect.Value {
|
func mustArrayToByteSlice(value reflect.Value) reflect.Value {
|
||||||
slice := reflect.MakeSlice(reflect.TypeOf([]byte{}), value.Len(), value.Len())
|
slice := reflect.ValueOf(make([]byte, value.Len()))
|
||||||
reflect.Copy(slice, value)
|
reflect.Copy(slice, value)
|
||||||
return slice
|
return slice
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +104,7 @@ func set(dst, src reflect.Value) error {
|
||||||
switch {
|
switch {
|
||||||
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid() && (dst.Elem().Type().Kind() == reflect.Ptr || dst.Elem().CanSet()):
|
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid() && (dst.Elem().Type().Kind() == reflect.Ptr || dst.Elem().CanSet()):
|
||||||
return set(dst.Elem(), src)
|
return set(dst.Elem(), src)
|
||||||
case dstType.Kind() == reflect.Ptr && dstType.Elem() != reflect.TypeOf(big.Int{}):
|
case dstType.Kind() == reflect.Ptr && dstType.Elem() != reflect.TypeFor[big.Int]():
|
||||||
return set(dst.Elem(), src)
|
return set(dst.Elem(), src)
|
||||||
case srcType.AssignableTo(dstType) && dst.CanSet():
|
case srcType.AssignableTo(dstType) && dst.CanSet():
|
||||||
dst.Set(src)
|
dst.Set(src)
|
||||||
|
|
|
||||||
|
|
@ -204,12 +204,12 @@ func TestConvertType(t *testing.T) {
|
||||||
var fields []reflect.StructField
|
var fields []reflect.StructField
|
||||||
fields = append(fields, reflect.StructField{
|
fields = append(fields, reflect.StructField{
|
||||||
Name: "X",
|
Name: "X",
|
||||||
Type: reflect.TypeOf(new(big.Int)),
|
Type: reflect.TypeFor[*big.Int](),
|
||||||
Tag: "json:\"" + "x" + "\"",
|
Tag: "json:\"" + "x" + "\"",
|
||||||
})
|
})
|
||||||
fields = append(fields, reflect.StructField{
|
fields = append(fields, reflect.StructField{
|
||||||
Name: "Y",
|
Name: "Y",
|
||||||
Type: reflect.TypeOf(new(big.Int)),
|
Type: reflect.TypeFor[*big.Int](),
|
||||||
Tag: "json:\"" + "y" + "\"",
|
Tag: "json:\"" + "y" + "\"",
|
||||||
})
|
})
|
||||||
val := reflect.New(reflect.StructOf(fields))
|
val := reflect.New(reflect.StructOf(fields))
|
||||||
|
|
|
||||||
|
|
@ -238,9 +238,9 @@ func (t Type) GetType() reflect.Type {
|
||||||
case UintTy:
|
case UintTy:
|
||||||
return reflectIntType(true, t.Size)
|
return reflectIntType(true, t.Size)
|
||||||
case BoolTy:
|
case BoolTy:
|
||||||
return reflect.TypeOf(false)
|
return reflect.TypeFor[bool]()
|
||||||
case StringTy:
|
case StringTy:
|
||||||
return reflect.TypeOf("")
|
return reflect.TypeFor[string]()
|
||||||
case SliceTy:
|
case SliceTy:
|
||||||
return reflect.SliceOf(t.Elem.GetType())
|
return reflect.SliceOf(t.Elem.GetType())
|
||||||
case ArrayTy:
|
case ArrayTy:
|
||||||
|
|
@ -248,19 +248,15 @@ func (t Type) GetType() reflect.Type {
|
||||||
case TupleTy:
|
case TupleTy:
|
||||||
return t.TupleType
|
return t.TupleType
|
||||||
case AddressTy:
|
case AddressTy:
|
||||||
return reflect.TypeOf(common.Address{})
|
return reflect.TypeFor[common.Address]()
|
||||||
case FixedBytesTy:
|
case FixedBytesTy:
|
||||||
return reflect.ArrayOf(t.Size, reflect.TypeOf(byte(0)))
|
return reflect.ArrayOf(t.Size, reflect.TypeFor[byte]())
|
||||||
case BytesTy:
|
case BytesTy:
|
||||||
return reflect.SliceOf(reflect.TypeOf(byte(0)))
|
return reflect.TypeFor[[]byte]()
|
||||||
case HashTy:
|
case HashTy, FixedPointTy: // currently not used
|
||||||
// hashtype currently not used
|
return reflect.TypeFor[[32]byte]()
|
||||||
return reflect.ArrayOf(32, reflect.TypeOf(byte(0)))
|
|
||||||
case FixedPointTy:
|
|
||||||
// fixedpoint type currently not used
|
|
||||||
return reflect.ArrayOf(32, reflect.TypeOf(byte(0)))
|
|
||||||
case FunctionTy:
|
case FunctionTy:
|
||||||
return reflect.ArrayOf(24, reflect.TypeOf(byte(0)))
|
return reflect.TypeFor[[24]byte]()
|
||||||
default:
|
default:
|
||||||
panic("Invalid type")
|
panic("Invalid type")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1014,128 +1014,134 @@ func TestPackAndUnpackIncompatibleNumber(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
decodeType string
|
decodeType string
|
||||||
inputValue *big.Int
|
inputValue *big.Int
|
||||||
err error
|
unpackErr error
|
||||||
|
packErr error
|
||||||
expectValue interface{}
|
expectValue interface{}
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
decodeType: "uint8",
|
decodeType: "uint8",
|
||||||
inputValue: big.NewInt(math.MaxUint8 + 1),
|
inputValue: big.NewInt(math.MaxUint8 + 1),
|
||||||
err: errBadUint8,
|
unpackErr: errBadUint8,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint8",
|
decodeType: "uint8",
|
||||||
inputValue: big.NewInt(math.MaxUint8),
|
inputValue: big.NewInt(math.MaxUint8),
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: uint8(math.MaxUint8),
|
expectValue: uint8(math.MaxUint8),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint16",
|
decodeType: "uint16",
|
||||||
inputValue: big.NewInt(math.MaxUint16 + 1),
|
inputValue: big.NewInt(math.MaxUint16 + 1),
|
||||||
err: errBadUint16,
|
unpackErr: errBadUint16,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint16",
|
decodeType: "uint16",
|
||||||
inputValue: big.NewInt(math.MaxUint16),
|
inputValue: big.NewInt(math.MaxUint16),
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: uint16(math.MaxUint16),
|
expectValue: uint16(math.MaxUint16),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint32",
|
decodeType: "uint32",
|
||||||
inputValue: big.NewInt(math.MaxUint32 + 1),
|
inputValue: big.NewInt(math.MaxUint32 + 1),
|
||||||
err: errBadUint32,
|
unpackErr: errBadUint32,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint32",
|
decodeType: "uint32",
|
||||||
inputValue: big.NewInt(math.MaxUint32),
|
inputValue: big.NewInt(math.MaxUint32),
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: uint32(math.MaxUint32),
|
expectValue: uint32(math.MaxUint32),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint64",
|
decodeType: "uint64",
|
||||||
inputValue: maxU64Plus1,
|
inputValue: maxU64Plus1,
|
||||||
err: errBadUint64,
|
unpackErr: errBadUint64,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint64",
|
decodeType: "uint64",
|
||||||
inputValue: maxU64,
|
inputValue: maxU64,
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: uint64(math.MaxUint64),
|
expectValue: uint64(math.MaxUint64),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "uint256",
|
decodeType: "uint256",
|
||||||
inputValue: maxU64Plus1,
|
inputValue: maxU64Plus1,
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: maxU64Plus1,
|
expectValue: maxU64Plus1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int8",
|
decodeType: "int8",
|
||||||
inputValue: big.NewInt(math.MaxInt8 + 1),
|
inputValue: big.NewInt(math.MaxInt8 + 1),
|
||||||
err: errBadInt8,
|
unpackErr: errBadInt8,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int8",
|
|
||||||
inputValue: big.NewInt(math.MinInt8 - 1),
|
inputValue: big.NewInt(math.MinInt8 - 1),
|
||||||
err: errBadInt8,
|
packErr: errInvalidSign,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int8",
|
decodeType: "int8",
|
||||||
inputValue: big.NewInt(math.MaxInt8),
|
inputValue: big.NewInt(math.MaxInt8),
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: int8(math.MaxInt8),
|
expectValue: int8(math.MaxInt8),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int16",
|
decodeType: "int16",
|
||||||
inputValue: big.NewInt(math.MaxInt16 + 1),
|
inputValue: big.NewInt(math.MaxInt16 + 1),
|
||||||
err: errBadInt16,
|
unpackErr: errBadInt16,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int16",
|
|
||||||
inputValue: big.NewInt(math.MinInt16 - 1),
|
inputValue: big.NewInt(math.MinInt16 - 1),
|
||||||
err: errBadInt16,
|
packErr: errInvalidSign,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int16",
|
decodeType: "int16",
|
||||||
inputValue: big.NewInt(math.MaxInt16),
|
inputValue: big.NewInt(math.MaxInt16),
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: int16(math.MaxInt16),
|
expectValue: int16(math.MaxInt16),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int32",
|
decodeType: "int32",
|
||||||
inputValue: big.NewInt(math.MaxInt32 + 1),
|
inputValue: big.NewInt(math.MaxInt32 + 1),
|
||||||
err: errBadInt32,
|
unpackErr: errBadInt32,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int32",
|
|
||||||
inputValue: big.NewInt(math.MinInt32 - 1),
|
inputValue: big.NewInt(math.MinInt32 - 1),
|
||||||
err: errBadInt32,
|
packErr: errInvalidSign,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int32",
|
decodeType: "int32",
|
||||||
inputValue: big.NewInt(math.MaxInt32),
|
inputValue: big.NewInt(math.MaxInt32),
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: int32(math.MaxInt32),
|
expectValue: int32(math.MaxInt32),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int64",
|
decodeType: "int64",
|
||||||
inputValue: new(big.Int).Add(big.NewInt(math.MaxInt64), big.NewInt(1)),
|
inputValue: new(big.Int).Add(big.NewInt(math.MaxInt64), big.NewInt(1)),
|
||||||
err: errBadInt64,
|
unpackErr: errBadInt64,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int64",
|
|
||||||
inputValue: new(big.Int).Sub(big.NewInt(math.MinInt64), big.NewInt(1)),
|
inputValue: new(big.Int).Sub(big.NewInt(math.MinInt64), big.NewInt(1)),
|
||||||
err: errBadInt64,
|
packErr: errInvalidSign,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
decodeType: "int64",
|
decodeType: "int64",
|
||||||
inputValue: big.NewInt(math.MaxInt64),
|
inputValue: big.NewInt(math.MaxInt64),
|
||||||
err: nil,
|
unpackErr: nil,
|
||||||
expectValue: int64(math.MaxInt64),
|
expectValue: int64(math.MaxInt64),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for i, testCase := range cases {
|
for i, testCase := range cases {
|
||||||
packed, err := encodeABI.Pack(testCase.inputValue)
|
packed, err := encodeABI.Pack(testCase.inputValue)
|
||||||
if err != nil {
|
if testCase.packErr != nil {
|
||||||
panic(err)
|
if err == nil {
|
||||||
|
t.Fatalf("expected packing of testcase input value to fail")
|
||||||
|
}
|
||||||
|
if err != testCase.packErr {
|
||||||
|
t.Fatalf("expected error '%v', got '%v'", testCase.packErr, err)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if err != nil && err != testCase.packErr {
|
||||||
|
panic(fmt.Errorf("unexpected error packing test-case input: %v", err))
|
||||||
}
|
}
|
||||||
ty, err := NewType(testCase.decodeType, "", nil)
|
ty, err := NewType(testCase.decodeType, "", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -1145,8 +1151,8 @@ func TestPackAndUnpackIncompatibleNumber(t *testing.T) {
|
||||||
{Type: ty},
|
{Type: ty},
|
||||||
}
|
}
|
||||||
decoded, err := decodeABI.Unpack(packed)
|
decoded, err := decodeABI.Unpack(packed)
|
||||||
if err != testCase.err {
|
if err != testCase.unpackErr {
|
||||||
t.Fatalf("Expected error %v, actual error %v. case %d", testCase.err, err, i)
|
t.Fatalf("Expected error %v, actual error %v. case %d", testCase.unpackErr, err, i)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
// Package keystore implements encrypted storage of secp256k1 private keys.
|
// Package keystore implements encrypted storage of secp256k1 private keys.
|
||||||
//
|
//
|
||||||
// Keys are stored as encrypted JSON files according to the Web3 Secret Storage specification.
|
// Keys are stored as encrypted JSON files according to the Web3 Secret Storage specification.
|
||||||
// See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information.
|
// See https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/ for more information.
|
||||||
package keystore
|
package keystore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
@ -50,7 +50,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
// KeyStoreType is the reflect type of a keystore backend.
|
// KeyStoreType is the reflect type of a keystore backend.
|
||||||
var KeyStoreType = reflect.TypeOf(&KeyStore{})
|
var KeyStoreType = reflect.TypeFor[*KeyStore]()
|
||||||
|
|
||||||
// KeyStoreScheme is the protocol scheme prefixing account and wallet URLs.
|
// KeyStoreScheme is the protocol scheme prefixing account and wallet URLs.
|
||||||
const KeyStoreScheme = "keystore"
|
const KeyStoreScheme = "keystore"
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
This key store behaves as KeyStorePlain with the difference that
|
This key store behaves as KeyStorePlain with the difference that
|
||||||
the private key is encrypted and on disk uses another JSON encoding.
|
the private key is encrypted and on disk uses another JSON encoding.
|
||||||
|
|
||||||
The crypto is documented at https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition
|
The crypto is documented at https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,6 @@ func NewManager(config *Config, backends ...Backend) *Manager {
|
||||||
|
|
||||||
// Close terminates the account manager's internal notification processes.
|
// Close terminates the account manager's internal notification processes.
|
||||||
func (am *Manager) Close() error {
|
func (am *Manager) Close() error {
|
||||||
for _, w := range am.wallets {
|
|
||||||
w.Close()
|
|
||||||
}
|
|
||||||
errc := make(chan error)
|
errc := make(chan error)
|
||||||
am.quit <- errc
|
am.quit <- errc
|
||||||
return <-errc
|
return <-errc
|
||||||
|
|
@ -149,6 +146,10 @@ func (am *Manager) update() {
|
||||||
am.lock.Unlock()
|
am.lock.Unlock()
|
||||||
close(event.processed)
|
close(event.processed)
|
||||||
case errc := <-am.quit:
|
case errc := <-am.quit:
|
||||||
|
// Close all owned wallets
|
||||||
|
for _, w := range am.wallets {
|
||||||
|
w.Close()
|
||||||
|
}
|
||||||
// Manager terminating, return
|
// Manager terminating, return
|
||||||
errc <- nil
|
errc <- nil
|
||||||
// Signals event emitters the loop is not receiving values
|
// Signals event emitters the loop is not receiving values
|
||||||
|
|
|
||||||
|
|
@ -472,6 +472,11 @@ func (w *Wallet) selfDerive() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
pairing := w.Hub.pairing(w)
|
pairing := w.Hub.pairing(w)
|
||||||
|
if pairing == nil {
|
||||||
|
w.lock.Unlock()
|
||||||
|
reqc <- struct{}{}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Device lock obtained, derive the next batch of accounts
|
// Device lock obtained, derive the next batch of accounts
|
||||||
var (
|
var (
|
||||||
|
|
@ -631,13 +636,13 @@ func (w *Wallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Accoun
|
||||||
}
|
}
|
||||||
|
|
||||||
if pin {
|
if pin {
|
||||||
pairing := w.Hub.pairing(w)
|
if pairing := w.Hub.pairing(w); pairing != nil {
|
||||||
pairing.Accounts[account.Address] = path
|
pairing.Accounts[account.Address] = path
|
||||||
if err := w.Hub.setPairing(w, pairing); err != nil {
|
if err := w.Hub.setPairing(w, pairing); err != nil {
|
||||||
return accounts.Account{}, err
|
return accounts.Account{}, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return account, nil
|
return account, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -774,11 +779,11 @@ func (w *Wallet) SignTxWithPassphrase(account accounts.Account, passphrase strin
|
||||||
// It first checks for the address in the list of pinned accounts, and if it is
|
// It first checks for the address in the list of pinned accounts, and if it is
|
||||||
// not found, attempts to parse the derivation path from the account's URL.
|
// not found, attempts to parse the derivation path from the account's URL.
|
||||||
func (w *Wallet) findAccountPath(account accounts.Account) (accounts.DerivationPath, error) {
|
func (w *Wallet) findAccountPath(account accounts.Account) (accounts.DerivationPath, error) {
|
||||||
pairing := w.Hub.pairing(w)
|
if pairing := w.Hub.pairing(w); pairing != nil {
|
||||||
if path, ok := pairing.Accounts[account.Address]; ok {
|
if path, ok := pairing.Accounts[account.Address]; ok {
|
||||||
return path, nil
|
return path, nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Look for the path in the URL
|
// Look for the path in the URL
|
||||||
if account.URL.Scheme != w.Hub.scheme {
|
if account.URL.Scheme != w.Hub.scheme {
|
||||||
return nil, fmt.Errorf("scheme %s does not match wallet scheme %s", account.URL.Scheme, w.Hub.scheme)
|
return nil, fmt.Errorf("scheme %s does not match wallet scheme %s", account.URL.Scheme, w.Hub.scheme)
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio
|
||||||
return common.Address{}, nil, accounts.ErrWalletClosed
|
return common.Address{}, nil, accounts.ErrWalletClosed
|
||||||
}
|
}
|
||||||
// Ensure the wallet is capable of signing the given transaction
|
// Ensure the wallet is capable of signing the given transaction
|
||||||
if chainID != nil && w.version[0] <= 1 && w.version[1] <= 0 && w.version[2] <= 2 {
|
if chainID != nil && (w.version[0] < 1 || (w.version[0] == 1 && w.version[1] == 0 && w.version[2] < 3)) {
|
||||||
//lint:ignore ST1005 brand name displayed on the console
|
//lint:ignore ST1005 brand name displayed on the console
|
||||||
return common.Address{}, nil, fmt.Errorf("Ledger v%d.%d.%d doesn't support signing this transaction, please update to v1.0.3 at least", w.version[0], w.version[1], w.version[2])
|
return common.Address{}, nil, fmt.Errorf("Ledger v%d.%d.%d doesn't support signing this transaction, please update to v1.0.3 at least", w.version[0], w.version[1], w.version[2])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,11 @@ type BlobAndProofV1 struct {
|
||||||
Proof hexutil.Bytes `json:"proof"`
|
Proof hexutil.Bytes `json:"proof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type BlobAndProofV2 struct {
|
||||||
|
Blob hexutil.Bytes `json:"blob"`
|
||||||
|
CellProofs []hexutil.Bytes `json:"proofs"`
|
||||||
|
}
|
||||||
|
|
||||||
// JSON type overrides for ExecutionPayloadEnvelope.
|
// JSON type overrides for ExecutionPayloadEnvelope.
|
||||||
type executionPayloadEnvelopeMarshaling struct {
|
type executionPayloadEnvelopeMarshaling struct {
|
||||||
BlockValue *hexutil.Big
|
BlockValue *hexutil.Big
|
||||||
|
|
@ -331,7 +336,9 @@ func BlockToExecutableData(block *types.Block, fees *big.Int, sidecars []*types.
|
||||||
for j := range sidecar.Blobs {
|
for j := range sidecar.Blobs {
|
||||||
bundle.Blobs = append(bundle.Blobs, hexutil.Bytes(sidecar.Blobs[j][:]))
|
bundle.Blobs = append(bundle.Blobs, hexutil.Bytes(sidecar.Blobs[j][:]))
|
||||||
bundle.Commitments = append(bundle.Commitments, hexutil.Bytes(sidecar.Commitments[j][:]))
|
bundle.Commitments = append(bundle.Commitments, hexutil.Bytes(sidecar.Commitments[j][:]))
|
||||||
bundle.Proofs = append(bundle.Proofs, hexutil.Bytes(sidecar.Proofs[j][:]))
|
}
|
||||||
|
for _, proof := range sidecar.Proofs {
|
||||||
|
bundle.Proofs = append(bundle.Proofs, hexutil.Bytes(proof[:]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
48
beacon/engine/types_test.go
Normal file
48
beacon/engine/types_test.go
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
// Copyright 2025 The go-ethereum Authors
|
||||||
|
// This file is part of the go-ethereum library.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package engine
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
"github.com/ethereum/go-ethereum/crypto/kzg4844"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestBlobs(t *testing.T) {
|
||||||
|
var (
|
||||||
|
emptyBlob = new(kzg4844.Blob)
|
||||||
|
emptyBlobCommit, _ = kzg4844.BlobToCommitment(emptyBlob)
|
||||||
|
emptyBlobProof, _ = kzg4844.ComputeBlobProof(emptyBlob, emptyBlobCommit)
|
||||||
|
emptyCellProof, _ = kzg4844.ComputeCellProofs(emptyBlob)
|
||||||
|
)
|
||||||
|
header := types.Header{}
|
||||||
|
block := types.NewBlock(&header, &types.Body{}, nil, nil)
|
||||||
|
|
||||||
|
sidecarWithoutCellProofs := types.NewBlobTxSidecar(types.BlobSidecarVersion0, []kzg4844.Blob{*emptyBlob}, []kzg4844.Commitment{emptyBlobCommit}, []kzg4844.Proof{emptyBlobProof})
|
||||||
|
env := BlockToExecutableData(block, common.Big0, []*types.BlobTxSidecar{sidecarWithoutCellProofs}, nil)
|
||||||
|
if len(env.BlobsBundle.Proofs) != 1 {
|
||||||
|
t.Fatalf("Expect 1 proof in blobs bundle, got %v", len(env.BlobsBundle.Proofs))
|
||||||
|
}
|
||||||
|
|
||||||
|
sidecarWithCellProofs := types.NewBlobTxSidecar(types.BlobSidecarVersion0, []kzg4844.Blob{*emptyBlob}, []kzg4844.Commitment{emptyBlobCommit}, emptyCellProof)
|
||||||
|
env = BlockToExecutableData(block, common.Big0, []*types.BlobTxSidecar{sidecarWithCellProofs}, nil)
|
||||||
|
if len(env.BlobsBundle.Proofs) != 128 {
|
||||||
|
t.Fatalf("Expect 128 proofs in blobs bundle, got %v", len(env.BlobsBundle.Proofs))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -32,7 +32,7 @@ type Value [32]byte
|
||||||
// Values represent a series of merkle tree leaves/nodes.
|
// Values represent a series of merkle tree leaves/nodes.
|
||||||
type Values []Value
|
type Values []Value
|
||||||
|
|
||||||
var valueT = reflect.TypeOf(Value{})
|
var valueT = reflect.TypeFor[Value]()
|
||||||
|
|
||||||
// UnmarshalJSON parses a merkle value in hex syntax.
|
// UnmarshalJSON parses a merkle value in hex syntax.
|
||||||
func (m *Value) UnmarshalJSON(input []byte) error {
|
func (m *Value) UnmarshalJSON(input []byte) error {
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
0xd60e5310c5d52ced44cfb13be4e9f22a1e6a6dc56964c3cccd429182d26d72d0
|
0x4bae4b97deda095724560012cab1f80a5221ce0a37a4b5236d8ab63f595f29d9
|
||||||
1
beacon/params/checkpoint_hoodi.hex
Normal file
1
beacon/params/checkpoint_hoodi.hex
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
0x1bbf958008172591b6cbdb3d8d52e26998258e83d4bdb9eec10969d84519a6bd
|
||||||
|
|
@ -1 +1 @@
|
||||||
0x02f0bb348b0d45f95a9b7e2bb5705768ad06548876cee03d880a2c9dabb1ff88
|
0x2fe39a39b6f7cbd549e0f74d259de6db486005a65bd3bd92840dd6ce21d6f4c8
|
||||||
|
|
@ -1 +1 @@
|
||||||
0xa0dad451a230c01be6f2492980ec5bb412d8cf33351a75e8b172b5b84a5fd03a
|
0x86686b2b366e24134e0e3969a9c5f3759f92e5d2b04785b42e22cc7d468c2107
|
||||||
|
|
@ -31,6 +31,9 @@ var checkpointSepolia string
|
||||||
//go:embed checkpoint_holesky.hex
|
//go:embed checkpoint_holesky.hex
|
||||||
var checkpointHolesky string
|
var checkpointHolesky string
|
||||||
|
|
||||||
|
//go:embed checkpoint_hoodi.hex
|
||||||
|
var checkpointHoodi string
|
||||||
|
|
||||||
var (
|
var (
|
||||||
MainnetLightConfig = (&ChainConfig{
|
MainnetLightConfig = (&ChainConfig{
|
||||||
GenesisValidatorsRoot: common.HexToHash("0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"),
|
GenesisValidatorsRoot: common.HexToHash("0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"),
|
||||||
|
|
@ -71,7 +74,7 @@ var (
|
||||||
HoodiLightConfig = (&ChainConfig{
|
HoodiLightConfig = (&ChainConfig{
|
||||||
GenesisValidatorsRoot: common.HexToHash("0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f"),
|
GenesisValidatorsRoot: common.HexToHash("0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f"),
|
||||||
GenesisTime: 1742212800,
|
GenesisTime: 1742212800,
|
||||||
Checkpoint: common.HexToHash(""),
|
Checkpoint: common.HexToHash(checkpointHoodi),
|
||||||
}).
|
}).
|
||||||
AddFork("GENESIS", 0, common.FromHex("0x10000910")).
|
AddFork("GENESIS", 0, common.FromHex("0x10000910")).
|
||||||
AddFork("ALTAIR", 0, common.FromHex("0x20000910")).
|
AddFork("ALTAIR", 0, common.FromHex("0x20000910")).
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,58 @@
|
||||||
# This file contains sha256 checksums of optional build dependencies.
|
# This file contains sha256 checksums of optional build dependencies.
|
||||||
|
|
||||||
# version:spec-tests pectra-devnet-6@v1.0.0
|
# version:spec-tests fusaka-devnet-3%40v1.0.0
|
||||||
# https://github.com/ethereum/execution-spec-tests/releases
|
# https://github.com/ethereum/execution-spec-tests/releases
|
||||||
# https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-6%40v1.0.0/
|
# https://github.com/ethereum/execution-spec-tests/releases/download/fusaka-devnet-3%40v1.0.0
|
||||||
b69211752a3029083c020dc635fe12156ca1a6725a08559da540a0337586a77e fixtures_pectra-devnet-6.tar.gz
|
576261e1280e5300c458aa9b05eccb2fec5ff80a0005940dc52fa03fdd907249 fixtures_fusaka-devnet-3.tar.gz
|
||||||
|
|
||||||
# version:golang 1.24.2
|
# version:golang 1.25.0
|
||||||
# https://go.dev/dl/
|
# https://go.dev/dl/
|
||||||
9dc77ffadc16d837a1bf32d99c624cb4df0647cee7b119edd9e7b1bcc05f2e00 go1.24.2.src.tar.gz
|
4bd01e91297207bfa450ea40d4d5a93b1b531a5e438473b2a06e18e077227225 go1.25.0.src.tar.gz
|
||||||
427b373540d8fd51dbcc46bdecd340af109cd41514443c000d3dcde72b2c65a3 go1.24.2.aix-ppc64.tar.gz
|
e5234a7dac67bc86c528fe9752fc9d63557918627707a733ab4cac1a6faed2d4 go1.25.0.aix-ppc64.tar.gz
|
||||||
238d9c065d09ff6af229d2e3b8b5e85e688318d69f4006fb85a96e41c216ea83 go1.24.2.darwin-amd64.tar.gz
|
5bd60e823037062c2307c71e8111809865116714d6f6b410597cf5075dfd80ef go1.25.0.darwin-amd64.tar.gz
|
||||||
535ed9ff283fee39575a7fb9b6d8b1901b6dc640d06dc71fd7d3faeefdaf8030 go1.24.2.darwin-amd64.pkg
|
95e836238bcf8f9a71bffea43344cbd35ee1f16db3aaced2f98dbac045d102db go1.25.0.darwin-amd64.pkg
|
||||||
b70f8b3c5b4ccb0ad4ffa5ee91cd38075df20fdbd953a1daedd47f50fbcff47a go1.24.2.darwin-arm64.tar.gz
|
544932844156d8172f7a28f77f2ac9c15a23046698b6243f633b0a0b00c0749c go1.25.0.darwin-arm64.tar.gz
|
||||||
4732f607a47ce4d898c0af01ff68f07e0820a6b50603aef5d5c777d1102505e2 go1.24.2.darwin-arm64.pkg
|
202a0d8338c152cb4c9f04782429e9ba8bef31d9889272380837e4043c9d800a go1.25.0.darwin-arm64.pkg
|
||||||
c17686b5fd61a663fbfafccfa177961be59386cf294e935ce35866b9dcb8e78a go1.24.2.dragonfly-amd64.tar.gz
|
5ed3cf9a810a1483822538674f1336c06b51aa1b94d6d545a1a0319a48177120 go1.25.0.dragonfly-amd64.tar.gz
|
||||||
026f1dd906189acff714c7625686bbc4ed91042618ba010d45b671461acc9e63 go1.24.2.freebsd-386.tar.gz
|
abea5d5c6697e6b5c224731f2158fe87c602996a2a233ac0c4730cd57bf8374e go1.25.0.freebsd-386.tar.gz
|
||||||
49399ba759b570a8f87d12179133403da6c2dd296d63a8830dee309161b9c40c go1.24.2.freebsd-amd64.tar.gz
|
86e6fe0a29698d7601c4442052dac48bd58d532c51cccb8f1917df648138730b go1.25.0.freebsd-amd64.tar.gz
|
||||||
1f48f47183794d97c29736004247ab541177cf984ac6322c78bc43828daa1172 go1.24.2.freebsd-arm.tar.gz
|
d90b78e41921f72f30e8bbc81d9dec2cff7ff384a33d8d8debb24053e4336bfe go1.25.0.freebsd-arm.tar.gz
|
||||||
ef856428b60a8c0bd9a2cba596e83024be6f1c2d5574e89cb1ff2262b08df8b9 go1.24.2.freebsd-arm64.tar.gz
|
451d0da1affd886bfb291b7c63a6018527b269505db21ce6e14724f22ab0662e go1.25.0.freebsd-arm64.tar.gz
|
||||||
ec2088823e16df00600a6d0f72e9a7dc6d2f80c9c140c2043c0cf20e1404d1a9 go1.24.2.freebsd-riscv64.tar.gz
|
7b565f76bd8bda46549eeaaefe0e53b251e644c230577290c0f66b1ecdb3cdbe go1.25.0.freebsd-riscv64.tar.gz
|
||||||
e030e7cedbb8688f1d75cb80f3de6ee2e6617a67d34051e794e5992b53462147 go1.24.2.illumos-amd64.tar.gz
|
b1e1fdaab1ad25aa1c08d7a36c97d45d74b98b89c3f78c6d2145f77face54a2c go1.25.0.illumos-amd64.tar.gz
|
||||||
4c382776d52313266f3026236297a224a6688751256a2dffa3f524d8d6f6c0ba go1.24.2.linux-386.tar.gz
|
8c602dd9d99bc9453b3995d20ce4baf382cc50855900a0ece5de9929df4a993a go1.25.0.linux-386.tar.gz
|
||||||
68097bd680839cbc9d464a0edce4f7c333975e27a90246890e9f1078c7e702ad go1.24.2.linux-amd64.tar.gz
|
2852af0cb20a13139b3448992e69b868e50ed0f8a1e5940ee1de9e19a123b613 go1.25.0.linux-amd64.tar.gz
|
||||||
756274ea4b68fa5535eb9fe2559889287d725a8da63c6aae4d5f23778c229f4b go1.24.2.linux-arm64.tar.gz
|
05de75d6994a2783699815ee553bd5a9327d8b79991de36e38b66862782f54ae go1.25.0.linux-arm64.tar.gz
|
||||||
438d5d3d7dcb239b58d893a715672eabe670b9730b1fd1c8fc858a46722a598a go1.24.2.linux-armv6l.tar.gz
|
a5a8f8198fcf00e1e485b8ecef9ee020778bf32a408a4e8873371bfce458cd09 go1.25.0.linux-armv6l.tar.gz
|
||||||
6aefd3bf59c3c5592eda4fb287322207f119c2210f3795afa9be48d3ccb73e1b go1.24.2.linux-loong64.tar.gz
|
cab86b1cf761b1cb3bac86a8877cfc92e7b036fc0d3084123d77013d61432afc go1.25.0.linux-loong64.tar.gz
|
||||||
93e49bb4692783b0e9a2deab9558c6e8d2867f35592aeff285adda60924167f3 go1.24.2.linux-mips.tar.gz
|
d66b6fb74c3d91b9829dc95ec10ca1f047ef5e89332152f92e136cf0e2da5be1 go1.25.0.linux-mips.tar.gz
|
||||||
6e86e703675016f3faf6604b8f68f20dc1bba75849136e6dd4f43f69c8a4a9d9 go1.24.2.linux-mips64.tar.gz
|
4082e4381a8661bc2a839ff94ba3daf4f6cde20f8fb771b5b3d4762dc84198a2 go1.25.0.linux-mips64.tar.gz
|
||||||
f233d237538ca1559a7d7cf519a29f0147923a951377bc4e467af4c059e68851 go1.24.2.linux-mips64le.tar.gz
|
70002c299ec7f7175ac2ef673b1b347eecfa54ae11f34416a6053c17f855afcc go1.25.0.linux-mips64le.tar.gz
|
||||||
545e1b9a7939f923fd53bde98334b987ef42eb353ee3e0bfede8aa06079d6b24 go1.24.2.linux-mipsle.tar.gz
|
b00a3a39eff099f6df9f1c7355bf28e4589d0586f42d7d4a394efb763d145a73 go1.25.0.linux-mipsle.tar.gz
|
||||||
6eab31481f2f46187bc1b6c887662eef06fc9d7271a8390854072cdb387c8d74 go1.24.2.linux-ppc64.tar.gz
|
df166f33bd98160662560a72ff0b4ba731f969a80f088922bddcf566a88c1ec1 go1.25.0.linux-ppc64.tar.gz
|
||||||
5fff857791d541c71d8ea0171c73f6f99770d15ff7e2ad979104856d01f36563 go1.24.2.linux-ppc64le.tar.gz
|
0f18a89e7576cf2c5fa0b487a1635d9bcbf843df5f110e9982c64df52a983ad0 go1.25.0.linux-ppc64le.tar.gz
|
||||||
91bda1558fcbd1c92769ad86c8f5cf796f8c67b0d9d9c19f76eecfc75ce71527 go1.24.2.linux-riscv64.tar.gz
|
c018ff74a2c48d55c8ca9b07c8e24163558ffec8bea08b326d6336905d956b67 go1.25.0.linux-riscv64.tar.gz
|
||||||
1cb3448166d6abb515a85a3ee5afbdf932081fb58ad7143a8fb666fbc06146d9 go1.24.2.linux-s390x.tar.gz
|
34e5a2e19f2292fbaf8783e3a241e6e49689276aef6510a8060ea5ef54eee408 go1.25.0.linux-s390x.tar.gz
|
||||||
a9a2c0db2e826f20f00b02bee01dfdaeb49591c2f6ffacb78dc64a950894f7ff go1.24.2.netbsd-386.tar.gz
|
f8586cdb7aa855657609a5c5f6dbf523efa00c2bbd7c76d3936bec80aa6c0aba go1.25.0.netbsd-386.tar.gz
|
||||||
cd1a35b76ed9c7b6c0c1616741bd319699a77867ade0be9924f32496c0a87a3f go1.24.2.netbsd-amd64.tar.gz
|
ae8dc1469385b86a157a423bb56304ba45730de8a897615874f57dd096db2c2a go1.25.0.netbsd-amd64.tar.gz
|
||||||
8c666388d066e479155cc5116950eeb435df28087ef277c18f1dc7479f836e60 go1.24.2.netbsd-arm.tar.gz
|
1ff7e4cc764425fc9dd6825eaee79d02b3c7cafffbb3691687c8d672ade76cb7 go1.25.0.netbsd-arm.tar.gz
|
||||||
5d42f0be04f58da5be788a1e260f8747c316b8ce182bf0b273c2e4c691feaa1a go1.24.2.netbsd-arm64.tar.gz
|
e1b310739f26724216aa6d7d7208c4031f9ff54c9b5b9a796ddc8bebcb4a5f16 go1.25.0.netbsd-arm64.tar.gz
|
||||||
688effa23ea3973cc8b0fdf4246712cbeef55ff20c45f3a9e28b0c2db04246cf go1.24.2.openbsd-386.tar.gz
|
4802a9b20e533da91adb84aab42e94aa56cfe3e5475d0550bed3385b182e69d8 go1.25.0.openbsd-386.tar.gz
|
||||||
e5daf95f1048d8026b1366450a3f8044d668b0639db6422ad9a83755c6745cf7 go1.24.2.openbsd-amd64.tar.gz
|
c016cd984bebe317b19a4f297c4f50def120dc9788490540c89f28e42f1dabe1 go1.25.0.openbsd-amd64.tar.gz
|
||||||
aeadaf74bd544d1a12ba9b14c0e7cdb1964de3ba9a52acb4619e91dbae7def7b go1.24.2.openbsd-arm.tar.gz
|
a1e31d0bf22172ddde42edf5ec811ef81be43433df0948ece52fecb247ccfd8d go1.25.0.openbsd-arm.tar.gz
|
||||||
9e222d9adb0ce836a5b3c8d5aadbd167c8869c030b113f4a81aa88e9a200f279 go1.24.2.openbsd-arm64.tar.gz
|
343ea8edd8c218196e15a859c6072d0dd3246fbbb168481ab665eb4c4140458d go1.25.0.openbsd-arm64.tar.gz
|
||||||
192fffa34536adc3cd1bb7c1ee785b8bc156ae7afd10bbf5db99ec8f2e93066e go1.24.2.openbsd-ppc64.tar.gz
|
694c14da1bcaeb5e3332d49bdc2b6d155067648f8fe1540c5de8f3cf8e157154 go1.25.0.openbsd-ppc64.tar.gz
|
||||||
a23e90b451a390549042c2a7efbec6f29ed98b2d5618c8d2a35704e21be96e09 go1.24.2.openbsd-riscv64.tar.gz
|
aa510ad25cf54c06cd9c70b6d80ded69cb20188ac6e1735655eef29ff7e7885f go1.25.0.openbsd-riscv64.tar.gz
|
||||||
5cdcafe455d859b02779611a5a1e1d63e498b922e05818fb3debe410a5959e9e go1.24.2.plan9-386.tar.gz
|
46f8cef02086cf04bf186c5912776b56535178d4cb319cd19c9fdbdd29231986 go1.25.0.plan9-386.tar.gz
|
||||||
81351659804fa505c1b3ec6fdf9599f7f88df08614307eeb96071bf5e2e74beb go1.24.2.plan9-amd64.tar.gz
|
29b34391d84095e44608a228f63f2f88113a37b74a79781353ec043dfbcb427b go1.25.0.plan9-amd64.tar.gz
|
||||||
6e337d5def14ed0123423c1c32e2e6d8b19161e5d5ffaa7356dad48ee0fd80b4 go1.24.2.plan9-arm.tar.gz
|
0a047107d13ebe7943aaa6d54b1d7bbd2e45e68ce449b52915a818da715799c2 go1.25.0.plan9-arm.tar.gz
|
||||||
07e6926ebc476c044d7d5b17706abfc52be52bccc2073d1734174efe63c6b35e go1.24.2.solaris-amd64.tar.gz
|
9977f9e4351984364a3b2b78f8b88bfd1d339812356d5237678514594b7d3611 go1.25.0.solaris-amd64.tar.gz
|
||||||
13d86cb818bba331da75fcd18246ab31a1067b44fb4a243b6dfd93097eda7f37 go1.24.2.windows-386.zip
|
df9f39db82a803af0db639e3613a36681ab7a42866b1384b3f3a1045663961a7 go1.25.0.windows-386.zip
|
||||||
8a702d9f7104a15bd935f4191c58c24c0b6389e066b9d5661b93915114a2bef0 go1.24.2.windows-386.msi
|
afd9e0a8d2665ff122c8302bb4a3ce4a5331e4e630ddc388be1f9238adfa8fe3 go1.25.0.windows-386.msi
|
||||||
29c553aabee0743e2ffa3e9fa0cda00ef3b3cc4ff0bc92007f31f80fd69892e1 go1.24.2.windows-amd64.zip
|
89efb4f9b30812eee083cc1770fdd2913c14d301064f6454851428f9707d190b go1.25.0.windows-amd64.zip
|
||||||
acefb191e72fea0bdb1a3f5f8f6f5ab18b42b3bbce0c7183f189f25953aff275 go1.24.2.windows-amd64.msi
|
936bd87109da515f79d80211de5bc6cbda071f2cc577f7e6af1a9e754ea34819 go1.25.0.windows-amd64.msi
|
||||||
ab267f7f9a3366d48d7664be9e627ce3e63273231430cce5f7783fb910f14148 go1.24.2.windows-arm64.zip
|
27bab004c72b3d7bd05a69b6ec0fc54a309b4b78cc569dd963d8b3ec28bfdb8c go1.25.0.windows-arm64.zip
|
||||||
d187bfe539356c39573d2f46766d1d08122b4f33da00fd14d12485fa9e241ff5 go1.24.2.windows-arm64.msi
|
357d030b217ff68e700b6cfc56097bc21ad493bb45b79733a052d112f5031ed9 go1.25.0.windows-arm64.msi
|
||||||
|
|
||||||
# version:golangci 2.0.2
|
# version:golangci 2.0.2
|
||||||
# https://github.com/golangci/golangci-lint/releases/
|
# https://github.com/golangci/golangci-lint/releases/
|
||||||
|
|
|
||||||
62
build/ci.go
62
build/ci.go
|
|
@ -59,6 +59,7 @@ import (
|
||||||
"github.com/cespare/cp"
|
"github.com/cespare/cp"
|
||||||
"github.com/ethereum/go-ethereum/crypto/signify"
|
"github.com/ethereum/go-ethereum/crypto/signify"
|
||||||
"github.com/ethereum/go-ethereum/internal/build"
|
"github.com/ethereum/go-ethereum/internal/build"
|
||||||
|
"github.com/ethereum/go-ethereum/internal/download"
|
||||||
"github.com/ethereum/go-ethereum/internal/version"
|
"github.com/ethereum/go-ethereum/internal/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -123,6 +124,7 @@ var (
|
||||||
"jammy", // 22.04, EOL: 04/2032
|
"jammy", // 22.04, EOL: 04/2032
|
||||||
"noble", // 24.04, EOL: 04/2034
|
"noble", // 24.04, EOL: 04/2034
|
||||||
"oracular", // 24.10, EOL: 07/2025
|
"oracular", // 24.10, EOL: 07/2025
|
||||||
|
"plucky", // 25.04, EOL: 01/2026
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is where the tests should be unpacked.
|
// This is where the tests should be unpacked.
|
||||||
|
|
@ -190,7 +192,7 @@ func doInstall(cmdline []string) {
|
||||||
// Configure the toolchain.
|
// Configure the toolchain.
|
||||||
tc := build.GoToolchain{GOARCH: *arch, CC: *cc}
|
tc := build.GoToolchain{GOARCH: *arch, CC: *cc}
|
||||||
if *dlgo {
|
if *dlgo {
|
||||||
csdb := build.MustLoadChecksums("build/checksums.txt")
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
tc.Root = build.DownloadGo(csdb)
|
tc.Root = build.DownloadGo(csdb)
|
||||||
}
|
}
|
||||||
// Disable CLI markdown doc generation in release builds.
|
// Disable CLI markdown doc generation in release builds.
|
||||||
|
|
@ -285,7 +287,7 @@ func doTest(cmdline []string) {
|
||||||
flag.CommandLine.Parse(cmdline)
|
flag.CommandLine.Parse(cmdline)
|
||||||
|
|
||||||
// Get test fixtures.
|
// Get test fixtures.
|
||||||
csdb := build.MustLoadChecksums("build/checksums.txt")
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
downloadSpecTestFixtures(csdb, *cachedir)
|
downloadSpecTestFixtures(csdb, *cachedir)
|
||||||
|
|
||||||
// Configure the toolchain.
|
// Configure the toolchain.
|
||||||
|
|
@ -329,16 +331,11 @@ func doTest(cmdline []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures.
|
// downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures.
|
||||||
func downloadSpecTestFixtures(csdb *build.ChecksumDB, cachedir string) string {
|
func downloadSpecTestFixtures(csdb *download.ChecksumDB, cachedir string) string {
|
||||||
executionSpecTestsVersion, err := build.Version(csdb, "spec-tests")
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
ext := ".tar.gz"
|
ext := ".tar.gz"
|
||||||
base := "fixtures_pectra-devnet-6" // TODO(s1na) rename once the version becomes part of the filename
|
base := "fixtures_fusaka-devnet-3"
|
||||||
url := fmt.Sprintf("https://github.com/ethereum/execution-spec-tests/releases/download/%s/%s%s", executionSpecTestsVersion, base, ext)
|
|
||||||
archivePath := filepath.Join(cachedir, base+ext)
|
archivePath := filepath.Join(cachedir, base+ext)
|
||||||
if err := csdb.DownloadFile(url, archivePath); err != nil {
|
if err := csdb.DownloadFileFromKnownURL(archivePath); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if err := build.ExtractArchive(archivePath, executionSpecTestsDir); err != nil {
|
if err := build.ExtractArchive(archivePath, executionSpecTestsDir); err != nil {
|
||||||
|
|
@ -347,10 +344,6 @@ func downloadSpecTestFixtures(csdb *build.ChecksumDB, cachedir string) string {
|
||||||
return filepath.Join(cachedir, base)
|
return filepath.Join(cachedir, base)
|
||||||
}
|
}
|
||||||
|
|
||||||
// doCheckTidy assets that the Go modules files are tidied already.
|
|
||||||
func doCheckTidy() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// doCheckGenerate ensures that re-generating generated files does not cause
|
// doCheckGenerate ensures that re-generating generated files does not cause
|
||||||
// any mutations in the source file tree.
|
// any mutations in the source file tree.
|
||||||
func doCheckGenerate() {
|
func doCheckGenerate() {
|
||||||
|
|
@ -444,14 +437,13 @@ func doLint(cmdline []string) {
|
||||||
|
|
||||||
// downloadLinter downloads and unpacks golangci-lint.
|
// downloadLinter downloads and unpacks golangci-lint.
|
||||||
func downloadLinter(cachedir string) string {
|
func downloadLinter(cachedir string) string {
|
||||||
csdb := build.MustLoadChecksums("build/checksums.txt")
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
version, err := build.Version(csdb, "golangci")
|
version, err := csdb.FindVersion("golangci")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
arch := runtime.GOARCH
|
arch := runtime.GOARCH
|
||||||
ext := ".tar.gz"
|
ext := ".tar.gz"
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
ext = ".zip"
|
ext = ".zip"
|
||||||
}
|
}
|
||||||
|
|
@ -459,9 +451,8 @@ func downloadLinter(cachedir string) string {
|
||||||
arch += "v" + os.Getenv("GOARM")
|
arch += "v" + os.Getenv("GOARM")
|
||||||
}
|
}
|
||||||
base := fmt.Sprintf("golangci-lint-%s-%s-%s", version, runtime.GOOS, arch)
|
base := fmt.Sprintf("golangci-lint-%s-%s-%s", version, runtime.GOOS, arch)
|
||||||
url := fmt.Sprintf("https://github.com/golangci/golangci-lint/releases/download/v%s/%s%s", version, base, ext)
|
|
||||||
archivePath := filepath.Join(cachedir, base+ext)
|
archivePath := filepath.Join(cachedir, base+ext)
|
||||||
if err := csdb.DownloadFile(url, archivePath); err != nil {
|
if err := csdb.DownloadFileFromKnownURL(archivePath); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if err := build.ExtractArchive(archivePath, cachedir); err != nil {
|
if err := build.ExtractArchive(archivePath, cachedir); err != nil {
|
||||||
|
|
@ -497,8 +488,8 @@ func protocArchiveBaseName() (string, error) {
|
||||||
// in the generate command. It returns the full path of the directory
|
// in the generate command. It returns the full path of the directory
|
||||||
// containing the 'protoc-gen-go' executable.
|
// containing the 'protoc-gen-go' executable.
|
||||||
func downloadProtocGenGo(cachedir string) string {
|
func downloadProtocGenGo(cachedir string) string {
|
||||||
csdb := build.MustLoadChecksums("build/checksums.txt")
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
version, err := build.Version(csdb, "protoc-gen-go")
|
version, err := csdb.FindVersion("protoc-gen-go")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
@ -510,10 +501,8 @@ func downloadProtocGenGo(cachedir string) string {
|
||||||
archiveName += ".tar.gz"
|
archiveName += ".tar.gz"
|
||||||
}
|
}
|
||||||
|
|
||||||
url := fmt.Sprintf("https://github.com/protocolbuffers/protobuf-go/releases/download/v%s/%s", version, archiveName)
|
|
||||||
|
|
||||||
archivePath := path.Join(cachedir, archiveName)
|
archivePath := path.Join(cachedir, archiveName)
|
||||||
if err := csdb.DownloadFile(url, archivePath); err != nil {
|
if err := csdb.DownloadFileFromKnownURL(archivePath); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
extractDest := filepath.Join(cachedir, baseName)
|
extractDest := filepath.Join(cachedir, baseName)
|
||||||
|
|
@ -531,8 +520,8 @@ func downloadProtocGenGo(cachedir string) string {
|
||||||
// files as a CI step. It returns the full path to the directory containing
|
// files as a CI step. It returns the full path to the directory containing
|
||||||
// the protoc executable.
|
// the protoc executable.
|
||||||
func downloadProtoc(cachedir string) string {
|
func downloadProtoc(cachedir string) string {
|
||||||
csdb := build.MustLoadChecksums("build/checksums.txt")
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
version, err := build.Version(csdb, "protoc")
|
version, err := csdb.FindVersion("protoc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
@ -543,10 +532,8 @@ func downloadProtoc(cachedir string) string {
|
||||||
|
|
||||||
fileName := fmt.Sprintf("protoc-%s-%s", version, baseName)
|
fileName := fmt.Sprintf("protoc-%s-%s", version, baseName)
|
||||||
archiveFileName := fileName + ".zip"
|
archiveFileName := fileName + ".zip"
|
||||||
url := fmt.Sprintf("https://github.com/protocolbuffers/protobuf/releases/download/v%s/%s", version, archiveFileName)
|
|
||||||
archivePath := filepath.Join(cachedir, archiveFileName)
|
archivePath := filepath.Join(cachedir, archiveFileName)
|
||||||
|
if err := csdb.DownloadFileFromKnownURL(archivePath); err != nil {
|
||||||
if err := csdb.DownloadFile(url, archivePath); err != nil {
|
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
extractDest := filepath.Join(cachedir, fileName)
|
extractDest := filepath.Join(cachedir, fileName)
|
||||||
|
|
@ -826,18 +813,17 @@ func doDebianSource(cmdline []string) {
|
||||||
// downloadGoBootstrapSources downloads the Go source tarball(s) that will be used
|
// downloadGoBootstrapSources downloads the Go source tarball(s) that will be used
|
||||||
// to bootstrap the builder Go.
|
// to bootstrap the builder Go.
|
||||||
func downloadGoBootstrapSources(cachedir string) []string {
|
func downloadGoBootstrapSources(cachedir string) []string {
|
||||||
csdb := build.MustLoadChecksums("build/checksums.txt")
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
|
|
||||||
var bundles []string
|
var bundles []string
|
||||||
for _, booter := range []string{"ppa-builder-1.19", "ppa-builder-1.21", "ppa-builder-1.23"} {
|
for _, booter := range []string{"ppa-builder-1.19", "ppa-builder-1.21", "ppa-builder-1.23"} {
|
||||||
gobootVersion, err := build.Version(csdb, booter)
|
gobootVersion, err := csdb.FindVersion(booter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
file := fmt.Sprintf("go%s.src.tar.gz", gobootVersion)
|
file := fmt.Sprintf("go%s.src.tar.gz", gobootVersion)
|
||||||
url := "https://dl.google.com/go/" + file
|
|
||||||
dst := filepath.Join(cachedir, file)
|
dst := filepath.Join(cachedir, file)
|
||||||
if err := csdb.DownloadFile(url, dst); err != nil {
|
if err := csdb.DownloadFileFromKnownURL(dst); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
bundles = append(bundles, dst)
|
bundles = append(bundles, dst)
|
||||||
|
|
@ -847,15 +833,14 @@ func downloadGoBootstrapSources(cachedir string) []string {
|
||||||
|
|
||||||
// downloadGoSources downloads the Go source tarball.
|
// downloadGoSources downloads the Go source tarball.
|
||||||
func downloadGoSources(cachedir string) string {
|
func downloadGoSources(cachedir string) string {
|
||||||
csdb := build.MustLoadChecksums("build/checksums.txt")
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
dlgoVersion, err := build.Version(csdb, "golang")
|
dlgoVersion, err := csdb.FindVersion("golang")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
file := fmt.Sprintf("go%s.src.tar.gz", dlgoVersion)
|
file := fmt.Sprintf("go%s.src.tar.gz", dlgoVersion)
|
||||||
url := "https://dl.google.com/go/" + file
|
|
||||||
dst := filepath.Join(cachedir, file)
|
dst := filepath.Join(cachedir, file)
|
||||||
if err := csdb.DownloadFile(url, dst); err != nil {
|
if err := csdb.DownloadFileFromKnownURL(dst); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
return dst
|
return dst
|
||||||
|
|
@ -1181,5 +1166,6 @@ func doPurge(cmdline []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func doSanityCheck() {
|
func doSanityCheck() {
|
||||||
build.DownloadAndVerifyChecksums(build.MustLoadChecksums("build/checksums.txt"))
|
csdb := download.MustLoadChecksums("build/checksums.txt")
|
||||||
|
csdb.DownloadAndVerifyAll()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ All hex encoded values must be prefixed with `0x`.
|
||||||
|
|
||||||
#### Create new password protected account
|
#### Create new password protected account
|
||||||
|
|
||||||
The signer will generate a new private key, encrypt it according to [web3 keystore spec](https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition) and store it in the keystore directory.
|
The signer will generate a new private key, encrypt it according to [web3 keystore spec](https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/) and store it in the keystore directory.
|
||||||
The client is responsible for creating a backup of the keystore. If the keystore is lost there is no method of retrieving lost accounts.
|
The client is responsible for creating a backup of the keystore. If the keystore is lost there is no method of retrieving lost accounts.
|
||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ The API-method `account_signGnosisSafeTx` was added. This method takes two param
|
||||||
```
|
```
|
||||||
|
|
||||||
Not all fields are required, though. This method is really just a UX helper, which massages the
|
Not all fields are required, though. This method is really just a UX helper, which massages the
|
||||||
input to conform to the `EIP-712` [specification](https://docs.gnosis.io/safe/docs/contracts_tx_execution/#transaction-hash)
|
input to conform to the `EIP-712` [specification](https://docs.safe.global/core-api/transaction-service-reference/gnosis)
|
||||||
for the Gnosis Safe, and making the output be directly importable to by a relay service.
|
for the Gnosis Safe, and making the output be directly importable to by a relay service.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,9 @@ func (s *Suite) dialAs(key *ecdsa.PrivateKey) (*Conn, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
conn.caps = []p2p.Cap{
|
conn.caps = []p2p.Cap{
|
||||||
{Name: "eth", Version: 67},
|
{Name: "eth", Version: 69},
|
||||||
{Name: "eth", Version: 68},
|
|
||||||
}
|
}
|
||||||
conn.ourHighestProtoVersion = 68
|
conn.ourHighestProtoVersion = 69
|
||||||
return &conn, nil
|
return &conn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,7 +129,7 @@ func (c *Conn) Write(proto Proto, code uint64, msg any) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var errDisc error = fmt.Errorf("disconnect")
|
var errDisc error = errors.New("disconnect")
|
||||||
|
|
||||||
// ReadEth reads an Eth sub-protocol wire message.
|
// ReadEth reads an Eth sub-protocol wire message.
|
||||||
func (c *Conn) ReadEth() (any, error) {
|
func (c *Conn) ReadEth() (any, error) {
|
||||||
|
|
@ -156,7 +155,7 @@ func (c *Conn) ReadEth() (any, error) {
|
||||||
var msg any
|
var msg any
|
||||||
switch int(code) {
|
switch int(code) {
|
||||||
case eth.StatusMsg:
|
case eth.StatusMsg:
|
||||||
msg = new(eth.StatusPacket)
|
msg = new(eth.StatusPacket69)
|
||||||
case eth.GetBlockHeadersMsg:
|
case eth.GetBlockHeadersMsg:
|
||||||
msg = new(eth.GetBlockHeadersPacket)
|
msg = new(eth.GetBlockHeadersPacket)
|
||||||
case eth.BlockHeadersMsg:
|
case eth.BlockHeadersMsg:
|
||||||
|
|
@ -229,9 +228,21 @@ func (c *Conn) ReadSnap() (any, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dialAndPeer creates a peer connection and runs the handshake.
|
||||||
|
func (s *Suite) dialAndPeer(status *eth.StatusPacket69) (*Conn, error) {
|
||||||
|
c, err := s.dial()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err = c.peer(s.chain, status); err != nil {
|
||||||
|
c.Close()
|
||||||
|
}
|
||||||
|
return c, err
|
||||||
|
}
|
||||||
|
|
||||||
// peer performs both the protocol handshake and the status message
|
// peer performs both the protocol handshake and the status message
|
||||||
// exchange with the node in order to peer with it.
|
// exchange with the node in order to peer with it.
|
||||||
func (c *Conn) peer(chain *Chain, status *eth.StatusPacket) error {
|
func (c *Conn) peer(chain *Chain, status *eth.StatusPacket69) error {
|
||||||
if err := c.handshake(); err != nil {
|
if err := c.handshake(); err != nil {
|
||||||
return fmt.Errorf("handshake failed: %v", err)
|
return fmt.Errorf("handshake failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -304,7 +315,7 @@ func (c *Conn) negotiateEthProtocol(caps []p2p.Cap) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// statusExchange performs a `Status` message exchange with the given node.
|
// statusExchange performs a `Status` message exchange with the given node.
|
||||||
func (c *Conn) statusExchange(chain *Chain, status *eth.StatusPacket) error {
|
func (c *Conn) statusExchange(chain *Chain, status *eth.StatusPacket69) error {
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
code, data, err := c.Read()
|
code, data, err := c.Read()
|
||||||
|
|
@ -313,11 +324,15 @@ loop:
|
||||||
}
|
}
|
||||||
switch code {
|
switch code {
|
||||||
case eth.StatusMsg + protoOffset(ethProto):
|
case eth.StatusMsg + protoOffset(ethProto):
|
||||||
msg := new(eth.StatusPacket)
|
msg := new(eth.StatusPacket69)
|
||||||
if err := rlp.DecodeBytes(data, &msg); err != nil {
|
if err := rlp.DecodeBytes(data, &msg); err != nil {
|
||||||
return fmt.Errorf("error decoding status packet: %w", err)
|
return fmt.Errorf("error decoding status packet: %w", err)
|
||||||
}
|
}
|
||||||
if have, want := msg.Head, chain.blocks[chain.Len()-1].Hash(); have != want {
|
if have, want := msg.LatestBlock, chain.blocks[chain.Len()-1].NumberU64(); have != want {
|
||||||
|
return fmt.Errorf("wrong head block in status, want: %d, have %d",
|
||||||
|
want, have)
|
||||||
|
}
|
||||||
|
if have, want := msg.LatestBlockHash, chain.blocks[chain.Len()-1].Hash(); have != want {
|
||||||
return fmt.Errorf("wrong head block in status, want: %#x (block %d) have %#x",
|
return fmt.Errorf("wrong head block in status, want: %#x (block %d) have %#x",
|
||||||
want, chain.blocks[chain.Len()-1].NumberU64(), have)
|
want, chain.blocks[chain.Len()-1].NumberU64(), have)
|
||||||
}
|
}
|
||||||
|
|
@ -348,13 +363,14 @@ loop:
|
||||||
}
|
}
|
||||||
if status == nil {
|
if status == nil {
|
||||||
// default status message
|
// default status message
|
||||||
status = ð.StatusPacket{
|
status = ð.StatusPacket69{
|
||||||
ProtocolVersion: uint32(c.negotiatedProtoVersion),
|
ProtocolVersion: uint32(c.negotiatedProtoVersion),
|
||||||
NetworkID: chain.config.ChainID.Uint64(),
|
NetworkID: chain.config.ChainID.Uint64(),
|
||||||
TD: chain.TD(),
|
|
||||||
Head: chain.blocks[chain.Len()-1].Hash(),
|
|
||||||
Genesis: chain.blocks[0].Hash(),
|
Genesis: chain.blocks[0].Hash(),
|
||||||
ForkID: chain.ForkID(),
|
ForkID: chain.ForkID(),
|
||||||
|
EarliestBlock: 0,
|
||||||
|
LatestBlock: chain.blocks[chain.Len()-1].NumberU64(),
|
||||||
|
LatestBlockHash: chain.blocks[chain.Len()-1].Hash(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := c.Write(ethProto, eth.StatusMsg, status); err != nil {
|
if err := c.Write(ethProto, eth.StatusMsg, status); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ const (
|
||||||
// Unexported devp2p protocol lengths from p2p package.
|
// Unexported devp2p protocol lengths from p2p package.
|
||||||
const (
|
const (
|
||||||
baseProtoLen = 16
|
baseProtoLen = 16
|
||||||
ethProtoLen = 17
|
ethProtoLen = 18
|
||||||
snapProtoLen = 8
|
snapProtoLen = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ package ethtest
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
@ -68,16 +69,19 @@ func (s *Suite) EthTests() []utesting.Test {
|
||||||
return []utesting.Test{
|
return []utesting.Test{
|
||||||
// status
|
// status
|
||||||
{Name: "Status", Fn: s.TestStatus},
|
{Name: "Status", Fn: s.TestStatus},
|
||||||
|
{Name: "MaliciousHandshake", Fn: s.TestMaliciousHandshake},
|
||||||
|
{Name: "BlockRangeUpdateExpired", Fn: s.TestBlockRangeUpdateHistoryExp},
|
||||||
|
{Name: "BlockRangeUpdateFuture", Fn: s.TestBlockRangeUpdateFuture},
|
||||||
|
{Name: "BlockRangeUpdateInvalid", Fn: s.TestBlockRangeUpdateInvalid},
|
||||||
// get block headers
|
// get block headers
|
||||||
{Name: "GetBlockHeaders", Fn: s.TestGetBlockHeaders},
|
{Name: "GetBlockHeaders", Fn: s.TestGetBlockHeaders},
|
||||||
{Name: "GetNonexistentBlockHeaders", Fn: s.TestGetNonexistentBlockHeaders},
|
{Name: "GetNonexistentBlockHeaders", Fn: s.TestGetNonexistentBlockHeaders},
|
||||||
{Name: "SimultaneousRequests", Fn: s.TestSimultaneousRequests},
|
{Name: "SimultaneousRequests", Fn: s.TestSimultaneousRequests},
|
||||||
{Name: "SameRequestID", Fn: s.TestSameRequestID},
|
{Name: "SameRequestID", Fn: s.TestSameRequestID},
|
||||||
{Name: "ZeroRequestID", Fn: s.TestZeroRequestID},
|
{Name: "ZeroRequestID", Fn: s.TestZeroRequestID},
|
||||||
// get block bodies
|
// get history
|
||||||
{Name: "GetBlockBodies", Fn: s.TestGetBlockBodies},
|
{Name: "GetBlockBodies", Fn: s.TestGetBlockBodies},
|
||||||
// // malicious handshakes + status
|
{Name: "GetReceipts", Fn: s.TestGetReceipts},
|
||||||
{Name: "MaliciousHandshake", Fn: s.TestMaliciousHandshake},
|
|
||||||
// test transactions
|
// test transactions
|
||||||
{Name: "LargeTxRequest", Fn: s.TestLargeTxRequest, Slow: true},
|
{Name: "LargeTxRequest", Fn: s.TestLargeTxRequest, Slow: true},
|
||||||
{Name: "Transaction", Fn: s.TestTransaction},
|
{Name: "Transaction", Fn: s.TestTransaction},
|
||||||
|
|
@ -101,15 +105,11 @@ func (s *Suite) SnapTests() []utesting.Test {
|
||||||
|
|
||||||
func (s *Suite) TestStatus(t *utesting.T) {
|
func (s *Suite) TestStatus(t *utesting.T) {
|
||||||
t.Log(`This test is just a sanity check. It performs an eth protocol handshake.`)
|
t.Log(`This test is just a sanity check. It performs an eth protocol handshake.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
conn, err := s.dial()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dial failed: %v", err)
|
t.Fatal("peering failed:", err)
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
if err := conn.peer(s.chain, nil); err != nil {
|
|
||||||
t.Fatalf("peering failed: %v", err)
|
|
||||||
}
|
}
|
||||||
|
conn.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// headersMatch returns whether the received headers match the given request
|
// headersMatch returns whether the received headers match the given request
|
||||||
|
|
@ -119,15 +119,12 @@ func headersMatch(expected []*types.Header, headers []*types.Header) bool {
|
||||||
|
|
||||||
func (s *Suite) TestGetBlockHeaders(t *utesting.T) {
|
func (s *Suite) TestGetBlockHeaders(t *utesting.T) {
|
||||||
t.Log(`This test requests block headers from the node.`)
|
t.Log(`This test requests block headers from the node.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
conn, err := s.dial()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dial failed: %v", err)
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
if err = conn.peer(s.chain, nil); err != nil {
|
|
||||||
t.Fatalf("peering failed: %v", err)
|
t.Fatalf("peering failed: %v", err)
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
// Send headers request.
|
// Send headers request.
|
||||||
req := ð.GetBlockHeadersPacket{
|
req := ð.GetBlockHeadersPacket{
|
||||||
RequestId: 33,
|
RequestId: 33,
|
||||||
|
|
@ -162,16 +159,11 @@ func (s *Suite) TestGetBlockHeaders(t *utesting.T) {
|
||||||
func (s *Suite) TestGetNonexistentBlockHeaders(t *utesting.T) {
|
func (s *Suite) TestGetNonexistentBlockHeaders(t *utesting.T) {
|
||||||
t.Log(`This test sends GetBlockHeaders requests for nonexistent blocks (using max uint64 value)
|
t.Log(`This test sends GetBlockHeaders requests for nonexistent blocks (using max uint64 value)
|
||||||
to check if the node disconnects after receiving multiple invalid requests.`)
|
to check if the node disconnects after receiving multiple invalid requests.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
conn, err := s.dial()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dial failed: %v", err)
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
if err := conn.peer(s.chain, nil); err != nil {
|
|
||||||
t.Fatalf("peering failed: %v", err)
|
t.Fatalf("peering failed: %v", err)
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
// Create request with max uint64 value for a nonexistent block
|
// Create request with max uint64 value for a nonexistent block
|
||||||
badReq := ð.GetBlockHeadersPacket{
|
badReq := ð.GetBlockHeadersPacket{
|
||||||
|
|
@ -204,15 +196,11 @@ to check if the node disconnects after receiving multiple invalid requests.`)
|
||||||
func (s *Suite) TestSimultaneousRequests(t *utesting.T) {
|
func (s *Suite) TestSimultaneousRequests(t *utesting.T) {
|
||||||
t.Log(`This test requests blocks headers from the node, performing two requests
|
t.Log(`This test requests blocks headers from the node, performing two requests
|
||||||
concurrently, with different request IDs.`)
|
concurrently, with different request IDs.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
conn, err := s.dial()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dial failed: %v", err)
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
if err := conn.peer(s.chain, nil); err != nil {
|
|
||||||
t.Fatalf("peering failed: %v", err)
|
t.Fatalf("peering failed: %v", err)
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
// Create two different requests.
|
// Create two different requests.
|
||||||
req1 := ð.GetBlockHeadersPacket{
|
req1 := ð.GetBlockHeadersPacket{
|
||||||
|
|
@ -278,15 +266,11 @@ concurrently, with different request IDs.`)
|
||||||
func (s *Suite) TestSameRequestID(t *utesting.T) {
|
func (s *Suite) TestSameRequestID(t *utesting.T) {
|
||||||
t.Log(`This test requests block headers, performing two concurrent requests with the
|
t.Log(`This test requests block headers, performing two concurrent requests with the
|
||||||
same request ID. The node should handle the request by responding to both requests.`)
|
same request ID. The node should handle the request by responding to both requests.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
conn, err := s.dial()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dial failed: %v", err)
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
if err := conn.peer(s.chain, nil); err != nil {
|
|
||||||
t.Fatalf("peering failed: %v", err)
|
t.Fatalf("peering failed: %v", err)
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
// Create two different requests with the same ID.
|
// Create two different requests with the same ID.
|
||||||
reqID := uint64(1234)
|
reqID := uint64(1234)
|
||||||
|
|
@ -349,15 +333,12 @@ same request ID. The node should handle the request by responding to both reques
|
||||||
func (s *Suite) TestZeroRequestID(t *utesting.T) {
|
func (s *Suite) TestZeroRequestID(t *utesting.T) {
|
||||||
t.Log(`This test sends a GetBlockHeaders message with a request-id of zero,
|
t.Log(`This test sends a GetBlockHeaders message with a request-id of zero,
|
||||||
and expects a response.`)
|
and expects a response.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
conn, err := s.dial()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dial failed: %v", err)
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
if err := conn.peer(s.chain, nil); err != nil {
|
|
||||||
t.Fatalf("peering failed: %v", err)
|
t.Fatalf("peering failed: %v", err)
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
req := ð.GetBlockHeadersPacket{
|
req := ð.GetBlockHeadersPacket{
|
||||||
GetBlockHeadersRequest: ð.GetBlockHeadersRequest{
|
GetBlockHeadersRequest: ð.GetBlockHeadersRequest{
|
||||||
Origin: eth.HashOrNumber{Number: 0},
|
Origin: eth.HashOrNumber{Number: 0},
|
||||||
|
|
@ -384,15 +365,12 @@ and expects a response.`)
|
||||||
|
|
||||||
func (s *Suite) TestGetBlockBodies(t *utesting.T) {
|
func (s *Suite) TestGetBlockBodies(t *utesting.T) {
|
||||||
t.Log(`This test sends GetBlockBodies requests to the node for known blocks in the test chain.`)
|
t.Log(`This test sends GetBlockBodies requests to the node for known blocks in the test chain.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
conn, err := s.dial()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dial failed: %v", err)
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
if err := conn.peer(s.chain, nil); err != nil {
|
|
||||||
t.Fatalf("peering failed: %v", err)
|
t.Fatalf("peering failed: %v", err)
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
// Create block bodies request.
|
// Create block bodies request.
|
||||||
req := ð.GetBlockBodiesPacket{
|
req := ð.GetBlockBodiesPacket{
|
||||||
RequestId: 55,
|
RequestId: 55,
|
||||||
|
|
@ -418,6 +396,47 @@ func (s *Suite) TestGetBlockBodies(t *utesting.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Suite) TestGetReceipts(t *utesting.T) {
|
||||||
|
t.Log(`This test sends GetReceipts requests to the node for known blocks in the test chain.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("peering failed: %v", err)
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
// Find some blocks containing receipts.
|
||||||
|
var hashes = make([]common.Hash, 0, 3)
|
||||||
|
for i := range s.chain.Len() {
|
||||||
|
block := s.chain.GetBlock(i)
|
||||||
|
if len(block.Transactions()) > 0 {
|
||||||
|
hashes = append(hashes, block.Hash())
|
||||||
|
}
|
||||||
|
if len(hashes) == cap(hashes) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create block bodies request.
|
||||||
|
req := ð.GetReceiptsPacket{
|
||||||
|
RequestId: 66,
|
||||||
|
GetReceiptsRequest: (eth.GetReceiptsRequest)(hashes),
|
||||||
|
}
|
||||||
|
if err := conn.Write(ethProto, eth.GetReceiptsMsg, req); err != nil {
|
||||||
|
t.Fatalf("could not write to connection: %v", err)
|
||||||
|
}
|
||||||
|
// Wait for response.
|
||||||
|
resp := new(eth.ReceiptsPacket[*eth.ReceiptList69])
|
||||||
|
if err := conn.ReadMsg(ethProto, eth.ReceiptsMsg, &resp); err != nil {
|
||||||
|
t.Fatalf("error reading block bodies msg: %v", err)
|
||||||
|
}
|
||||||
|
if got, want := resp.RequestId, req.RequestId; got != want {
|
||||||
|
t.Fatalf("unexpected request id in respond", got, want)
|
||||||
|
}
|
||||||
|
if len(resp.List) != len(req.GetReceiptsRequest) {
|
||||||
|
t.Fatalf("wrong bodies in response: expected %d bodies, got %d", len(req.GetReceiptsRequest), len(resp.List))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// randBuf makes a random buffer size kilobytes large.
|
// randBuf makes a random buffer size kilobytes large.
|
||||||
func randBuf(size int) []byte {
|
func randBuf(size int) []byte {
|
||||||
buf := make([]byte, size*1024)
|
buf := make([]byte, size*1024)
|
||||||
|
|
@ -500,6 +519,97 @@ func (s *Suite) TestMaliciousHandshake(t *utesting.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Suite) TestBlockRangeUpdateInvalid(t *utesting.T) {
|
||||||
|
t.Log(`This test sends an invalid BlockRangeUpdate message to the node and expects to be disconnected.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
conn.Write(ethProto, eth.BlockRangeUpdateMsg, ð.BlockRangeUpdatePacket{
|
||||||
|
EarliestBlock: 10,
|
||||||
|
LatestBlock: 8,
|
||||||
|
LatestBlockHash: s.chain.GetBlock(8).Hash(),
|
||||||
|
})
|
||||||
|
|
||||||
|
if code, _, err := conn.Read(); err != nil {
|
||||||
|
t.Fatalf("expected disconnect, got err: %v", err)
|
||||||
|
} else if code != discMsg {
|
||||||
|
t.Fatalf("expected disconnect message, got msg code %d", code)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Suite) TestBlockRangeUpdateFuture(t *utesting.T) {
|
||||||
|
t.Log(`This test sends a BlockRangeUpdate that is beyond the chain head.
|
||||||
|
The node should accept the update and should not disonnect.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
head := s.chain.Head().NumberU64()
|
||||||
|
var hash common.Hash
|
||||||
|
rand.Read(hash[:])
|
||||||
|
conn.Write(ethProto, eth.BlockRangeUpdateMsg, ð.BlockRangeUpdatePacket{
|
||||||
|
EarliestBlock: head + 10,
|
||||||
|
LatestBlock: head + 50,
|
||||||
|
LatestBlockHash: hash,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Ensure the node does not disconnect us.
|
||||||
|
// Just send a few ping messages.
|
||||||
|
for range 10 {
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
if err := conn.Write(baseProto, pingMsg, []any{}); err != nil {
|
||||||
|
t.Fatal("write error:", err)
|
||||||
|
}
|
||||||
|
code, _, err := conn.Read()
|
||||||
|
switch {
|
||||||
|
case err != nil:
|
||||||
|
t.Fatal("read error:", err)
|
||||||
|
case code == discMsg:
|
||||||
|
t.Fatal("got disconnect")
|
||||||
|
case code == pongMsg:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Suite) TestBlockRangeUpdateHistoryExp(t *utesting.T) {
|
||||||
|
t.Log(`This test sends a BlockRangeUpdate announcing incomplete (expired) history.
|
||||||
|
The node should accept the update and should not disonnect.`)
|
||||||
|
conn, err := s.dialAndPeer(nil)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
head := s.chain.Head()
|
||||||
|
conn.Write(ethProto, eth.BlockRangeUpdateMsg, ð.BlockRangeUpdatePacket{
|
||||||
|
EarliestBlock: head.NumberU64() - 10,
|
||||||
|
LatestBlock: head.NumberU64(),
|
||||||
|
LatestBlockHash: head.Hash(),
|
||||||
|
})
|
||||||
|
|
||||||
|
// Ensure the node does not disconnect us.
|
||||||
|
// Just send a few ping messages.
|
||||||
|
for range 10 {
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
if err := conn.Write(baseProto, pingMsg, []any{}); err != nil {
|
||||||
|
t.Fatal("write error:", err)
|
||||||
|
}
|
||||||
|
code, _, err := conn.Read()
|
||||||
|
switch {
|
||||||
|
case err != nil:
|
||||||
|
t.Fatal("read error:", err)
|
||||||
|
case code == discMsg:
|
||||||
|
t.Fatal("got disconnect")
|
||||||
|
case code == pongMsg:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Suite) TestTransaction(t *utesting.T) {
|
func (s *Suite) TestTransaction(t *utesting.T) {
|
||||||
t.Log(`This test sends a valid transaction to the node and checks if the
|
t.Log(`This test sends a valid transaction to the node and checks if the
|
||||||
transaction gets propagated.`)
|
transaction gets propagated.`)
|
||||||
|
|
@ -770,11 +880,7 @@ func makeSidecar(data ...byte) *types.BlobTxSidecar {
|
||||||
commitments = append(commitments, c)
|
commitments = append(commitments, c)
|
||||||
proofs = append(proofs, p)
|
proofs = append(proofs, p)
|
||||||
}
|
}
|
||||||
return &types.BlobTxSidecar{
|
return types.NewBlobTxSidecar(types.BlobSidecarVersion0, blobs, commitments, proofs)
|
||||||
Blobs: blobs,
|
|
||||||
Commitments: commitments,
|
|
||||||
Proofs: proofs,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) makeBlobTxs(count, blobs int, discriminator byte) (txs types.Transactions) {
|
func (s *Suite) makeBlobTxs(count, blobs int, discriminator byte) (txs types.Transactions) {
|
||||||
|
|
@ -879,14 +985,10 @@ func (s *Suite) TestBlobViolations(t *utesting.T) {
|
||||||
// data has been modified to produce a different commitment hash.
|
// data has been modified to produce a different commitment hash.
|
||||||
func mangleSidecar(tx *types.Transaction) *types.Transaction {
|
func mangleSidecar(tx *types.Transaction) *types.Transaction {
|
||||||
sidecar := tx.BlobTxSidecar()
|
sidecar := tx.BlobTxSidecar()
|
||||||
copy := types.BlobTxSidecar{
|
cpy := sidecar.Copy()
|
||||||
Blobs: append([]kzg4844.Blob{}, sidecar.Blobs...),
|
|
||||||
Commitments: append([]kzg4844.Commitment{}, sidecar.Commitments...),
|
|
||||||
Proofs: append([]kzg4844.Proof{}, sidecar.Proofs...),
|
|
||||||
}
|
|
||||||
// zero the first commitment to alter the sidecar hash
|
// zero the first commitment to alter the sidecar hash
|
||||||
copy.Commitments[0] = kzg4844.Commitment{}
|
cpy.Commitments[0] = kzg4844.Commitment{}
|
||||||
return tx.WithBlobTxSidecar(©)
|
return tx.WithBlobTxSidecar(cpy)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestBlobTxWithoutSidecar(t *utesting.T) {
|
func (s *Suite) TestBlobTxWithoutSidecar(t *utesting.T) {
|
||||||
|
|
@ -991,7 +1093,7 @@ func (s *Suite) testBadBlobTx(t *utesting.T, tx *types.Transaction, badTx *types
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !readUntilDisconnect(conn) {
|
if !readUntilDisconnect(conn) {
|
||||||
errc <- fmt.Errorf("expected bad peer to be disconnected")
|
errc <- errors.New("expected bad peer to be disconnected")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
stage3.Done()
|
stage3.Done()
|
||||||
|
|
@ -1038,7 +1140,7 @@ func (s *Suite) testBadBlobTx(t *utesting.T, tx *types.Transaction, badTx *types
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.GetPooledTransactionsRequest[0] != tx.Hash() {
|
if req.GetPooledTransactionsRequest[0] != tx.Hash() {
|
||||||
errc <- fmt.Errorf("requested unknown tx hash")
|
errc <- errors.New("requested unknown tx hash")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1048,7 +1150,7 @@ func (s *Suite) testBadBlobTx(t *utesting.T, tx *types.Transaction, badTx *types
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if readUntilDisconnect(conn) {
|
if readUntilDisconnect(conn) {
|
||||||
errc <- fmt.Errorf("unexpected disconnect")
|
errc <- errors.New("unexpected disconnect")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
close(errc)
|
close(errc)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/internal/utesting"
|
"github.com/ethereum/go-ethereum/internal/utesting"
|
||||||
"github.com/ethereum/go-ethereum/p2p/discover/v4wire"
|
"github.com/ethereum/go-ethereum/p2p/discover/v4wire"
|
||||||
|
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -501,6 +502,36 @@ func FindnodeAmplificationWrongIP(t *utesting.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ENRRequest(t *utesting.T) {
|
||||||
|
t.Log(`This test sends an ENRRequest packet and expects a response containing a valid ENR.`)
|
||||||
|
|
||||||
|
te := newTestEnv(Remote, Listen1, Listen2)
|
||||||
|
defer te.close()
|
||||||
|
bond(t, te)
|
||||||
|
|
||||||
|
req := &v4wire.ENRRequest{Expiration: futureExpiration()}
|
||||||
|
hash := te.send(te.l1, req)
|
||||||
|
|
||||||
|
response, _, err := te.read(te.l1)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal("read error:", err)
|
||||||
|
}
|
||||||
|
enrResp, ok := response.(*v4wire.ENRResponse)
|
||||||
|
if !ok {
|
||||||
|
t.Fatalf("expected ENRResponse packet, got %T", response)
|
||||||
|
}
|
||||||
|
if !bytes.Equal(enrResp.ReplyTok, hash) {
|
||||||
|
t.Errorf("wrong hash in response packet: got %x, want %x", enrResp.ReplyTok, hash)
|
||||||
|
}
|
||||||
|
node, err := enode.New(enode.ValidSchemes, &enrResp.Record)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("invalid record in response: %v", err)
|
||||||
|
}
|
||||||
|
if node.ID() != te.remote.ID() {
|
||||||
|
t.Errorf("wrong node ID in response: got %v, want %v", node.ID(), te.remote.ID())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var AllTests = []utesting.Test{
|
var AllTests = []utesting.Test{
|
||||||
{Name: "Ping/Basic", Fn: BasicPing},
|
{Name: "Ping/Basic", Fn: BasicPing},
|
||||||
{Name: "Ping/WrongTo", Fn: PingWrongTo},
|
{Name: "Ping/WrongTo", Fn: PingWrongTo},
|
||||||
|
|
@ -510,6 +541,7 @@ var AllTests = []utesting.Test{
|
||||||
{Name: "Ping/PastExpiration", Fn: PingPastExpiration},
|
{Name: "Ping/PastExpiration", Fn: PingPastExpiration},
|
||||||
{Name: "Ping/WrongPacketType", Fn: WrongPacketType},
|
{Name: "Ping/WrongPacketType", Fn: WrongPacketType},
|
||||||
{Name: "Ping/BondThenPingWithWrongFrom", Fn: BondThenPingWithWrongFrom},
|
{Name: "Ping/BondThenPingWithWrongFrom", Fn: BondThenPingWithWrongFrom},
|
||||||
|
{Name: "ENRRequest", Fn: ENRRequest},
|
||||||
{Name: "Findnode/WithoutEndpointProof", Fn: FindnodeWithoutEndpointProof},
|
{Name: "Findnode/WithoutEndpointProof", Fn: FindnodeWithoutEndpointProof},
|
||||||
{Name: "Findnode/BasicFindnode", Fn: BasicFindnode},
|
{Name: "Findnode/BasicFindnode", Fn: BasicFindnode},
|
||||||
{Name: "Findnode/UnsolicitedNeighbors", Fn: UnsolicitedNeighbors},
|
{Name: "Findnode/UnsolicitedNeighbors", Fn: UnsolicitedNeighbors},
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ func runBlockTest(ctx *cli.Context, fname string) ([]testResult, error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
result := &testResult{Name: name, Pass: true}
|
result := &testResult{Name: name, Pass: true}
|
||||||
if err := tests[name].Run(false, rawdb.HashScheme, ctx.Bool(WitnessCrossCheckFlag.Name), tracer, func(res error, chain *core.BlockChain) {
|
if err := tests[name].Run(false, rawdb.PathScheme, ctx.Bool(WitnessCrossCheckFlag.Name), tracer, func(res error, chain *core.BlockChain) {
|
||||||
if ctx.Bool(DumpFlag.Name) {
|
if ctx.Bool(DumpFlag.Name) {
|
||||||
if s, _ := chain.State(); s != nil {
|
if s, _ := chain.State(); s != nil {
|
||||||
result.State = dump(s)
|
result.State = dump(s)
|
||||||
|
|
|
||||||
|
|
@ -1,228 +0,0 @@
|
||||||
// Copyright 2024 The go-ethereum Authors
|
|
||||||
// This file is part of go-ethereum.
|
|
||||||
//
|
|
||||||
// go-ethereum is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// go-ethereum is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bufio"
|
|
||||||
"encoding/hex"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"io/fs"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
|
||||||
"github.com/ethereum/go-ethereum/log"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
var jt vm.JumpTable
|
|
||||||
|
|
||||||
const initcode = "INITCODE"
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
jt = vm.NewEOFInstructionSetForTesting()
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
hexFlag = &cli.StringFlag{
|
|
||||||
Name: "hex",
|
|
||||||
Usage: "Single container data parse and validation",
|
|
||||||
}
|
|
||||||
refTestFlag = &cli.StringFlag{
|
|
||||||
Name: "test",
|
|
||||||
Usage: "Path to EOF validation reference test.",
|
|
||||||
}
|
|
||||||
eofParseCommand = &cli.Command{
|
|
||||||
Name: "eofparse",
|
|
||||||
Aliases: []string{"eof"},
|
|
||||||
Usage: "Parses hex eof container and returns validation errors (if any)",
|
|
||||||
Action: eofParseAction,
|
|
||||||
Flags: []cli.Flag{
|
|
||||||
hexFlag,
|
|
||||||
refTestFlag,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
eofDumpCommand = &cli.Command{
|
|
||||||
Name: "eofdump",
|
|
||||||
Usage: "Parses hex eof container and prints out human-readable representation of the container.",
|
|
||||||
Action: eofDumpAction,
|
|
||||||
Flags: []cli.Flag{
|
|
||||||
hexFlag,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func eofParseAction(ctx *cli.Context) error {
|
|
||||||
// If `--test` is set, parse and validate the reference test at the provided path.
|
|
||||||
if ctx.IsSet(refTestFlag.Name) {
|
|
||||||
var (
|
|
||||||
file = ctx.String(refTestFlag.Name)
|
|
||||||
executedTests int
|
|
||||||
passedTests int
|
|
||||||
)
|
|
||||||
err := filepath.Walk(file, func(path string, info fs.FileInfo, err error) error {
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if info.IsDir() {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
log.Debug("Executing test", "name", info.Name())
|
|
||||||
passed, tot, err := executeTest(path)
|
|
||||||
passedTests += passed
|
|
||||||
executedTests += tot
|
|
||||||
return err
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
log.Info("Executed tests", "passed", passedTests, "total executed", executedTests)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
// If `--hex` is set, parse and validate the hex string argument.
|
|
||||||
if ctx.IsSet(hexFlag.Name) {
|
|
||||||
if _, err := parseAndValidate(ctx.String(hexFlag.Name), false); err != nil {
|
|
||||||
return fmt.Errorf("err: %w", err)
|
|
||||||
}
|
|
||||||
fmt.Println("OK")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
// If neither are passed in, read input from stdin.
|
|
||||||
scanner := bufio.NewScanner(os.Stdin)
|
|
||||||
scanner.Buffer(make([]byte, 1024*1024), 10*1024*1024)
|
|
||||||
for scanner.Scan() {
|
|
||||||
l := strings.TrimSpace(scanner.Text())
|
|
||||||
if strings.HasPrefix(l, "#") || l == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if _, err := parseAndValidate(l, false); err != nil {
|
|
||||||
fmt.Printf("err: %v\n", err)
|
|
||||||
} else {
|
|
||||||
fmt.Println("OK")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := scanner.Err(); err != nil {
|
|
||||||
fmt.Println(err.Error())
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type refTests struct {
|
|
||||||
Vectors map[string]eOFTest `json:"vectors"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type eOFTest struct {
|
|
||||||
Code string `json:"code"`
|
|
||||||
Results map[string]etResult `json:"results"`
|
|
||||||
ContainerKind string `json:"containerKind"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type etResult struct {
|
|
||||||
Result bool `json:"result"`
|
|
||||||
Exception string `json:"exception,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func executeTest(path string) (int, int, error) {
|
|
||||||
src, err := os.ReadFile(path)
|
|
||||||
if err != nil {
|
|
||||||
return 0, 0, err
|
|
||||||
}
|
|
||||||
var testsByName map[string]refTests
|
|
||||||
if err := json.Unmarshal(src, &testsByName); err != nil {
|
|
||||||
return 0, 0, err
|
|
||||||
}
|
|
||||||
passed, total := 0, 0
|
|
||||||
for testsName, tests := range testsByName {
|
|
||||||
for name, tt := range tests.Vectors {
|
|
||||||
for fork, r := range tt.Results {
|
|
||||||
total++
|
|
||||||
_, err := parseAndValidate(tt.Code, tt.ContainerKind == initcode)
|
|
||||||
if r.Result && err != nil {
|
|
||||||
log.Error("Test failure, expected validation success", "name", testsName, "idx", name, "fork", fork, "err", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !r.Result && err == nil {
|
|
||||||
log.Error("Test failure, expected validation error", "name", testsName, "idx", name, "fork", fork, "have err", r.Exception, "err", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
passed++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return passed, total, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func parseAndValidate(s string, isInitCode bool) (*vm.Container, error) {
|
|
||||||
if len(s) >= 2 && strings.HasPrefix(s, "0x") {
|
|
||||||
s = s[2:]
|
|
||||||
}
|
|
||||||
b, err := hex.DecodeString(s)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("unable to decode data: %w", err)
|
|
||||||
}
|
|
||||||
return parse(b, isInitCode)
|
|
||||||
}
|
|
||||||
|
|
||||||
func parse(b []byte, isInitCode bool) (*vm.Container, error) {
|
|
||||||
var c vm.Container
|
|
||||||
if err := c.UnmarshalBinary(b, isInitCode); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if err := c.ValidateCode(&jt, isInitCode); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &c, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func eofDumpAction(ctx *cli.Context) error {
|
|
||||||
// If `--hex` is set, parse and validate the hex string argument.
|
|
||||||
if ctx.IsSet(hexFlag.Name) {
|
|
||||||
return eofDump(ctx.String(hexFlag.Name))
|
|
||||||
}
|
|
||||||
// Otherwise read from stdin
|
|
||||||
scanner := bufio.NewScanner(os.Stdin)
|
|
||||||
scanner.Buffer(make([]byte, 1024*1024), 10*1024*1024)
|
|
||||||
for scanner.Scan() {
|
|
||||||
l := strings.TrimSpace(scanner.Text())
|
|
||||||
if strings.HasPrefix(l, "#") || l == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err := eofDump(l); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println("")
|
|
||||||
}
|
|
||||||
return scanner.Err()
|
|
||||||
}
|
|
||||||
|
|
||||||
func eofDump(hexdata string) error {
|
|
||||||
if len(hexdata) >= 2 && strings.HasPrefix(hexdata, "0x") {
|
|
||||||
hexdata = hexdata[2:]
|
|
||||||
}
|
|
||||||
b, err := hex.DecodeString(hexdata)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("unable to decode data: %w", err)
|
|
||||||
}
|
|
||||||
var c vm.Container
|
|
||||||
if err := c.UnmarshalBinary(b, false); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println(c.String())
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,182 +0,0 @@
|
||||||
// Copyright 2024 The go-ethereum Authors
|
|
||||||
// This file is part of go-ethereum.
|
|
||||||
//
|
|
||||||
// go-ethereum is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
//
|
|
||||||
// go-ethereum is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bufio"
|
|
||||||
"bytes"
|
|
||||||
"encoding/hex"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
|
||||||
)
|
|
||||||
|
|
||||||
func FuzzEofParsing(f *testing.F) {
|
|
||||||
// Seed with corpus from execution-spec-tests
|
|
||||||
for i := 0; ; i++ {
|
|
||||||
fname := fmt.Sprintf("testdata/eof/eof_corpus_%d.txt", i)
|
|
||||||
corpus, err := os.Open(fname)
|
|
||||||
if err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
f.Logf("Reading seed data from %v", fname)
|
|
||||||
scanner := bufio.NewScanner(corpus)
|
|
||||||
scanner.Buffer(make([]byte, 1024), 10*1024*1024)
|
|
||||||
for scanner.Scan() {
|
|
||||||
s := scanner.Text()
|
|
||||||
if len(s) >= 2 && strings.HasPrefix(s, "0x") {
|
|
||||||
s = s[2:]
|
|
||||||
}
|
|
||||||
b, err := hex.DecodeString(s)
|
|
||||||
if err != nil {
|
|
||||||
panic(err) // rotten corpus
|
|
||||||
}
|
|
||||||
f.Add(b)
|
|
||||||
}
|
|
||||||
corpus.Close()
|
|
||||||
if err := scanner.Err(); err != nil {
|
|
||||||
panic(err) // rotten corpus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// And do the fuzzing
|
|
||||||
f.Fuzz(func(t *testing.T, data []byte) {
|
|
||||||
var (
|
|
||||||
jt = vm.NewEOFInstructionSetForTesting()
|
|
||||||
c vm.Container
|
|
||||||
)
|
|
||||||
cpy := common.CopyBytes(data)
|
|
||||||
if err := c.UnmarshalBinary(data, true); err == nil {
|
|
||||||
c.ValidateCode(&jt, true)
|
|
||||||
if have := c.MarshalBinary(); !bytes.Equal(have, data) {
|
|
||||||
t.Fatal("Unmarshal-> Marshal failure!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := c.UnmarshalBinary(data, false); err == nil {
|
|
||||||
c.ValidateCode(&jt, false)
|
|
||||||
if have := c.MarshalBinary(); !bytes.Equal(have, data) {
|
|
||||||
t.Fatal("Unmarshal-> Marshal failure!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !bytes.Equal(cpy, data) {
|
|
||||||
panic("data modified during unmarshalling")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEofParseInitcode(t *testing.T) {
|
|
||||||
testEofParse(t, true, "testdata/eof/results.initcode.txt")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEofParseRegular(t *testing.T) {
|
|
||||||
testEofParse(t, false, "testdata/eof/results.regular.txt")
|
|
||||||
}
|
|
||||||
|
|
||||||
func testEofParse(t *testing.T, isInitCode bool, wantFile string) {
|
|
||||||
var wantFn func() string
|
|
||||||
var wantLoc = 0
|
|
||||||
{ // Configure the want-reader
|
|
||||||
wants, err := os.Open(wantFile)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
scanner := bufio.NewScanner(wants)
|
|
||||||
scanner.Buffer(make([]byte, 1024), 10*1024*1024)
|
|
||||||
wantFn = func() string {
|
|
||||||
if scanner.Scan() {
|
|
||||||
wantLoc++
|
|
||||||
return scanner.Text()
|
|
||||||
}
|
|
||||||
return "end of file reached"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; ; i++ {
|
|
||||||
fname := fmt.Sprintf("testdata/eof/eof_corpus_%d.txt", i)
|
|
||||||
corpus, err := os.Open(fname)
|
|
||||||
if err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
t.Logf("# Reading seed data from %v", fname)
|
|
||||||
scanner := bufio.NewScanner(corpus)
|
|
||||||
scanner.Buffer(make([]byte, 1024), 10*1024*1024)
|
|
||||||
line := 1
|
|
||||||
for scanner.Scan() {
|
|
||||||
s := scanner.Text()
|
|
||||||
if len(s) >= 2 && strings.HasPrefix(s, "0x") {
|
|
||||||
s = s[2:]
|
|
||||||
}
|
|
||||||
b, err := hex.DecodeString(s)
|
|
||||||
if err != nil {
|
|
||||||
panic(err) // rotten corpus
|
|
||||||
}
|
|
||||||
have := "OK"
|
|
||||||
if _, err := parse(b, isInitCode); err != nil {
|
|
||||||
have = fmt.Sprintf("ERR: %v", err)
|
|
||||||
}
|
|
||||||
if false { // Change this to generate the want-output
|
|
||||||
fmt.Printf("%v\n", have)
|
|
||||||
} else {
|
|
||||||
want := wantFn()
|
|
||||||
if have != want {
|
|
||||||
if len(want) > 100 {
|
|
||||||
want = want[:100]
|
|
||||||
}
|
|
||||||
if len(b) > 100 {
|
|
||||||
b = b[:100]
|
|
||||||
}
|
|
||||||
t.Errorf("%v:%d\n%v\ninput %x\nisInit: %v\nhave: %q\nwant: %q\n",
|
|
||||||
fname, line, fmt.Sprintf("%v:%d", wantFile, wantLoc), b, isInitCode, have, want)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
line++
|
|
||||||
}
|
|
||||||
corpus.Close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func BenchmarkEofParse(b *testing.B) {
|
|
||||||
corpus, err := os.Open("testdata/eof/eof_benches.txt")
|
|
||||||
if err != nil {
|
|
||||||
b.Fatal(err)
|
|
||||||
}
|
|
||||||
defer corpus.Close()
|
|
||||||
scanner := bufio.NewScanner(corpus)
|
|
||||||
scanner.Buffer(make([]byte, 1024), 10*1024*1024)
|
|
||||||
line := 1
|
|
||||||
for scanner.Scan() {
|
|
||||||
s := scanner.Text()
|
|
||||||
if len(s) >= 2 && strings.HasPrefix(s, "0x") {
|
|
||||||
s = s[2:]
|
|
||||||
}
|
|
||||||
data, err := hex.DecodeString(s)
|
|
||||||
if err != nil {
|
|
||||||
b.Fatal(err) // rotten corpus
|
|
||||||
}
|
|
||||||
b.Run(fmt.Sprintf("test-%d", line), func(b *testing.B) {
|
|
||||||
b.ReportAllocs()
|
|
||||||
b.SetBytes(int64(len(data)))
|
|
||||||
for i := 0; i < b.N; i++ {
|
|
||||||
_, _ = parse(data, false)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
line++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -303,7 +303,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the receipt logs and create the bloom filter.
|
// Set the receipt logs and create the bloom filter.
|
||||||
receipt.Logs = statedb.GetLogs(tx.Hash(), vmContext.BlockNumber.Uint64(), blockHash)
|
receipt.Logs = statedb.GetLogs(tx.Hash(), vmContext.BlockNumber.Uint64(), blockHash, vmContext.Time)
|
||||||
receipt.Bloom = types.CreateBloom(receipt)
|
receipt.Bloom = types.CreateBloom(receipt)
|
||||||
|
|
||||||
// These three are non-consensus fields:
|
// These three are non-consensus fields:
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,9 @@ func Transaction(ctx *cli.Context) error {
|
||||||
if chainConfig.IsShanghai(new(big.Int), 0) && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
|
if chainConfig.IsShanghai(new(big.Int), 0) && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
|
||||||
r.Error = errors.New("max initcode size exceeded")
|
r.Error = errors.New("max initcode size exceeded")
|
||||||
}
|
}
|
||||||
|
if chainConfig.IsOsaka(new(big.Int), 0) && tx.Gas() > params.MaxTxGas {
|
||||||
|
r.Error = errors.New("gas limit exceeds maximum")
|
||||||
|
}
|
||||||
results = append(results, r)
|
results = append(results, r)
|
||||||
}
|
}
|
||||||
out, err := json.MarshalIndent(results, "", " ")
|
out, err := json.MarshalIndent(results, "", " ")
|
||||||
|
|
|
||||||
|
|
@ -210,8 +210,6 @@ func init() {
|
||||||
stateTransitionCommand,
|
stateTransitionCommand,
|
||||||
transactionCommand,
|
transactionCommand,
|
||||||
blockBuilderCommand,
|
blockBuilderCommand,
|
||||||
eofParseCommand,
|
|
||||||
eofDumpCommand,
|
|
||||||
}
|
}
|
||||||
app.Before = func(ctx *cli.Context) error {
|
app.Before = func(ctx *cli.Context) error {
|
||||||
flags.MigrateGlobalFlags(ctx)
|
flags.MigrateGlobalFlags(ctx)
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,12 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"slices"
|
"slices"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -39,8 +42,10 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/ethdb"
|
"github.com/ethereum/go-ethereum/ethdb"
|
||||||
"github.com/ethereum/go-ethereum/internal/debug"
|
"github.com/ethereum/go-ethereum/internal/debug"
|
||||||
"github.com/ethereum/go-ethereum/internal/era"
|
"github.com/ethereum/go-ethereum/internal/era"
|
||||||
|
"github.com/ethereum/go-ethereum/internal/era/eradl"
|
||||||
"github.com/ethereum/go-ethereum/internal/flags"
|
"github.com/ethereum/go-ethereum/internal/flags"
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
|
"github.com/ethereum/go-ethereum/node"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
@ -53,7 +58,7 @@ var (
|
||||||
ArgsUsage: "<genesisPath>",
|
ArgsUsage: "<genesisPath>",
|
||||||
Flags: slices.Concat([]cli.Flag{
|
Flags: slices.Concat([]cli.Flag{
|
||||||
utils.CachePreimagesFlag,
|
utils.CachePreimagesFlag,
|
||||||
utils.OverridePrague,
|
utils.OverrideOsaka,
|
||||||
utils.OverrideVerkle,
|
utils.OverrideVerkle,
|
||||||
}, utils.DatabaseFlags),
|
}, utils.DatabaseFlags),
|
||||||
Description: `
|
Description: `
|
||||||
|
|
@ -190,7 +195,7 @@ This command dumps out the state for a given block (or latest, if none provided)
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
pruneCommand = &cli.Command{
|
pruneHistoryCommand = &cli.Command{
|
||||||
Action: pruneHistory,
|
Action: pruneHistory,
|
||||||
Name: "prune-history",
|
Name: "prune-history",
|
||||||
Usage: "Prune blockchain history (block bodies and receipts) up to the merge block",
|
Usage: "Prune blockchain history (block bodies and receipts) up to the merge block",
|
||||||
|
|
@ -201,6 +206,42 @@ The prune-history command removes historical block bodies and receipts from the
|
||||||
blockchain database up to the merge block, while preserving block headers. This
|
blockchain database up to the merge block, while preserving block headers. This
|
||||||
helps reduce storage requirements for nodes that don't need full historical data.`,
|
helps reduce storage requirements for nodes that don't need full historical data.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
downloadEraCommand = &cli.Command{
|
||||||
|
Action: downloadEra,
|
||||||
|
Name: "download-era",
|
||||||
|
Usage: "Fetches era1 files (pre-merge history) from an HTTP endpoint",
|
||||||
|
ArgsUsage: "",
|
||||||
|
Flags: slices.Concat(
|
||||||
|
utils.DatabaseFlags,
|
||||||
|
utils.NetworkFlags,
|
||||||
|
[]cli.Flag{
|
||||||
|
eraBlockFlag,
|
||||||
|
eraEpochFlag,
|
||||||
|
eraAllFlag,
|
||||||
|
eraServerFlag,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
eraBlockFlag = &cli.StringFlag{
|
||||||
|
Name: "block",
|
||||||
|
Usage: "Block number to fetch. (can also be a range <start>-<end>)",
|
||||||
|
}
|
||||||
|
eraEpochFlag = &cli.StringFlag{
|
||||||
|
Name: "epoch",
|
||||||
|
Usage: "Epoch number to fetch (can also be a range <start>-<end>)",
|
||||||
|
}
|
||||||
|
eraAllFlag = &cli.BoolFlag{
|
||||||
|
Name: "all",
|
||||||
|
Usage: "Download all available era1 files",
|
||||||
|
}
|
||||||
|
eraServerFlag = &cli.StringFlag{
|
||||||
|
Name: "server",
|
||||||
|
Usage: "era1 server URL",
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// initGenesis will initialise the given JSON format genesis file and writes it as
|
// initGenesis will initialise the given JSON format genesis file and writes it as
|
||||||
|
|
@ -228,19 +269,16 @@ func initGenesis(ctx *cli.Context) error {
|
||||||
defer stack.Close()
|
defer stack.Close()
|
||||||
|
|
||||||
var overrides core.ChainOverrides
|
var overrides core.ChainOverrides
|
||||||
if ctx.IsSet(utils.OverridePrague.Name) {
|
if ctx.IsSet(utils.OverrideOsaka.Name) {
|
||||||
v := ctx.Uint64(utils.OverridePrague.Name)
|
v := ctx.Uint64(utils.OverrideOsaka.Name)
|
||||||
overrides.OverridePrague = &v
|
overrides.OverrideOsaka = &v
|
||||||
}
|
}
|
||||||
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
||||||
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
||||||
overrides.OverrideVerkle = &v
|
overrides.OverrideVerkle = &v
|
||||||
}
|
}
|
||||||
|
|
||||||
chaindb, err := stack.OpenDatabaseWithFreezer("chaindata", 0, 0, ctx.String(utils.AncientFlag.Name), "", false)
|
chaindb := utils.MakeChainDatabase(ctx, stack, false)
|
||||||
if err != nil {
|
|
||||||
utils.Fatalf("Failed to open database: %v", err)
|
|
||||||
}
|
|
||||||
defer chaindb.Close()
|
defer chaindb.Close()
|
||||||
|
|
||||||
triedb := utils.MakeTrieDatabase(ctx, chaindb, ctx.Bool(utils.CachePreimagesFlag.Name), false, genesis.IsVerkle())
|
triedb := utils.MakeTrieDatabase(ctx, chaindb, ctx.Bool(utils.CachePreimagesFlag.Name), false, genesis.IsVerkle())
|
||||||
|
|
@ -277,7 +315,7 @@ func dumpGenesis(ctx *cli.Context) error {
|
||||||
// dump whatever already exists in the datadir
|
// dump whatever already exists in the datadir
|
||||||
stack, _ := makeConfigNode(ctx)
|
stack, _ := makeConfigNode(ctx)
|
||||||
|
|
||||||
db, err := stack.OpenDatabase("chaindata", 0, 0, "", true)
|
db, err := stack.OpenDatabaseWithOptions("chaindata", node.DatabaseOptions{ReadOnly: true})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -538,8 +576,8 @@ func parseDumpConfig(ctx *cli.Context, db ethdb.Database) (*state.DumpConfig, co
|
||||||
arg := ctx.Args().First()
|
arg := ctx.Args().First()
|
||||||
if hashish(arg) {
|
if hashish(arg) {
|
||||||
hash := common.HexToHash(arg)
|
hash := common.HexToHash(arg)
|
||||||
if number := rawdb.ReadHeaderNumber(db, hash); number != nil {
|
if number, ok := rawdb.ReadHeaderNumber(db, hash); ok {
|
||||||
header = rawdb.ReadHeader(db, hash, *number)
|
header = rawdb.ReadHeader(db, hash, number)
|
||||||
} else {
|
} else {
|
||||||
return nil, common.Hash{}, fmt.Errorf("block %x not found", hash)
|
return nil, common.Hash{}, fmt.Errorf("block %x not found", hash)
|
||||||
}
|
}
|
||||||
|
|
@ -665,3 +703,93 @@ func pruneHistory(ctx *cli.Context) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// downloadEra is the era1 file downloader tool.
|
||||||
|
func downloadEra(ctx *cli.Context) error {
|
||||||
|
flags.CheckExclusive(ctx, eraBlockFlag, eraEpochFlag, eraAllFlag)
|
||||||
|
|
||||||
|
// Resolve the network.
|
||||||
|
var network = "mainnet"
|
||||||
|
if utils.IsNetworkPreset(ctx) {
|
||||||
|
switch {
|
||||||
|
case ctx.IsSet(utils.MainnetFlag.Name):
|
||||||
|
case ctx.IsSet(utils.SepoliaFlag.Name):
|
||||||
|
network = "sepolia"
|
||||||
|
default:
|
||||||
|
return errors.New("unsupported network, no known era1 checksums")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve the destination directory.
|
||||||
|
stack, _ := makeConfigNode(ctx)
|
||||||
|
defer stack.Close()
|
||||||
|
|
||||||
|
ancients := stack.ResolveAncient("chaindata", "")
|
||||||
|
dir := filepath.Join(ancients, rawdb.ChainFreezerName, "era")
|
||||||
|
if ctx.IsSet(utils.EraFlag.Name) {
|
||||||
|
dir = filepath.Join(ancients, ctx.String(utils.EraFlag.Name))
|
||||||
|
}
|
||||||
|
|
||||||
|
baseURL := ctx.String(eraServerFlag.Name)
|
||||||
|
if baseURL == "" {
|
||||||
|
return fmt.Errorf("need --%s flag to download", eraServerFlag.Name)
|
||||||
|
}
|
||||||
|
|
||||||
|
l, err := eradl.New(baseURL, network)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
switch {
|
||||||
|
case ctx.IsSet(eraAllFlag.Name):
|
||||||
|
return l.DownloadAll(dir)
|
||||||
|
|
||||||
|
case ctx.IsSet(eraBlockFlag.Name):
|
||||||
|
s := ctx.String(eraBlockFlag.Name)
|
||||||
|
start, end, ok := parseRange(s)
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("invalid block range: %q", s)
|
||||||
|
}
|
||||||
|
return l.DownloadBlockRange(start, end, dir)
|
||||||
|
|
||||||
|
case ctx.IsSet(eraEpochFlag.Name):
|
||||||
|
s := ctx.String(eraEpochFlag.Name)
|
||||||
|
start, end, ok := parseRange(s)
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("invalid epoch range: %q", s)
|
||||||
|
}
|
||||||
|
return l.DownloadEpochRange(start, end, dir)
|
||||||
|
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("specify one of --%s, --%s, or --%s to download", eraAllFlag.Name, eraBlockFlag.Name, eraEpochFlag.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseRange(s string) (start uint64, end uint64, ok bool) {
|
||||||
|
log.Info("Parsing block range", "input", s)
|
||||||
|
if m, _ := regexp.MatchString("^[0-9]+-[0-9]+$", s); m {
|
||||||
|
s1, s2, _ := strings.Cut(s, "-")
|
||||||
|
start, err := strconv.ParseUint(s1, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
end, err = strconv.ParseUint(s2, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
if start > end {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
log.Info("Parsing block range", "start", start, "end", end)
|
||||||
|
return start, end, true
|
||||||
|
}
|
||||||
|
if m, _ := regexp.MatchString("^[0-9]+$", s); m {
|
||||||
|
start, err := strconv.ParseUint(s, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
end = start
|
||||||
|
log.Info("Parsing single block range", "block", start)
|
||||||
|
return start, end, true
|
||||||
|
}
|
||||||
|
return 0, 0, false
|
||||||
|
}
|
||||||
|
|
|
||||||
98
cmd/geth/chaincmd_test.go
Normal file
98
cmd/geth/chaincmd_test.go
Normal file
|
|
@ -0,0 +1,98 @@
|
||||||
|
// Copyright 2025 The go-ethereum Authors
|
||||||
|
// This file is part of go-ethereum.
|
||||||
|
//
|
||||||
|
// go-ethereum is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// go-ethereum is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestParseRange(t *testing.T) {
|
||||||
|
var cases = []struct {
|
||||||
|
input string
|
||||||
|
valid bool
|
||||||
|
expStart uint64
|
||||||
|
expEnd uint64
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
input: "0",
|
||||||
|
valid: true,
|
||||||
|
expStart: 0,
|
||||||
|
expEnd: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "500",
|
||||||
|
valid: true,
|
||||||
|
expStart: 500,
|
||||||
|
expEnd: 500,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "-1",
|
||||||
|
valid: false,
|
||||||
|
expStart: 0,
|
||||||
|
expEnd: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "1-1",
|
||||||
|
valid: true,
|
||||||
|
expStart: 1,
|
||||||
|
expEnd: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "0-1",
|
||||||
|
valid: true,
|
||||||
|
expStart: 0,
|
||||||
|
expEnd: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "1-0",
|
||||||
|
valid: false,
|
||||||
|
expStart: 0,
|
||||||
|
expEnd: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "1-1000",
|
||||||
|
valid: true,
|
||||||
|
expStart: 1,
|
||||||
|
expEnd: 1000,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "1-1-",
|
||||||
|
valid: false,
|
||||||
|
expStart: 0,
|
||||||
|
expEnd: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: "-1-1",
|
||||||
|
valid: false,
|
||||||
|
expStart: 0,
|
||||||
|
expEnd: 0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, c := range cases {
|
||||||
|
start, end, valid := parseRange(c.input)
|
||||||
|
if valid != c.valid {
|
||||||
|
t.Errorf("Unexpected result, want: %t, got: %t", c.valid, valid)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if valid {
|
||||||
|
if c.expStart != start {
|
||||||
|
t.Errorf("Unexpected start, want: %d, got: %d", c.expStart, start)
|
||||||
|
}
|
||||||
|
if c.expEnd != end {
|
||||||
|
t.Errorf("Unexpected end, want: %d, got: %d", c.expEnd, end)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -36,6 +36,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/eth/catalyst"
|
"github.com/ethereum/go-ethereum/eth/catalyst"
|
||||||
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
||||||
"github.com/ethereum/go-ethereum/internal/flags"
|
"github.com/ethereum/go-ethereum/internal/flags"
|
||||||
|
|
@ -180,12 +181,51 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
|
||||||
return stack, cfg
|
return stack, cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// constructs the disclaimer text block which will be printed in the logs upon
|
||||||
|
// startup when Geth is running in dev mode.
|
||||||
|
func constructDevModeBanner(ctx *cli.Context, cfg gethConfig) string {
|
||||||
|
devModeBanner := `You are running Geth in --dev mode. Please note the following:
|
||||||
|
|
||||||
|
1. This mode is only intended for fast, iterative development without assumptions on
|
||||||
|
security or persistence.
|
||||||
|
2. The database is created in memory unless specified otherwise. Therefore, shutting down
|
||||||
|
your computer or losing power will wipe your entire block data and chain state for
|
||||||
|
your dev environment.
|
||||||
|
3. A random, pre-allocated developer account will be available and unlocked as
|
||||||
|
eth.coinbase, which can be used for testing. The random dev account is temporary,
|
||||||
|
stored on a ramdisk, and will be lost if your machine is restarted.
|
||||||
|
4. Mining is enabled by default. However, the client will only seal blocks if transactions
|
||||||
|
are pending in the mempool. The miner's minimum accepted gas price is 1.
|
||||||
|
5. Networking is disabled; there is no listen-address, the maximum number of peers is set
|
||||||
|
to 0, and discovery is disabled.
|
||||||
|
`
|
||||||
|
if !ctx.IsSet(utils.DataDirFlag.Name) {
|
||||||
|
devModeBanner += fmt.Sprintf(`
|
||||||
|
|
||||||
|
Running in ephemeral mode. The following account has been prefunded in the genesis:
|
||||||
|
|
||||||
|
Account
|
||||||
|
------------------
|
||||||
|
0x%x (10^49 ETH)
|
||||||
|
`, cfg.Eth.Miner.PendingFeeRecipient)
|
||||||
|
if cfg.Eth.Miner.PendingFeeRecipient == utils.DeveloperAddr {
|
||||||
|
devModeBanner += fmt.Sprintf(`
|
||||||
|
Private Key
|
||||||
|
------------------
|
||||||
|
0x%x
|
||||||
|
`, crypto.FromECDSA(utils.DeveloperKey))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return devModeBanner
|
||||||
|
}
|
||||||
|
|
||||||
// makeFullNode loads geth configuration and creates the Ethereum backend.
|
// makeFullNode loads geth configuration and creates the Ethereum backend.
|
||||||
func makeFullNode(ctx *cli.Context) *node.Node {
|
func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
stack, cfg := makeConfigNode(ctx)
|
stack, cfg := makeConfigNode(ctx)
|
||||||
if ctx.IsSet(utils.OverridePrague.Name) {
|
if ctx.IsSet(utils.OverrideOsaka.Name) {
|
||||||
v := ctx.Uint64(utils.OverridePrague.Name)
|
v := ctx.Uint64(utils.OverrideOsaka.Name)
|
||||||
cfg.Eth.OverridePrague = &v
|
cfg.Eth.OverrideOsaka = &v
|
||||||
}
|
}
|
||||||
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
||||||
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
||||||
|
|
@ -222,14 +262,16 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
if cfg.Ethstats.URL != "" {
|
if cfg.Ethstats.URL != "" {
|
||||||
utils.RegisterEthStatsService(stack, backend, cfg.Ethstats.URL)
|
utils.RegisterEthStatsService(stack, backend, cfg.Ethstats.URL)
|
||||||
}
|
}
|
||||||
// Configure full-sync tester service if requested
|
// Configure synchronization override service
|
||||||
|
var synctarget common.Hash
|
||||||
if ctx.IsSet(utils.SyncTargetFlag.Name) {
|
if ctx.IsSet(utils.SyncTargetFlag.Name) {
|
||||||
hex := hexutil.MustDecode(ctx.String(utils.SyncTargetFlag.Name))
|
hex := hexutil.MustDecode(ctx.String(utils.SyncTargetFlag.Name))
|
||||||
if len(hex) != common.HashLength {
|
if len(hex) != common.HashLength {
|
||||||
utils.Fatalf("invalid sync target length: have %d, want %d", len(hex), common.HashLength)
|
utils.Fatalf("invalid sync target length: have %d, want %d", len(hex), common.HashLength)
|
||||||
}
|
}
|
||||||
utils.RegisterFullSyncTester(stack, eth, common.BytesToHash(hex))
|
synctarget = common.BytesToHash(hex)
|
||||||
}
|
}
|
||||||
|
utils.RegisterSyncOverrideService(stack, eth, synctarget, ctx.Bool(utils.ExitWhenSyncedFlag.Name))
|
||||||
|
|
||||||
if ctx.IsSet(utils.DeveloperFlag.Name) {
|
if ctx.IsSet(utils.DeveloperFlag.Name) {
|
||||||
// Start dev mode.
|
// Start dev mode.
|
||||||
|
|
@ -239,6 +281,11 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
}
|
}
|
||||||
catalyst.RegisterSimulatedBeaconAPIs(stack, simBeacon)
|
catalyst.RegisterSimulatedBeaconAPIs(stack, simBeacon)
|
||||||
stack.RegisterLifecycle(simBeacon)
|
stack.RegisterLifecycle(simBeacon)
|
||||||
|
|
||||||
|
banner := constructDevModeBanner(ctx, cfg)
|
||||||
|
for _, line := range strings.Split(banner, "\n") {
|
||||||
|
log.Warn(line)
|
||||||
|
}
|
||||||
} else if ctx.IsSet(utils.BeaconApiFlag.Name) {
|
} else if ctx.IsSet(utils.BeaconApiFlag.Name) {
|
||||||
// Start blsync mode.
|
// Start blsync mode.
|
||||||
srv := rpc.NewServer()
|
srv := rpc.NewServer()
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ var (
|
||||||
utils.NoUSBFlag, // deprecated
|
utils.NoUSBFlag, // deprecated
|
||||||
utils.USBFlag,
|
utils.USBFlag,
|
||||||
utils.SmartCardDaemonPathFlag,
|
utils.SmartCardDaemonPathFlag,
|
||||||
utils.OverridePrague,
|
utils.OverrideOsaka,
|
||||||
utils.OverrideVerkle,
|
utils.OverrideVerkle,
|
||||||
utils.EnablePersonal, // deprecated
|
utils.EnablePersonal, // deprecated
|
||||||
utils.TxPoolLocalsFlag,
|
utils.TxPoolLocalsFlag,
|
||||||
|
|
@ -91,13 +91,7 @@ var (
|
||||||
utils.LogNoHistoryFlag,
|
utils.LogNoHistoryFlag,
|
||||||
utils.LogExportCheckpointsFlag,
|
utils.LogExportCheckpointsFlag,
|
||||||
utils.StateHistoryFlag,
|
utils.StateHistoryFlag,
|
||||||
utils.LightServeFlag, // deprecated
|
|
||||||
utils.LightIngressFlag, // deprecated
|
|
||||||
utils.LightEgressFlag, // deprecated
|
|
||||||
utils.LightMaxPeersFlag, // deprecated
|
|
||||||
utils.LightNoPruneFlag, // deprecated
|
|
||||||
utils.LightKDFFlag,
|
utils.LightKDFFlag,
|
||||||
utils.LightNoSyncServeFlag, // deprecated
|
|
||||||
utils.EthRequiredBlocksFlag,
|
utils.EthRequiredBlocksFlag,
|
||||||
utils.LegacyWhitelistFlag, // deprecated
|
utils.LegacyWhitelistFlag, // deprecated
|
||||||
utils.CacheFlag,
|
utils.CacheFlag,
|
||||||
|
|
@ -225,7 +219,8 @@ func init() {
|
||||||
removedbCommand,
|
removedbCommand,
|
||||||
dumpCommand,
|
dumpCommand,
|
||||||
dumpGenesisCommand,
|
dumpGenesisCommand,
|
||||||
pruneCommand,
|
pruneHistoryCommand,
|
||||||
|
downloadEraCommand,
|
||||||
// See accountcmd.go:
|
// See accountcmd.go:
|
||||||
accountCommand,
|
accountCommand,
|
||||||
walletCommand,
|
walletCommand,
|
||||||
|
|
@ -299,24 +294,6 @@ func prepare(ctx *cli.Context) {
|
||||||
case ctx.IsSet(utils.HoodiFlag.Name):
|
case ctx.IsSet(utils.HoodiFlag.Name):
|
||||||
log.Info("Starting Geth on Hoodi testnet...")
|
log.Info("Starting Geth on Hoodi testnet...")
|
||||||
|
|
||||||
case ctx.IsSet(utils.DeveloperFlag.Name):
|
|
||||||
log.Info("Starting Geth in ephemeral dev mode...")
|
|
||||||
log.Warn(`You are running Geth in --dev mode. Please note the following:
|
|
||||||
|
|
||||||
1. This mode is only intended for fast, iterative development without assumptions on
|
|
||||||
security or persistence.
|
|
||||||
2. The database is created in memory unless specified otherwise. Therefore, shutting down
|
|
||||||
your computer or losing power will wipe your entire block data and chain state for
|
|
||||||
your dev environment.
|
|
||||||
3. A random, pre-allocated developer account will be available and unlocked as
|
|
||||||
eth.coinbase, which can be used for testing. The random dev account is temporary,
|
|
||||||
stored on a ramdisk, and will be lost if your machine is restarted.
|
|
||||||
4. Mining is enabled by default. However, the client will only seal blocks if transactions
|
|
||||||
are pending in the mempool. The miner's minimum accepted gas price is 1.
|
|
||||||
5. Networking is disabled; there is no listen-address, the maximum number of peers is set
|
|
||||||
to 0, and discovery is disabled.
|
|
||||||
`)
|
|
||||||
|
|
||||||
case !ctx.IsSet(utils.NetworkIdFlag.Name):
|
case !ctx.IsSet(utils.NetworkIdFlag.Name):
|
||||||
log.Info("Starting Geth on Ethereum mainnet...")
|
log.Info("Starting Geth on Ethereum mainnet...")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,27 @@ func verifyState(ctx *cli.Context) error {
|
||||||
triedb := utils.MakeTrieDatabase(ctx, chaindb, false, true, false)
|
triedb := utils.MakeTrieDatabase(ctx, chaindb, false, true, false)
|
||||||
defer triedb.Close()
|
defer triedb.Close()
|
||||||
|
|
||||||
|
var (
|
||||||
|
err error
|
||||||
|
root = headBlock.Root()
|
||||||
|
)
|
||||||
|
if ctx.NArg() == 1 {
|
||||||
|
root, err = parseRoot(ctx.Args().First())
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Failed to resolve state root", "err", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if triedb.Scheme() == rawdb.PathScheme {
|
||||||
|
if err := triedb.VerifyState(root); err != nil {
|
||||||
|
log.Error("Failed to verify state", "root", root, "err", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Info("Verified the state", "root", root)
|
||||||
|
|
||||||
|
// TODO(rjl493456442) implement dangling checks in pathdb.
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
snapConfig := snapshot.Config{
|
snapConfig := snapshot.Config{
|
||||||
CacheSize: 256,
|
CacheSize: 256,
|
||||||
Recovery: false,
|
Recovery: false,
|
||||||
|
|
@ -231,24 +252,13 @@ func verifyState(ctx *cli.Context) error {
|
||||||
log.Error("Failed to open snapshot tree", "err", err)
|
log.Error("Failed to open snapshot tree", "err", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if ctx.NArg() > 1 {
|
|
||||||
log.Error("Too many arguments given")
|
|
||||||
return errors.New("too many arguments")
|
|
||||||
}
|
|
||||||
var root = headBlock.Root()
|
|
||||||
if ctx.NArg() == 1 {
|
|
||||||
root, err = parseRoot(ctx.Args().First())
|
|
||||||
if err != nil {
|
|
||||||
log.Error("Failed to resolve state root", "err", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := snaptree.Verify(root); err != nil {
|
if err := snaptree.Verify(root); err != nil {
|
||||||
log.Error("Failed to verify state", "root", root, "err", err)
|
log.Error("Failed to verify state", "root", root, "err", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Info("Verified the state", "root", root)
|
log.Info("Verified the state", "root", root)
|
||||||
return snapshot.CheckDanglingStorage(chaindb)
|
return snapshot.CheckDanglingStorage(chaindb)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// checkDanglingStorage iterates the snap storage data, and verifies that all
|
// checkDanglingStorage iterates the snap storage data, and verifies that all
|
||||||
|
|
|
||||||
161
cmd/geth/testdata/vcheck/data.json
vendored
161
cmd/geth/testdata/vcheck/data.json
vendored
|
|
@ -6,28 +6,33 @@
|
||||||
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://github.com/ethereum/go-ethereum/pull/21793",
|
"https://github.com/ethereum/go-ethereum/pull/21793",
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49"
|
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-v592-xf75-856p"
|
||||||
],
|
],
|
||||||
"introduced": "v1.6.0",
|
"introduced": "v1.6.0",
|
||||||
"fixed": "v1.9.24",
|
"fixed": "v1.9.24",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Medium",
|
"severity": "Medium",
|
||||||
"check": "Geth\\/v1\\.(6|7|8)\\..*|Geth\\/v1\\.9\\.2(1|2|3)-.*"
|
"CVE": "CVE-2020-26240",
|
||||||
|
"check": "Geth\\/v1\\.(6|7|8)\\..*|Geth\\/v1\\.9\\.\\d-.*|Geth\\/v1\\.9\\.1.*|Geth\\/v1\\.9\\.2(0|1|2|3)-.*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "GoCrash",
|
"name": "Denial of service due to Go CVE-2020-28362",
|
||||||
"uid": "GETH-2020-02",
|
"uid": "GETH-2020-02",
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
||||||
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
||||||
"https://github.com/golang/go/issues/42552"
|
"https://github.com/golang/go/issues/42552",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-m6gx-rhvj-fh52"
|
||||||
],
|
],
|
||||||
|
"introduced": "v0.0.0",
|
||||||
"fixed": "v1.9.24",
|
"fixed": "v1.9.24",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Critical",
|
"severity": "Critical",
|
||||||
|
"CVE": "CVE-2020-28362",
|
||||||
"check": "Geth.*\\/go1\\.(11(.*)|12(.*)|13(.*)|14|14\\.(\\d|10|11|)|15|15\\.[0-4])$"
|
"check": "Geth.*\\/go1\\.(11(.*)|12(.*)|13(.*)|14|14\\.(\\d|10|11|)|15|15\\.[0-4])$"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -36,26 +41,162 @@
|
||||||
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
||||||
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/"
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-69v6-xc2j-r2jf"
|
||||||
],
|
],
|
||||||
"introduced": "v1.9.7",
|
"introduced": "v1.9.7",
|
||||||
"fixed": "v1.9.17",
|
"fixed": "v1.9.17",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Critical",
|
"severity": "Critical",
|
||||||
|
"CVE": "CVE-2020-26241",
|
||||||
"check": "Geth\\/v1\\.9\\.(7|8|9|10|11|12|13|14|15|16).*$"
|
"check": "Geth\\/v1\\.9\\.(7|8|9|10|11|12|13|14|15|16).*$"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "GethCrash",
|
"name": "Geth DoS via MULMOD",
|
||||||
"uid": "GETH-2020-04",
|
"uid": "GETH-2020-04",
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
||||||
"description": "Full details to be disclosed at a later date",
|
"description": "Affected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. \nThe crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442).\n\n\tif `d == 0`, `dLen` remains `0`\n\nand https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`.\n\nThe `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. \nExploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. \n\nThe issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network.\n \nIt was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency.\n",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/"
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-jm5c-rv3w-w83m",
|
||||||
|
"https://github.com/holiman/uint256/releases/tag/v1.1.1",
|
||||||
|
"https://github.com/holiman/uint256/pull/80",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/21368"
|
||||||
],
|
],
|
||||||
"introduced": "v1.9.16",
|
"introduced": "v1.9.16",
|
||||||
"fixed": "v1.9.18",
|
"fixed": "v1.9.18",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Critical",
|
"severity": "Critical",
|
||||||
|
"CVE": "CVE-2020-26242",
|
||||||
"check": "Geth\\/v1\\.9.(16|17).*$"
|
"check": "Geth\\/v1\\.9.(16|17).*$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LES Server DoS via GetProofsV2",
|
||||||
|
"uid": "GETH-2020-05",
|
||||||
|
"summary": "A DoS vulnerability can make a LES server crash.",
|
||||||
|
"description": "A DoS vulnerability can make a LES server crash via malicious GetProofsV2 request from a connected LES client.\n\nThe vulnerability was patched in #21896.\n\nThis vulnerability only concern users explicitly running geth as a light server",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-r33q-22hv-j29q",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/21896"
|
||||||
|
],
|
||||||
|
"introduced": "v1.8.0",
|
||||||
|
"fixed": "v1.9.25",
|
||||||
|
"published": "2020-12-10",
|
||||||
|
"severity": "Medium",
|
||||||
|
"CVE": "CVE-2020-26264",
|
||||||
|
"check": "(Geth\\/v1\\.8\\.*)|(Geth\\/v1\\.9\\.\\d-.*)|(Geth\\/v1\\.9\\.1\\d-.*)|(Geth\\/v1\\.9\\.(20|21|22|23|24)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SELFDESTRUCT-recreate consensus flaw",
|
||||||
|
"uid": "GETH-2020-06",
|
||||||
|
"introduced": "v1.9.4",
|
||||||
|
"fixed": "v1.9.20",
|
||||||
|
"summary": "A consensus-vulnerability in Geth could cause a chain split, where vulnerable versions refuse to accept the canonical chain.",
|
||||||
|
"description": "A flaw was repoted at 2020-08-11 by John Youngseok Yang (Software Platform Lab), where a particular sequence of transactions could cause a consensus failure.\n\n- Tx 1:\n - `sender` invokes `caller`.\n - `caller` invokes `0xaa`. `0xaa` has 3 wei, does a self-destruct-to-self\n - `caller` does a `1 wei` -call to `0xaa`, who thereby has 1 wei (the code in `0xaa` still executed, since the tx is still ongoing, but doesn't redo the selfdestruct, it takes a different path if callvalue is non-zero)\n\n-Tx 2:\n - `sender` does a 5-wei call to 0xaa. No exec (since no code). \n\nIn geth, the result would be that `0xaa` had `6 wei`, whereas OE reported (correctly) `5` wei. Furthermore, in geth, if the second tx was not executed, the `0xaa` would be destructed, resulting in `0 wei`. Thus obviously wrong. \n\nIt was determined that the root cause was this [commit](https://github.com/ethereum/go-ethereum/commit/223b950944f494a5b4e0957fd9f92c48b09037ad) from [this PR](https://github.com/ethereum/go-ethereum/pull/19953). The semantics of `createObject` was subtly changd, into returning a non-nil object (with `deleted=true`) where it previously did not if the account had been destructed. This return value caused the new object to inherit the old `balance`.\n",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-xw37-57qp-9mm4"
|
||||||
|
],
|
||||||
|
"published": "2020-12-10",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2020-26265",
|
||||||
|
"check": "(Geth\\/v1\\.9\\.(4|5|6|7|8|9)-.*)|(Geth\\/v1\\.9\\.1\\d-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Not ready for London upgrade",
|
||||||
|
"uid": "GETH-2021-01",
|
||||||
|
"summary": "The client is not ready for the 'London' technical upgrade, and will deviate from the canonical chain when the London upgrade occurs (at block '12965000' around August 4, 2021.",
|
||||||
|
"description": "At (or around) August 4, Ethereum will undergo a technical upgrade called 'London'. Clients not upgraded will fail to progress on the canonical chain.",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",
|
||||||
|
"https://notes.ethereum.org/@timbeiko/ropsten-postmortem"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.1",
|
||||||
|
"fixed": "v1.10.6",
|
||||||
|
"published": "2021-07-22",
|
||||||
|
"severity": "High",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(1|2|3|4|5)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RETURNDATA corruption via datacopy",
|
||||||
|
"uid": "GETH-2021-02",
|
||||||
|
"summary": "A consensus-flaw in the Geth EVM could cause a node to deviate from the canonical chain.",
|
||||||
|
"description": "A memory-corruption bug within the EVM can cause a consensus error, where vulnerable nodes obtain a different `stateRoot` when processing a maliciously crafted transaction. This, in turn, would lead to the chain being split: mainnet splitting in two forks.\n\nAll Geth versions supporting the London hard fork are vulnerable (the bug is older than London), so all users should update.\n\nThis bug was exploited on Mainnet at block 13107518.\n\nCredits for the discovery go to @guidovranken (working for Sentnl during an audit of the Telos EVM) and reported via bounty@ethereum.org.",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/blob/master/docs/postmortems/2021-08-22-split-postmortem.md",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-9856-9gg9-qcmq",
|
||||||
|
"https://github.com/ethereum/go-ethereum/releases/tag/v1.10.8"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.10.8",
|
||||||
|
"published": "2021-08-24",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2021-39137",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(0|1|2|3|4|5|6|7)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious `snap/1` request",
|
||||||
|
"uid": "GETH-2021-03",
|
||||||
|
"summary": "A vulnerable node is susceptible to crash when processing a maliciously crafted message from a peer, via the snap/1 protocol. The crash can be triggered by sending a malicious snap/1 GetTrieNodes package.",
|
||||||
|
"description": "The `snap/1` protocol handler contains two vulnerabilities related to the `GetTrieNodes` packet, which can be exploited to crash the node. Full details are available at the Github security [advisory](https://github.com/ethereum/go-ethereum/security/advisories/GHSA-59hh-656j-3p7v)",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-59hh-656j-3p7v",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/23657"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.10.9",
|
||||||
|
"published": "2021-10-24",
|
||||||
|
"severity": "Medium",
|
||||||
|
"CVE": "CVE-2021-41173",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(0|1|2|3|4|5|6|7|8)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious p2p message",
|
||||||
|
"uid": "GETH-2022-01",
|
||||||
|
"summary": "A vulnerable node can crash via p2p messages sent from an attacker node, if running with non-default log options.",
|
||||||
|
"description": "A vulnerable node, if configured to use high verbosity logging, can be made to crash when handling specially crafted p2p messages sent from an attacker node. Full details are available at the Github security [advisory](https://github.com/ethereum/go-ethereum/security/advisories/GHSA-wjxw-gh3m-7pm5)",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-wjxw-gh3m-7pm5",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/24507"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.10.17",
|
||||||
|
"published": "2022-05-11",
|
||||||
|
"severity": "Low",
|
||||||
|
"CVE": "CVE-2022-29177",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious p2p message",
|
||||||
|
"uid": "GETH-2023-01",
|
||||||
|
"summary": "A vulnerable node can be made to consume unbounded amounts of memory when handling specially crafted p2p messages sent from an attacker node.",
|
||||||
|
"description": "The p2p handler spawned a new goroutine to respond to ping requests. By flooding a node with ping requests, an unbounded number of goroutines can be created, leading to resource exhaustion and potentially crash due to OOM.",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-ppjg-v974-84cm",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.12.1",
|
||||||
|
"published": "2023-09-06",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2023-40591",
|
||||||
|
"check": "(Geth\\/v1\\.(10|11)\\..*)|(Geth\\/v1\\.12\\.0-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious p2p message",
|
||||||
|
"uid": "GETH-2024-01",
|
||||||
|
"summary": "A vulnerable node can be made to consume very large amounts of memory when handling specially crafted p2p messages sent from an attacker node.",
|
||||||
|
"description": "A vulnerable node can be made to consume very large amounts of memory when handling specially crafted p2p messages sent from an attacker node. Full details will be available at the Github security [advisory](https://github.com/ethereum/go-ethereum/security/advisories/GHSA-4xc9-8hmq-j652)",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-4xc9-8hmq-j652",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.13.15",
|
||||||
|
"published": "2024-05-06",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2024-32972",
|
||||||
|
"check": "(Geth\\/v1\\.(10|11|12)\\..*)|(Geth\\/v1\\.13\\.\\d-.*)|(Geth\\/v1\\.13\\.1(0|1|2|3|4)-.*)$"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: signature from minisign secret key
|
untrusted comment: signature from minisign secret key
|
||||||
RUQkliYstQBOKLK05Sy5f3bVRMBqJT26ABo6Vbp3BNJAVjejoqYCu4GWE/+7qcDfHBqYIniDCbFIUvYEnOHxV6vZ93wO1xJWDQw=
|
RUQkliYstQBOKHklFEYCUjepz81dyUuDmIAxjAvXa+icjGuKcjtVfV06G7qfOMSpplS5EcntU12n+AnGNyuOM8zIctaIWcfG2w0=
|
||||||
trusted comment: timestamp:1693986492 file:data.json hashed
|
trusted comment: timestamp:1752094689 file:data.json hashed
|
||||||
6Fdw2H+W1ZXK7QXSF77Z5AWC7+AEFAfDmTSxNGylU5HLT1AuSJQmxslj+VjtUBamYCvOuET7plbXza942AlWDw==
|
u2e4wo4HBTU6viQTSY/NVBHoWoPFJnnTvLZS0FYl3JdvSOYi6+qpbEsDhAIFqq/n8VmlS/fPqqf7vKCNiAgjAA==
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: signature from minisign secret key
|
untrusted comment: signature from minisign secret key
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
RWQkliYstQBOKNoyq2O98hPmeVJQ6ShQLM58+4n0gkY0y0trFMDAsHuN/l4IyHfh8dDQ1ry0+IuZVrf/i8M/P3YFzFfAymDYCQ0=
|
||||||
trusted comment: timestamp:1605618622 file:vulnerabilities.json
|
trusted comment: timestamp:1752094703 file:data.json
|
||||||
osAPs4QPdDkmiWQxqeMIzYv/b+ZGxJ+19Sbrk1Cpq4t2gHBT+lqFtwL3OCzKWWyjGRTmHfsVGBYpzEdPRQ0/BQ==
|
cNyq3ZGlqo785HtWODb9ejWqF0HhSeXuLGXzC7z1IhnDrBObWBJngYd3qBG1dQcYlHQ+bgB/On5mSyMFn4UoCQ==
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: Here's a comment
|
untrusted comment: Here's a comment
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
RWQkliYstQBOKNoyq2O98hPmeVJQ6ShQLM58+4n0gkY0y0trFMDAsHuN/l4IyHfh8dDQ1ry0+IuZVrf/i8M/P3YFzFfAymDYCQ0=
|
||||||
trusted comment: Here's a trusted comment
|
trusted comment: Here's a trusted comment
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
dL7lO8sqFFCOXJO/u8SgoDk2nlXGWPRDbOTJkChMbmtUp9PB7sG831basXkZ/0CQ/l/vG7AbPyMNEVZyJn5NCg==
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: One more (untrusted) comment
|
untrusted comment: One more (untrusted™) comment
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
RWQkliYstQBOKNoyq2O98hPmeVJQ6ShQLM58+4n0gkY0y0trFMDAsHuN/l4IyHfh8dDQ1ry0+IuZVrf/i8M/P3YFzFfAymDYCQ0=
|
||||||
trusted comment: Here's a trusted comment
|
trusted comment: Here's a trusted comment
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
dL7lO8sqFFCOXJO/u8SgoDk2nlXGWPRDbOTJkChMbmtUp9PB7sG831basXkZ/0CQ/l/vG7AbPyMNEVZyJn5NCg==
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
untrusted comment: verify with ./signifykey.pub
|
untrusted comment: verify with signifykey.pub
|
||||||
RWSKLNhZb0KdAbhRUhW2LQZXdnwttu2SYhM9EuC4mMgOJB85h7/YIPupf8/ldTs4N8e9Y/fhgdY40q5LQpt5IFC62fq0v8U1/w8=
|
RWSKLNhZb0KdARbMcGN40hbHzKQYZDgDOFhEUT1YpzMnqre/mbKJ8td/HVlG03Am1YCszATiI0DbnljjTy4iNHYwqBfzrFUqUg0=
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
untrusted comment: signature from minisign secret key
|
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
|
||||||
trusted comment: timestamp:1605618622 file:vulnerabilities.json
|
|
||||||
osAPs4QPdDkmiWQxqeMIzYv/b+ZGxJ+19Sbrk1Cpq4t2gHBT+lqFtwL3OCzKWWyjGRTmHfsVGBYpzEdPRQ0/BQ==
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
untrusted comment: Here's a comment
|
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
|
||||||
trusted comment: Here's a trusted comment
|
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
untrusted comment: One more (untrusted) comment
|
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
|
||||||
trusted comment: Here's a trusted comment
|
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://github.com/ethereum/go-ethereum/pull/21793",
|
"https://github.com/ethereum/go-ethereum/pull/21793",
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49",
|
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-v592-xf75-856p"
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-v592-xf75-856p"
|
||||||
],
|
],
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
||||||
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
||||||
"https://github.com/golang/go/issues/42552",
|
"https://github.com/golang/go/issues/42552",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-m6gx-rhvj-fh52"
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-m6gx-rhvj-fh52"
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
||||||
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-69v6-xc2j-r2jf"
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-69v6-xc2j-r2jf"
|
||||||
],
|
],
|
||||||
"introduced": "v1.9.7",
|
"introduced": "v1.9.7",
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
||||||
"description": "Affected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. \nThe crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442).\n\n\tif `d == 0`, `dLen` remains `0`\n\nand https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`.\n\nThe `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. \nExploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. \n\nThe issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network.\n \nIt was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency.\n",
|
"description": "Affected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. \nThe crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442).\n\n\tif `d == 0`, `dLen` remains `0`\n\nand https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`.\n\nThe `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. \nExploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. \n\nThe issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network.\n \nIt was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency.\n",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-jm5c-rv3w-w83m",
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-jm5c-rv3w-w83m",
|
||||||
"https://github.com/holiman/uint256/releases/tag/v1.1.1",
|
"https://github.com/holiman/uint256/releases/tag/v1.1.1",
|
||||||
"https://github.com/holiman/uint256/pull/80",
|
"https://github.com/holiman/uint256/pull/80",
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,9 @@ func TestVerification(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// For this test, the pubkey is in testdata/vcheck/minisign.pub
|
// For this test, the pubkey is in testdata/vcheck/minisign.pub
|
||||||
// (the privkey is `minisign.sec`, if we want to expand this test. Password 'test' )
|
// (the privkey is `minisign.sec`, if we want to expand this test. Password 'test' )
|
||||||
|
// 1. `minisign -S -l -s ./minisign.sec -m data.json -x ./minisig-sigs/vulnerabilities.json.minisig.1 -c "signature from minisign secret key"`
|
||||||
|
// 2. `minisign -S -l -s ./minisign.sec -m vulnerabilities.json -x ./minisig-sigs/vulnerabilities.json.minisig.2 -c "Here's a comment" -t "Here's a trusted comment"`
|
||||||
|
// 3. minisign -S -l -s ./minisign.sec -m vulnerabilities.json -x ./minisig-sigs/vulnerabilities.json.minisig.3 -c "One more (untrusted™) comment" -t "Here's a trusted comment"
|
||||||
pub := "RWQkliYstQBOKOdtClfgC3IypIPX6TAmoEi7beZ4gyR3wsaezvqOMWsp"
|
pub := "RWQkliYstQBOKOdtClfgC3IypIPX6TAmoEi7beZ4gyR3wsaezvqOMWsp"
|
||||||
testVerification(t, pub, "./testdata/vcheck/minisig-sigs/")
|
testVerification(t, pub, "./testdata/vcheck/minisig-sigs/")
|
||||||
})
|
})
|
||||||
|
|
@ -53,6 +56,7 @@ func TestVerification(t *testing.T) {
|
||||||
t.Skip("This currently fails, minisign expects 4 lines of data, signify provides only 2")
|
t.Skip("This currently fails, minisign expects 4 lines of data, signify provides only 2")
|
||||||
// For this test, the pubkey is in testdata/vcheck/signifykey.pub
|
// For this test, the pubkey is in testdata/vcheck/signifykey.pub
|
||||||
// (the privkey is `signifykey.sec`, if we want to expand this test. Password 'test' )
|
// (the privkey is `signifykey.sec`, if we want to expand this test. Password 'test' )
|
||||||
|
// `signify -S -s signifykey.sec -m data.json -x ./signify-sigs/data.json.sig`
|
||||||
pub := "RWSKLNhZb0KdATtRT7mZC/bybI3t3+Hv/O2i3ye04Dq9fnT9slpZ1a2/"
|
pub := "RWSKLNhZb0KdATtRT7mZC/bybI3t3+Hv/O2i3ye04Dq9fnT9slpZ1a2/"
|
||||||
testVerification(t, pub, "./testdata/vcheck/signify-sigs/")
|
testVerification(t, pub, "./testdata/vcheck/signify-sigs/")
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,8 @@ func ImportHistory(chain *core.BlockChain, dir string, network string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error reading receipts %d: %w", it.Number(), err)
|
return fmt.Errorf("error reading receipts %d: %w", it.Number(), err)
|
||||||
}
|
}
|
||||||
if _, err := chain.InsertReceiptChain([]*types.Block{block}, []types.Receipts{receipts}, 2^64-1); err != nil {
|
encReceipts := types.EncodeBlockReceiptLists([]types.Receipts{receipts})
|
||||||
|
if _, err := chain.InsertReceiptChain([]*types.Block{block}, encReceipts, 2^64-1); err != nil {
|
||||||
return fmt.Errorf("error inserting body %d: %w", it.Number(), err)
|
return fmt.Errorf("error inserting body %d: %w", it.Number(), err)
|
||||||
}
|
}
|
||||||
imported += 1
|
imported += 1
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,10 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/crypto/kzg4844"
|
"github.com/ethereum/go-ethereum/crypto/kzg4844"
|
||||||
"github.com/ethereum/go-ethereum/eth"
|
"github.com/ethereum/go-ethereum/eth"
|
||||||
"github.com/ethereum/go-ethereum/eth/catalyst"
|
|
||||||
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
||||||
"github.com/ethereum/go-ethereum/eth/filters"
|
"github.com/ethereum/go-ethereum/eth/filters"
|
||||||
"github.com/ethereum/go-ethereum/eth/gasprice"
|
"github.com/ethereum/go-ethereum/eth/gasprice"
|
||||||
|
"github.com/ethereum/go-ethereum/eth/syncer"
|
||||||
"github.com/ethereum/go-ethereum/eth/tracers"
|
"github.com/ethereum/go-ethereum/eth/tracers"
|
||||||
"github.com/ethereum/go-ethereum/ethdb"
|
"github.com/ethereum/go-ethereum/ethdb"
|
||||||
"github.com/ethereum/go-ethereum/ethdb/remotedb"
|
"github.com/ethereum/go-ethereum/ethdb/remotedb"
|
||||||
|
|
@ -111,6 +111,11 @@ var (
|
||||||
Usage: "Root directory for ancient data (default = inside chaindata)",
|
Usage: "Root directory for ancient data (default = inside chaindata)",
|
||||||
Category: flags.EthCategory,
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
|
EraFlag = &flags.DirectoryFlag{
|
||||||
|
Name: "datadir.era",
|
||||||
|
Usage: "Root directory for era1 history (default = inside ancient/chain)",
|
||||||
|
Category: flags.EthCategory,
|
||||||
|
}
|
||||||
MinFreeDiskSpaceFlag = &flags.DirectoryFlag{
|
MinFreeDiskSpaceFlag = &flags.DirectoryFlag{
|
||||||
Name: "datadir.minfreedisk",
|
Name: "datadir.minfreedisk",
|
||||||
Usage: "Minimum free disk space in MB, once reached triggers auto shut down (default = --cache.gc converted to MB, 0 = disabled)",
|
Usage: "Minimum free disk space in MB, once reached triggers auto shut down (default = --cache.gc converted to MB, 0 = disabled)",
|
||||||
|
|
@ -145,7 +150,7 @@ var (
|
||||||
}
|
}
|
||||||
SepoliaFlag = &cli.BoolFlag{
|
SepoliaFlag = &cli.BoolFlag{
|
||||||
Name: "sepolia",
|
Name: "sepolia",
|
||||||
Usage: "Sepolia network: pre-configured proof-of-work test network",
|
Usage: "Sepolia network: pre-configured proof-of-stake test network",
|
||||||
Category: flags.EthCategory,
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
HoleskyFlag = &cli.BoolFlag{
|
HoleskyFlag = &cli.BoolFlag{
|
||||||
|
|
@ -238,9 +243,9 @@ var (
|
||||||
Value: 2048,
|
Value: 2048,
|
||||||
Category: flags.EthCategory,
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
OverridePrague = &cli.Uint64Flag{
|
OverrideOsaka = &cli.Uint64Flag{
|
||||||
Name: "override.prague",
|
Name: "override.osaka",
|
||||||
Usage: "Manually specify the Prague fork timestamp, overriding the bundled setting",
|
Usage: "Manually specify the Osaka fork timestamp, overriding the bundled setting",
|
||||||
Category: flags.EthCategory,
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
OverrideVerkle = &cli.Uint64Flag{
|
OverrideVerkle = &cli.Uint64Flag{
|
||||||
|
|
@ -256,7 +261,7 @@ var (
|
||||||
}
|
}
|
||||||
GCModeFlag = &cli.StringFlag{
|
GCModeFlag = &cli.StringFlag{
|
||||||
Name: "gcmode",
|
Name: "gcmode",
|
||||||
Usage: `Blockchain garbage collection mode, only relevant in state.scheme=hash ("full", "archive")`,
|
Usage: `Blockchain garbage collection mode ("full", "archive")`,
|
||||||
Value: "full",
|
Value: "full",
|
||||||
Category: flags.StateCategory,
|
Category: flags.StateCategory,
|
||||||
}
|
}
|
||||||
|
|
@ -977,6 +982,7 @@ var (
|
||||||
DatabaseFlags = []cli.Flag{
|
DatabaseFlags = []cli.Flag{
|
||||||
DataDirFlag,
|
DataDirFlag,
|
||||||
AncientFlag,
|
AncientFlag,
|
||||||
|
EraFlag,
|
||||||
RemoteDBFlag,
|
RemoteDBFlag,
|
||||||
DBEngineFlag,
|
DBEngineFlag,
|
||||||
StateSchemeFlag,
|
StateSchemeFlag,
|
||||||
|
|
@ -984,6 +990,12 @@ var (
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// default account to prefund when running Geth in dev mode
|
||||||
|
var (
|
||||||
|
DeveloperKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
|
DeveloperAddr = crypto.PubkeyToAddress(DeveloperKey.PublicKey)
|
||||||
|
)
|
||||||
|
|
||||||
// MakeDataDir retrieves the currently requested data directory, terminating
|
// MakeDataDir retrieves the currently requested data directory, terminating
|
||||||
// if none (or the empty string) is specified. If the node is starting a testnet,
|
// if none (or the empty string) is specified. If the node is starting a testnet,
|
||||||
// then a subdirectory of the specified datadir will be used.
|
// then a subdirectory of the specified datadir will be used.
|
||||||
|
|
@ -1245,28 +1257,6 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// setLes shows the deprecation warnings for LES flags.
|
|
||||||
func setLes(ctx *cli.Context, cfg *ethconfig.Config) {
|
|
||||||
if ctx.IsSet(LightServeFlag.Name) {
|
|
||||||
log.Warn("The light server has been deprecated, please remove this flag", "flag", LightServeFlag.Name)
|
|
||||||
}
|
|
||||||
if ctx.IsSet(LightIngressFlag.Name) {
|
|
||||||
log.Warn("The light server has been deprecated, please remove this flag", "flag", LightIngressFlag.Name)
|
|
||||||
}
|
|
||||||
if ctx.IsSet(LightEgressFlag.Name) {
|
|
||||||
log.Warn("The light server has been deprecated, please remove this flag", "flag", LightEgressFlag.Name)
|
|
||||||
}
|
|
||||||
if ctx.IsSet(LightMaxPeersFlag.Name) {
|
|
||||||
log.Warn("The light server has been deprecated, please remove this flag", "flag", LightMaxPeersFlag.Name)
|
|
||||||
}
|
|
||||||
if ctx.IsSet(LightNoPruneFlag.Name) {
|
|
||||||
log.Warn("The light server has been deprecated, please remove this flag", "flag", LightNoPruneFlag.Name)
|
|
||||||
}
|
|
||||||
if ctx.IsSet(LightNoSyncServeFlag.Name) {
|
|
||||||
log.Warn("The light server has been deprecated, please remove this flag", "flag", LightNoSyncServeFlag.Name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MakeDatabaseHandles raises out the number of allowed file handles per process
|
// MakeDatabaseHandles raises out the number of allowed file handles per process
|
||||||
// for Geth and returns half of the allowance to assign to the database.
|
// for Geth and returns half of the allowance to assign to the database.
|
||||||
func MakeDatabaseHandles(max int) int {
|
func MakeDatabaseHandles(max int) int {
|
||||||
|
|
@ -1389,13 +1379,13 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
|
||||||
cfg.UseLightweightKDF = ctx.Bool(LightKDFFlag.Name)
|
cfg.UseLightweightKDF = ctx.Bool(LightKDFFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(NoUSBFlag.Name) || cfg.NoUSB {
|
if ctx.IsSet(NoUSBFlag.Name) || cfg.NoUSB {
|
||||||
log.Warn("Option nousb is deprecated and USB is deactivated by default. Use --usb to enable")
|
log.Warn("Option --nousb is deprecated and USB is deactivated by default. Use --usb to enable")
|
||||||
}
|
}
|
||||||
if ctx.IsSet(USBFlag.Name) {
|
if ctx.IsSet(USBFlag.Name) {
|
||||||
cfg.USB = ctx.Bool(USBFlag.Name)
|
cfg.USB = ctx.Bool(USBFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(InsecureUnlockAllowedFlag.Name) {
|
if ctx.IsSet(InsecureUnlockAllowedFlag.Name) {
|
||||||
log.Warn(fmt.Sprintf("Option %q is deprecated and has no effect", InsecureUnlockAllowedFlag.Name))
|
log.Warn(fmt.Sprintf("Option --%s is deprecated and has no effect", InsecureUnlockAllowedFlag.Name))
|
||||||
}
|
}
|
||||||
if ctx.IsSet(DBEngineFlag.Name) {
|
if ctx.IsSet(DBEngineFlag.Name) {
|
||||||
dbEngine := ctx.String(DBEngineFlag.Name)
|
dbEngine := ctx.String(DBEngineFlag.Name)
|
||||||
|
|
@ -1407,10 +1397,10 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
|
||||||
}
|
}
|
||||||
// deprecation notice for log debug flags (TODO: find a more appropriate place to put these?)
|
// deprecation notice for log debug flags (TODO: find a more appropriate place to put these?)
|
||||||
if ctx.IsSet(LogBacktraceAtFlag.Name) {
|
if ctx.IsSet(LogBacktraceAtFlag.Name) {
|
||||||
log.Warn("log.backtrace flag is deprecated")
|
log.Warn("Option --log.backtrace flag is deprecated")
|
||||||
}
|
}
|
||||||
if ctx.IsSet(LogDebugFlag.Name) {
|
if ctx.IsSet(LogDebugFlag.Name) {
|
||||||
log.Warn("log.debug flag is deprecated")
|
log.Warn("Option --log.debug flag is deprecated")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1582,7 +1572,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
setBlobPool(ctx, &cfg.BlobPool)
|
setBlobPool(ctx, &cfg.BlobPool)
|
||||||
setMiner(ctx, &cfg.Miner)
|
setMiner(ctx, &cfg.Miner)
|
||||||
setRequiredBlocks(ctx, cfg)
|
setRequiredBlocks(ctx, cfg)
|
||||||
setLes(ctx, cfg)
|
|
||||||
|
|
||||||
// Cap the cache allowance and tune the garbage collector
|
// Cap the cache allowance and tune the garbage collector
|
||||||
mem, err := gopsutil.VirtualMemory()
|
mem, err := gopsutil.VirtualMemory()
|
||||||
|
|
@ -1630,6 +1619,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
if ctx.IsSet(AncientFlag.Name) {
|
if ctx.IsSet(AncientFlag.Name) {
|
||||||
cfg.DatabaseFreezer = ctx.String(AncientFlag.Name)
|
cfg.DatabaseFreezer = ctx.String(AncientFlag.Name)
|
||||||
}
|
}
|
||||||
|
if ctx.IsSet(EraFlag.Name) {
|
||||||
|
cfg.DatabaseEra = ctx.String(EraFlag.Name)
|
||||||
|
}
|
||||||
|
|
||||||
if gcmode := ctx.String(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" {
|
if gcmode := ctx.String(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" {
|
||||||
Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name)
|
Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name)
|
||||||
|
|
@ -1669,11 +1661,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
cfg.TransactionHistory = 0
|
cfg.TransactionHistory = 0
|
||||||
log.Warn("Disabled transaction unindexing for archive node")
|
log.Warn("Disabled transaction unindexing for archive node")
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.StateScheme != rawdb.HashScheme {
|
|
||||||
cfg.StateScheme = rawdb.HashScheme
|
|
||||||
log.Warn("Forcing hash state-scheme for archive mode")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ctx.IsSet(LogHistoryFlag.Name) {
|
if ctx.IsSet(LogHistoryFlag.Name) {
|
||||||
cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name)
|
cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name)
|
||||||
|
|
@ -1712,7 +1699,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ctx.IsSet(VMEnableDebugFlag.Name) {
|
if ctx.IsSet(VMEnableDebugFlag.Name) {
|
||||||
// TODO(fjl): force-enable this in --dev mode
|
|
||||||
cfg.EnablePreimageRecording = ctx.Bool(VMEnableDebugFlag.Name)
|
cfg.EnablePreimageRecording = ctx.Bool(VMEnableDebugFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1761,6 +1747,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
case ctx.Bool(DeveloperFlag.Name):
|
case ctx.Bool(DeveloperFlag.Name):
|
||||||
cfg.NetworkId = 1337
|
cfg.NetworkId = 1337
|
||||||
cfg.SyncMode = ethconfig.FullSync
|
cfg.SyncMode = ethconfig.FullSync
|
||||||
|
cfg.EnablePreimageRecording = true
|
||||||
// Create new developer account or reuse existing one
|
// Create new developer account or reuse existing one
|
||||||
var (
|
var (
|
||||||
developer accounts.Account
|
developer accounts.Account
|
||||||
|
|
@ -1792,9 +1779,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
} else if accs := ks.Accounts(); len(accs) > 0 {
|
} else if accs := ks.Accounts(); len(accs) > 0 {
|
||||||
developer = ks.Accounts()[0]
|
developer = ks.Accounts()[0]
|
||||||
} else {
|
} else {
|
||||||
developer, err = ks.NewAccount(passphrase)
|
developer, err = ks.ImportECDSA(DeveloperKey, passphrase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Failed to create developer account: %v", err)
|
Fatalf("Failed to import developer account: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Make sure the address is configured as fee recipient, otherwise
|
// Make sure the address is configured as fee recipient, otherwise
|
||||||
|
|
@ -1809,14 +1796,18 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
}
|
}
|
||||||
log.Info("Using developer account", "address", developer.Address)
|
log.Info("Using developer account", "address", developer.Address)
|
||||||
|
|
||||||
// Create a new developer genesis block or reuse existing one
|
// configure default developer genesis which will be used unless a
|
||||||
|
// datadir is specified and a chain is preexisting at that location.
|
||||||
cfg.Genesis = core.DeveloperGenesisBlock(ctx.Uint64(DeveloperGasLimitFlag.Name), &developer.Address)
|
cfg.Genesis = core.DeveloperGenesisBlock(ctx.Uint64(DeveloperGasLimitFlag.Name), &developer.Address)
|
||||||
|
|
||||||
|
// If a datadir is specified, ensure that any preexisting chain in that location
|
||||||
|
// has a configuration that is compatible with dev mode: it must be merged at genesis.
|
||||||
if ctx.IsSet(DataDirFlag.Name) {
|
if ctx.IsSet(DataDirFlag.Name) {
|
||||||
chaindb := tryMakeReadOnlyDatabase(ctx, stack)
|
chaindb := tryMakeReadOnlyDatabase(ctx, stack)
|
||||||
if rawdb.ReadCanonicalHash(chaindb, 0) != (common.Hash{}) {
|
if rawdb.ReadCanonicalHash(chaindb, 0) != (common.Hash{}) {
|
||||||
cfg.Genesis = nil // fallback to db content
|
// signal fallback to preexisting chain on disk
|
||||||
|
cfg.Genesis = nil
|
||||||
|
|
||||||
//validate genesis has PoS enabled in block 0
|
|
||||||
genesis, err := core.ReadGenesis(chaindb)
|
genesis, err := core.ReadGenesis(chaindb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Could not read genesis from database: %v", err)
|
Fatalf("Could not read genesis from database: %v", err)
|
||||||
|
|
@ -1868,7 +1859,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
func MakeBeaconLightConfig(ctx *cli.Context) bparams.ClientConfig {
|
func MakeBeaconLightConfig(ctx *cli.Context) bparams.ClientConfig {
|
||||||
var config bparams.ClientConfig
|
var config bparams.ClientConfig
|
||||||
customConfig := ctx.IsSet(BeaconConfigFlag.Name)
|
customConfig := ctx.IsSet(BeaconConfigFlag.Name)
|
||||||
flags.CheckExclusive(ctx, MainnetFlag, SepoliaFlag, HoleskyFlag, BeaconConfigFlag)
|
flags.CheckExclusive(ctx, MainnetFlag, SepoliaFlag, HoleskyFlag, HoodiFlag, BeaconConfigFlag)
|
||||||
switch {
|
switch {
|
||||||
case ctx.Bool(MainnetFlag.Name):
|
case ctx.Bool(MainnetFlag.Name):
|
||||||
config.ChainConfig = *bparams.MainnetLightConfig
|
config.ChainConfig = *bparams.MainnetLightConfig
|
||||||
|
|
@ -1900,11 +1891,11 @@ func MakeBeaconLightConfig(ctx *cli.Context) bparams.ClientConfig {
|
||||||
if c, err := hexutil.Decode(ctx.String(BeaconGenesisRootFlag.Name)); err == nil && len(c) <= 32 {
|
if c, err := hexutil.Decode(ctx.String(BeaconGenesisRootFlag.Name)); err == nil && len(c) <= 32 {
|
||||||
copy(config.GenesisValidatorsRoot[:len(c)], c)
|
copy(config.GenesisValidatorsRoot[:len(c)], c)
|
||||||
} else {
|
} else {
|
||||||
Fatalf("Invalid hex string", "beacon.genesis.gvroot", ctx.String(BeaconGenesisRootFlag.Name), "error", err)
|
Fatalf("Could not parse --%s: %v", BeaconGenesisRootFlag.Name, err)
|
||||||
}
|
}
|
||||||
configFile := ctx.String(BeaconConfigFlag.Name)
|
configFile := ctx.String(BeaconConfigFlag.Name)
|
||||||
if err := config.ChainConfig.LoadForks(configFile); err != nil {
|
if err := config.ChainConfig.LoadForks(configFile); err != nil {
|
||||||
Fatalf("Could not load beacon chain config", "file", configFile, "error", err)
|
Fatalf("Could not load beacon chain config '%s': %v", configFile, err)
|
||||||
}
|
}
|
||||||
log.Info("Using custom beacon chain config", "file", configFile)
|
log.Info("Using custom beacon chain config", "file", configFile)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1921,17 +1912,17 @@ func MakeBeaconLightConfig(ctx *cli.Context) bparams.ClientConfig {
|
||||||
// are saved to the specified file.
|
// are saved to the specified file.
|
||||||
if ctx.IsSet(BeaconCheckpointFileFlag.Name) {
|
if ctx.IsSet(BeaconCheckpointFileFlag.Name) {
|
||||||
if _, err := config.SetCheckpointFile(ctx.String(BeaconCheckpointFileFlag.Name)); err != nil {
|
if _, err := config.SetCheckpointFile(ctx.String(BeaconCheckpointFileFlag.Name)); err != nil {
|
||||||
Fatalf("Could not load beacon checkpoint file", "beacon.checkpoint.file", ctx.String(BeaconCheckpointFileFlag.Name), "error", err)
|
Fatalf("Could not load beacon checkpoint file '%s': %v", ctx.String(BeaconCheckpointFileFlag.Name), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ctx.IsSet(BeaconCheckpointFlag.Name) {
|
if ctx.IsSet(BeaconCheckpointFlag.Name) {
|
||||||
hex := ctx.String(BeaconCheckpointFlag.Name)
|
hex := ctx.String(BeaconCheckpointFlag.Name)
|
||||||
c, err := hexutil.Decode(hex)
|
c, err := hexutil.Decode(hex)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Invalid hex string", "beacon.checkpoint", hex, "error", err)
|
Fatalf("Could not parse --%s: %v", BeaconCheckpointFlag.Name, err)
|
||||||
}
|
}
|
||||||
if len(c) != 32 {
|
if len(c) != 32 {
|
||||||
Fatalf("Invalid hex string length", "beacon.checkpoint", hex, "length", len(c))
|
Fatalf("Could not parse --%s: invalid length %d, want 32", BeaconCheckpointFlag.Name, len(c))
|
||||||
}
|
}
|
||||||
copy(config.Checkpoint[:len(c)], c)
|
copy(config.Checkpoint[:len(c)], c)
|
||||||
}
|
}
|
||||||
|
|
@ -2006,10 +1997,14 @@ func RegisterFilterAPI(stack *node.Node, backend ethapi.Backend, ethcfg *ethconf
|
||||||
return filterSystem
|
return filterSystem
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterFullSyncTester adds the full-sync tester service into node.
|
// RegisterSyncOverrideService adds the synchronization override service into node.
|
||||||
func RegisterFullSyncTester(stack *node.Node, eth *eth.Ethereum, target common.Hash) {
|
func RegisterSyncOverrideService(stack *node.Node, eth *eth.Ethereum, target common.Hash, exitWhenSynced bool) {
|
||||||
catalyst.RegisterFullSyncTester(stack, eth, target)
|
if target != (common.Hash{}) {
|
||||||
log.Info("Registered full-sync tester", "hash", target)
|
log.Info("Registered sync override service", "hash", target, "exitWhenSynced", exitWhenSynced)
|
||||||
|
} else {
|
||||||
|
log.Info("Registered sync override service")
|
||||||
|
}
|
||||||
|
syncer.Register(stack, eth, target, exitWhenSynced)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetupMetrics configures the metrics system.
|
// SetupMetrics configures the metrics system.
|
||||||
|
|
@ -2043,7 +2038,6 @@ func SetupMetrics(cfg *metrics.Config) {
|
||||||
log.Info("Enabling metrics export to InfluxDB")
|
log.Info("Enabling metrics export to InfluxDB")
|
||||||
go influxdb.InfluxDBWithTags(metrics.DefaultRegistry, 10*time.Second, endpoint, database, username, password, "geth.", tagsMap)
|
go influxdb.InfluxDBWithTags(metrics.DefaultRegistry, 10*time.Second, endpoint, database, username, password, "geth.", tagsMap)
|
||||||
} else if enableExportV2 {
|
} else if enableExportV2 {
|
||||||
tagsMap := SplitTagsFlag(cfg.InfluxDBTags)
|
|
||||||
log.Info("Enabling metrics export to InfluxDB (v2)")
|
log.Info("Enabling metrics export to InfluxDB (v2)")
|
||||||
go influxdb.InfluxDBV2WithTags(metrics.DefaultRegistry, 10*time.Second, endpoint, token, bucket, organization, "geth.", tagsMap)
|
go influxdb.InfluxDBV2WithTags(metrics.DefaultRegistry, 10*time.Second, endpoint, token, bucket, organization, "geth.", tagsMap)
|
||||||
}
|
}
|
||||||
|
|
@ -2096,7 +2090,15 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
|
||||||
}
|
}
|
||||||
chainDb = remotedb.New(client)
|
chainDb = remotedb.New(client)
|
||||||
default:
|
default:
|
||||||
chainDb, err = stack.OpenDatabaseWithFreezer("chaindata", cache, handles, ctx.String(AncientFlag.Name), "eth/db/chaindata/", readonly)
|
options := node.DatabaseOptions{
|
||||||
|
ReadOnly: readonly,
|
||||||
|
Cache: cache,
|
||||||
|
Handles: handles,
|
||||||
|
AncientsDirectory: ctx.String(AncientFlag.Name),
|
||||||
|
MetricsNamespace: "eth/db/chaindata/",
|
||||||
|
EraDirectory: ctx.String(EraFlag.Name),
|
||||||
|
}
|
||||||
|
chainDb, err = stack.OpenDatabaseWithOptions("chaindata", options)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Could not open database: %v", err)
|
Fatalf("Could not open database: %v", err)
|
||||||
|
|
@ -2188,36 +2190,44 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("%v", err)
|
Fatalf("%v", err)
|
||||||
}
|
}
|
||||||
cache := &core.CacheConfig{
|
options := &core.BlockChainConfig{
|
||||||
TrieCleanLimit: ethconfig.Defaults.TrieCleanCache,
|
TrieCleanLimit: ethconfig.Defaults.TrieCleanCache,
|
||||||
TrieCleanNoPrefetch: ctx.Bool(CacheNoPrefetchFlag.Name),
|
NoPrefetch: ctx.Bool(CacheNoPrefetchFlag.Name),
|
||||||
TrieDirtyLimit: ethconfig.Defaults.TrieDirtyCache,
|
TrieDirtyLimit: ethconfig.Defaults.TrieDirtyCache,
|
||||||
TrieDirtyDisabled: ctx.String(GCModeFlag.Name) == "archive",
|
ArchiveMode: ctx.String(GCModeFlag.Name) == "archive",
|
||||||
TrieTimeLimit: ethconfig.Defaults.TrieTimeout,
|
TrieTimeLimit: ethconfig.Defaults.TrieTimeout,
|
||||||
SnapshotLimit: ethconfig.Defaults.SnapshotCache,
|
SnapshotLimit: ethconfig.Defaults.SnapshotCache,
|
||||||
Preimages: ctx.Bool(CachePreimagesFlag.Name),
|
Preimages: ctx.Bool(CachePreimagesFlag.Name),
|
||||||
StateScheme: scheme,
|
StateScheme: scheme,
|
||||||
StateHistory: ctx.Uint64(StateHistoryFlag.Name),
|
StateHistory: ctx.Uint64(StateHistoryFlag.Name),
|
||||||
|
// Disable transaction indexing/unindexing.
|
||||||
|
TxLookupLimit: -1,
|
||||||
|
|
||||||
|
// Enables file journaling for the trie database. The journal files will be stored
|
||||||
|
// within the data directory. The corresponding paths will be either:
|
||||||
|
// - DATADIR/triedb/merkle.journal
|
||||||
|
// - DATADIR/triedb/verkle.journal
|
||||||
|
TrieJournalDirectory: stack.ResolvePath("triedb"),
|
||||||
}
|
}
|
||||||
if cache.TrieDirtyDisabled && !cache.Preimages {
|
if options.ArchiveMode && !options.Preimages {
|
||||||
cache.Preimages = true
|
options.Preimages = true
|
||||||
log.Info("Enabling recording of key preimages since archive mode is used")
|
log.Info("Enabling recording of key preimages since archive mode is used")
|
||||||
}
|
}
|
||||||
if !ctx.Bool(SnapshotFlag.Name) {
|
if !ctx.Bool(SnapshotFlag.Name) {
|
||||||
cache.SnapshotLimit = 0 // Disabled
|
options.SnapshotLimit = 0 // Disabled
|
||||||
} else if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheSnapshotFlag.Name) {
|
} else if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheSnapshotFlag.Name) {
|
||||||
cache.SnapshotLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheSnapshotFlag.Name) / 100
|
options.SnapshotLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheSnapshotFlag.Name) / 100
|
||||||
}
|
}
|
||||||
// If we're in readonly, do not bother generating snapshot data.
|
// If we're in readonly, do not bother generating snapshot data.
|
||||||
if readonly {
|
if readonly {
|
||||||
cache.SnapshotNoBuild = true
|
options.SnapshotNoBuild = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheTrieFlag.Name) {
|
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheTrieFlag.Name) {
|
||||||
cache.TrieCleanLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheTrieFlag.Name) / 100
|
options.TrieCleanLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheTrieFlag.Name) / 100
|
||||||
}
|
}
|
||||||
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheGCFlag.Name) {
|
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheGCFlag.Name) {
|
||||||
cache.TrieDirtyLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheGCFlag.Name) / 100
|
options.TrieDirtyLimit = ctx.Int(CacheFlag.Name) * ctx.Int(CacheGCFlag.Name) / 100
|
||||||
}
|
}
|
||||||
vmcfg := vm.Config{
|
vmcfg := vm.Config{
|
||||||
EnablePreimageRecording: ctx.Bool(VMEnableDebugFlag.Name),
|
EnablePreimageRecording: ctx.Bool(VMEnableDebugFlag.Name),
|
||||||
|
|
@ -2232,8 +2242,9 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
|
||||||
vmcfg.Tracer = t
|
vmcfg.Tracer = t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Disable transaction indexing/unindexing by default.
|
options.VmConfig = vmcfg
|
||||||
chain, err := core.NewBlockChain(chainDb, cache, gspec, nil, engine, vmcfg, nil)
|
|
||||||
|
chain, err := core.NewBlockChain(chainDb, gspec, engine, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Can't create BlockChain: %v", err)
|
Fatalf("Can't create BlockChain: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,134 +39,116 @@ var DeprecatedFlags = []cli.Flag{
|
||||||
CacheTrieRejournalFlag,
|
CacheTrieRejournalFlag,
|
||||||
LegacyDiscoveryV5Flag,
|
LegacyDiscoveryV5Flag,
|
||||||
TxLookupLimitFlag,
|
TxLookupLimitFlag,
|
||||||
LightServeFlag,
|
|
||||||
LightIngressFlag,
|
|
||||||
LightEgressFlag,
|
|
||||||
LightMaxPeersFlag,
|
|
||||||
LightNoPruneFlag,
|
|
||||||
LightNoSyncServeFlag,
|
|
||||||
LogBacktraceAtFlag,
|
LogBacktraceAtFlag,
|
||||||
LogDebugFlag,
|
LogDebugFlag,
|
||||||
MinerNewPayloadTimeoutFlag,
|
MinerNewPayloadTimeoutFlag,
|
||||||
MinerEtherbaseFlag,
|
MinerEtherbaseFlag,
|
||||||
MiningEnabledFlag,
|
MiningEnabledFlag,
|
||||||
|
MetricsEnabledExpensiveFlag,
|
||||||
|
EnablePersonal,
|
||||||
|
UnlockedAccountFlag,
|
||||||
|
InsecureUnlockAllowedFlag,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// Deprecated May 2020, shown in aliased flags section
|
// Deprecated May 2020, shown in aliased flags section
|
||||||
NoUSBFlag = &cli.BoolFlag{
|
NoUSBFlag = &cli.BoolFlag{
|
||||||
Name: "nousb",
|
Name: "nousb",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)",
|
Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
// Deprecated March 2022
|
// Deprecated March 2022
|
||||||
LegacyWhitelistFlag = &cli.StringFlag{
|
LegacyWhitelistFlag = &cli.StringFlag{
|
||||||
Name: "whitelist",
|
Name: "whitelist",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --eth.requiredblocks)",
|
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --eth.requiredblocks)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
// Deprecated July 2023
|
// Deprecated July 2023
|
||||||
CacheTrieJournalFlag = &cli.StringFlag{
|
CacheTrieJournalFlag = &cli.StringFlag{
|
||||||
Name: "cache.trie.journal",
|
Name: "cache.trie.journal",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Disk journal directory for trie cache to survive node restarts",
|
Usage: "Disk journal directory for trie cache to survive node restarts",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
CacheTrieRejournalFlag = &cli.DurationFlag{
|
CacheTrieRejournalFlag = &cli.DurationFlag{
|
||||||
Name: "cache.trie.rejournal",
|
Name: "cache.trie.rejournal",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Time interval to regenerate the trie cache journal",
|
Usage: "Time interval to regenerate the trie cache journal",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
LegacyDiscoveryV5Flag = &cli.BoolFlag{
|
LegacyDiscoveryV5Flag = &cli.BoolFlag{
|
||||||
Name: "v5disc",
|
Name: "v5disc",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism (deprecated, use --discv5 instead)",
|
Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism (deprecated, use --discv5 instead)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
// Deprecated August 2023
|
// Deprecated August 2023
|
||||||
TxLookupLimitFlag = &cli.Uint64Flag{
|
TxLookupLimitFlag = &cli.Uint64Flag{
|
||||||
Name: "txlookuplimit",
|
Name: "txlookuplimit",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain) (deprecated, use history.transactions instead)",
|
Usage: "Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain) (deprecated, use history.transactions instead)",
|
||||||
Value: ethconfig.Defaults.TransactionHistory,
|
Value: ethconfig.Defaults.TransactionHistory,
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
// Light server and client settings, Deprecated November 2023
|
|
||||||
LightServeFlag = &cli.IntFlag{
|
|
||||||
Name: "light.serve",
|
|
||||||
Usage: "Maximum percentage of time allowed for serving LES requests (deprecated)",
|
|
||||||
Category: flags.DeprecatedCategory,
|
|
||||||
}
|
|
||||||
LightIngressFlag = &cli.IntFlag{
|
|
||||||
Name: "light.ingress",
|
|
||||||
Usage: "Incoming bandwidth limit for serving light clients (deprecated)",
|
|
||||||
Category: flags.DeprecatedCategory,
|
|
||||||
}
|
|
||||||
LightEgressFlag = &cli.IntFlag{
|
|
||||||
Name: "light.egress",
|
|
||||||
Usage: "Outgoing bandwidth limit for serving light clients (deprecated)",
|
|
||||||
Category: flags.DeprecatedCategory,
|
|
||||||
}
|
|
||||||
LightMaxPeersFlag = &cli.IntFlag{
|
|
||||||
Name: "light.maxpeers",
|
|
||||||
Usage: "Maximum number of light clients to serve, or light servers to attach to (deprecated)",
|
|
||||||
Category: flags.DeprecatedCategory,
|
|
||||||
}
|
|
||||||
LightNoPruneFlag = &cli.BoolFlag{
|
|
||||||
Name: "light.nopruning",
|
|
||||||
Usage: "Disable ancient light chain data pruning (deprecated)",
|
|
||||||
Category: flags.DeprecatedCategory,
|
|
||||||
}
|
|
||||||
LightNoSyncServeFlag = &cli.BoolFlag{
|
|
||||||
Name: "light.nosyncserve",
|
|
||||||
Usage: "Enables serving light clients before syncing (deprecated)",
|
|
||||||
Category: flags.DeprecatedCategory,
|
|
||||||
}
|
|
||||||
// Deprecated November 2023
|
// Deprecated November 2023
|
||||||
LogBacktraceAtFlag = &cli.StringFlag{
|
LogBacktraceAtFlag = &cli.StringFlag{
|
||||||
Name: "log.backtrace",
|
Name: "log.backtrace",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Request a stack trace at a specific logging statement (deprecated)",
|
Usage: "Request a stack trace at a specific logging statement (deprecated)",
|
||||||
Value: "",
|
Value: "",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
LogDebugFlag = &cli.BoolFlag{
|
LogDebugFlag = &cli.BoolFlag{
|
||||||
Name: "log.debug",
|
Name: "log.debug",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Prepends log messages with call-site location (deprecated)",
|
Usage: "Prepends log messages with call-site location (deprecated)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
// Deprecated February 2024
|
// Deprecated February 2024
|
||||||
MinerNewPayloadTimeoutFlag = &cli.DurationFlag{
|
MinerNewPayloadTimeoutFlag = &cli.DurationFlag{
|
||||||
Name: "miner.newpayload-timeout",
|
Name: "miner.newpayload-timeout",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Specify the maximum time allowance for creating a new payload (deprecated)",
|
Usage: "Specify the maximum time allowance for creating a new payload (deprecated)",
|
||||||
Value: ethconfig.Defaults.Miner.Recommit,
|
Value: ethconfig.Defaults.Miner.Recommit,
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
MinerEtherbaseFlag = &cli.StringFlag{
|
MinerEtherbaseFlag = &cli.StringFlag{
|
||||||
Name: "miner.etherbase",
|
Name: "miner.etherbase",
|
||||||
|
Hidden: true,
|
||||||
Usage: "0x prefixed public address for block mining rewards (deprecated)",
|
Usage: "0x prefixed public address for block mining rewards (deprecated)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
MiningEnabledFlag = &cli.BoolFlag{
|
MiningEnabledFlag = &cli.BoolFlag{
|
||||||
Name: "mine",
|
Name: "mine",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Enable mining (deprecated)",
|
Usage: "Enable mining (deprecated)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
MetricsEnabledExpensiveFlag = &cli.BoolFlag{
|
MetricsEnabledExpensiveFlag = &cli.BoolFlag{
|
||||||
Name: "metrics.expensive",
|
Name: "metrics.expensive",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Enable expensive metrics collection and reporting (deprecated)",
|
Usage: "Enable expensive metrics collection and reporting (deprecated)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
// Deprecated Oct 2024
|
// Deprecated Oct 2024
|
||||||
EnablePersonal = &cli.BoolFlag{
|
EnablePersonal = &cli.BoolFlag{
|
||||||
Name: "rpc.enabledeprecatedpersonal",
|
Name: "rpc.enabledeprecatedpersonal",
|
||||||
|
Hidden: true,
|
||||||
Usage: "This used to enable the 'personal' namespace.",
|
Usage: "This used to enable the 'personal' namespace.",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
UnlockedAccountFlag = &cli.StringFlag{
|
UnlockedAccountFlag = &cli.StringFlag{
|
||||||
Name: "unlock",
|
Name: "unlock",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Comma separated list of accounts to unlock (deprecated)",
|
Usage: "Comma separated list of accounts to unlock (deprecated)",
|
||||||
Value: "",
|
Value: "",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
InsecureUnlockAllowedFlag = &cli.BoolFlag{
|
InsecureUnlockAllowedFlag = &cli.BoolFlag{
|
||||||
Name: "allow-insecure-unlock",
|
Name: "allow-insecure-unlock",
|
||||||
|
Hidden: true,
|
||||||
Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http (deprecated)",
|
Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http (deprecated)",
|
||||||
Category: flags.DeprecatedCategory,
|
Category: flags.DeprecatedCategory,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/internal/era"
|
"github.com/ethereum/go-ethereum/internal/era"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
|
@ -78,7 +77,7 @@ func TestHistoryImportAndExport(t *testing.T) {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Initialize BlockChain.
|
// Initialize BlockChain.
|
||||||
chain, err := core.NewBlockChain(db, nil, genesis, nil, ethash.NewFaker(), vm.Config{}, nil)
|
chain, err := core.NewBlockChain(db, genesis, ethash.NewFaker(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to initialize chain: %v", err)
|
t.Fatalf("unable to initialize chain: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +157,7 @@ func TestHistoryImportAndExport(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now import Era.
|
// Now import Era.
|
||||||
db2, err := rawdb.NewDatabaseWithFreezer(rawdb.NewMemoryDatabase(), "", "", false)
|
db2, err := rawdb.Open(rawdb.NewMemoryDatabase(), rawdb.OpenOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +166,7 @@ func TestHistoryImportAndExport(t *testing.T) {
|
||||||
})
|
})
|
||||||
|
|
||||||
genesis.MustCommit(db2, triedb.NewDatabase(db2, triedb.HashDefaults))
|
genesis.MustCommit(db2, triedb.NewDatabase(db2, triedb.HashDefaults))
|
||||||
imported, err := core.NewBlockChain(db2, nil, genesis, nil, ethash.NewFaker(), vm.Config{}, nil)
|
imported, err := core.NewBlockChain(db2, genesis, ethash.NewFaker(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to initialize chain: %v", err)
|
t.Fatalf("unable to initialize chain: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,13 @@ and `eth_getBlockByNumber`, use this command:
|
||||||
> ./workload test --sepolia --run History/getBlockBy http://host:8545
|
> ./workload test --sepolia --run History/getBlockBy http://host:8545
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Notably, trace tests require archive which keeps all the historical states for tracing.
|
||||||
|
The additional flag is required to activate the trace tests.
|
||||||
|
|
||||||
|
```
|
||||||
|
> ./workload test --sepolia --archive --run Trace/Block http://host:8545
|
||||||
|
```
|
||||||
|
|
||||||
### Regenerating tests
|
### Regenerating tests
|
||||||
|
|
||||||
There is a facility for updating the tests from the chain. This can also be used to
|
There is a facility for updating the tests from the chain. This can also be used to
|
||||||
|
|
@ -26,4 +33,5 @@ the following commands (in this directory) against a synced mainnet node:
|
||||||
```shell
|
```shell
|
||||||
> go run . filtergen --queries queries/filter_queries_mainnet.json http://host:8545
|
> go run . filtergen --queries queries/filter_queries_mainnet.json http://host:8545
|
||||||
> go run . historygen --history-tests queries/history_mainnet.json http://host:8545
|
> go run . historygen --history-tests queries/history_mainnet.json http://host:8545
|
||||||
|
> go run . tracegen --trace-tests queries/trace_mainnet.json --trace-start 4000000 --trace-end 4000100 http://host:8545
|
||||||
```
|
```
|
||||||
|
|
|
||||||
104
cmd/workload/client.go
Normal file
104
cmd/workload/client.go
Normal file
|
|
@ -0,0 +1,104 @@
|
||||||
|
// Copyright 2025 The go-ethereum Authors
|
||||||
|
// This file is part of go-ethereum.
|
||||||
|
//
|
||||||
|
// go-ethereum is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// go-ethereum is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
"github.com/ethereum/go-ethereum/ethclient"
|
||||||
|
"github.com/ethereum/go-ethereum/ethclient/gethclient"
|
||||||
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
|
"github.com/urfave/cli/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type client struct {
|
||||||
|
Eth *ethclient.Client
|
||||||
|
Geth *gethclient.Client
|
||||||
|
RPC *rpc.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeClient(ctx *cli.Context) *client {
|
||||||
|
if ctx.NArg() < 1 {
|
||||||
|
exit("missing RPC endpoint URL as command-line argument")
|
||||||
|
}
|
||||||
|
url := ctx.Args().First()
|
||||||
|
cl, err := rpc.Dial(url)
|
||||||
|
if err != nil {
|
||||||
|
exit(fmt.Errorf("could not create RPC client at %s: %v", url, err))
|
||||||
|
}
|
||||||
|
return &client{
|
||||||
|
RPC: cl,
|
||||||
|
Eth: ethclient.NewClient(cl),
|
||||||
|
Geth: gethclient.New(cl),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type simpleBlock struct {
|
||||||
|
Number hexutil.Uint64 `json:"number"`
|
||||||
|
Hash common.Hash `json:"hash"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type simpleTransaction struct {
|
||||||
|
Hash common.Hash `json:"hash"`
|
||||||
|
TransactionIndex hexutil.Uint64 `json:"transactionIndex"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) getBlockByHash(ctx context.Context, arg common.Hash, fullTx bool) (*simpleBlock, error) {
|
||||||
|
var r *simpleBlock
|
||||||
|
err := c.RPC.CallContext(ctx, &r, "eth_getBlockByHash", arg, fullTx)
|
||||||
|
return r, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) getBlockByNumber(ctx context.Context, arg uint64, fullTx bool) (*simpleBlock, error) {
|
||||||
|
var r *simpleBlock
|
||||||
|
err := c.RPC.CallContext(ctx, &r, "eth_getBlockByNumber", hexutil.Uint64(arg), fullTx)
|
||||||
|
return r, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) getTransactionByBlockHashAndIndex(ctx context.Context, block common.Hash, index uint64) (*simpleTransaction, error) {
|
||||||
|
var r *simpleTransaction
|
||||||
|
err := c.RPC.CallContext(ctx, &r, "eth_getTransactionByBlockHashAndIndex", block, hexutil.Uint64(index))
|
||||||
|
return r, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) getTransactionByBlockNumberAndIndex(ctx context.Context, block uint64, index uint64) (*simpleTransaction, error) {
|
||||||
|
var r *simpleTransaction
|
||||||
|
err := c.RPC.CallContext(ctx, &r, "eth_getTransactionByBlockNumberAndIndex", hexutil.Uint64(block), hexutil.Uint64(index))
|
||||||
|
return r, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) getBlockTransactionCountByHash(ctx context.Context, block common.Hash) (uint64, error) {
|
||||||
|
var r hexutil.Uint64
|
||||||
|
err := c.RPC.CallContext(ctx, &r, "eth_getBlockTransactionCountByHash", block)
|
||||||
|
return uint64(r), err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) getBlockTransactionCountByNumber(ctx context.Context, block uint64) (uint64, error) {
|
||||||
|
var r hexutil.Uint64
|
||||||
|
err := c.RPC.CallContext(ctx, &r, "eth_getBlockTransactionCountByNumber", hexutil.Uint64(block))
|
||||||
|
return uint64(r), err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) getBlockReceipts(ctx context.Context, arg any) ([]*types.Receipt, error) {
|
||||||
|
var result []*types.Receipt
|
||||||
|
err := c.RPC.CallContext(ctx, &result, "eth_getBlockReceipts", arg)
|
||||||
|
return result, err
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum"
|
"github.com/ethereum/go-ethereum"
|
||||||
|
|
@ -45,11 +46,11 @@ func newFilterTestSuite(cfg testConfig) *filterTestSuite {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *filterTestSuite) allTests() []utesting.Test {
|
func (s *filterTestSuite) allTests() []workloadTest {
|
||||||
return []utesting.Test{
|
return []workloadTest{
|
||||||
{Name: "Filter/ShortRange", Fn: s.filterShortRange},
|
newWorkLoadTest("Filter/ShortRange", s.filterShortRange),
|
||||||
{Name: "Filter/LongRange", Fn: s.filterLongRange, Slow: true},
|
newSlowWorkloadTest("Filter/LongRange", s.filterLongRange),
|
||||||
{Name: "Filter/FullRange", Fn: s.filterFullRange, Slow: true},
|
newSlowWorkloadTest("Filter/FullRange", s.filterFullRange),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,7 +92,7 @@ func (s *filterTestSuite) filterShortRange(t *utesting.T) {
|
||||||
}, s.queryAndCheck)
|
}, s.queryAndCheck)
|
||||||
}
|
}
|
||||||
|
|
||||||
// filterShortRange runs all long-range filter tests.
|
// filterLongRange runs all long-range filter tests.
|
||||||
func (s *filterTestSuite) filterLongRange(t *utesting.T) {
|
func (s *filterTestSuite) filterLongRange(t *utesting.T) {
|
||||||
s.filterRange(t, func(query *filterQuery) bool {
|
s.filterRange(t, func(query *filterQuery) bool {
|
||||||
return query.ToBlock+1-query.FromBlock > filterRangeThreshold
|
return query.ToBlock+1-query.FromBlock > filterRangeThreshold
|
||||||
|
|
@ -152,9 +153,16 @@ func (s *filterTestSuite) fullRangeQueryAndCheck(t *utesting.T, query *filterQue
|
||||||
|
|
||||||
func (s *filterTestSuite) loadQueries() error {
|
func (s *filterTestSuite) loadQueries() error {
|
||||||
file, err := s.cfg.fsys.Open(s.cfg.filterQueryFile)
|
file, err := s.cfg.fsys.Open(s.cfg.filterQueryFile)
|
||||||
|
if err != nil {
|
||||||
|
// If not found in embedded FS, try to load it from disk
|
||||||
|
if !os.IsNotExist(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
file, err = os.OpenFile(s.cfg.filterQueryFile, os.O_RDONLY, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("can't open filterQueryFile: %v", err)
|
return fmt.Errorf("can't open filterQueryFile: %v", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
var queries [][]*filterQuery
|
var queries [][]*filterQuery
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ func (st *bucketStats) print(name string) {
|
||||||
name, st.count, float64(st.blocks)/float64(st.count), float64(st.logs)/float64(st.count), st.runtime/time.Duration(st.count))
|
name, st.count, float64(st.blocks)/float64(st.count), float64(st.logs)/float64(st.count), st.runtime/time.Duration(st.count))
|
||||||
}
|
}
|
||||||
|
|
||||||
// writeQueries serializes the generated errors to the error file.
|
// writeErrors serializes the generated errors to the error file.
|
||||||
func writeErrors(errorFile string, errors []*filterQuery) {
|
func writeErrors(errorFile string, errors []*filterQuery) {
|
||||||
file, err := os.Create(errorFile)
|
file, err := os.Create(errorFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
|
||||||
"github.com/ethereum/go-ethereum/internal/utesting"
|
"github.com/ethereum/go-ethereum/internal/utesting"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -52,9 +52,16 @@ func newHistoryTestSuite(cfg testConfig) *historyTestSuite {
|
||||||
|
|
||||||
func (s *historyTestSuite) loadTests() error {
|
func (s *historyTestSuite) loadTests() error {
|
||||||
file, err := s.cfg.fsys.Open(s.cfg.historyTestFile)
|
file, err := s.cfg.fsys.Open(s.cfg.historyTestFile)
|
||||||
|
if err != nil {
|
||||||
|
// If not found in embedded FS, try to load it from disk
|
||||||
|
if !os.IsNotExist(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
file, err = os.OpenFile(s.cfg.historyTestFile, os.O_RDONLY, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("can't open historyTestFile: %v", err)
|
return fmt.Errorf("can't open historyTestFile: %v", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
if err := json.NewDecoder(file).Decode(&s.tests); err != nil {
|
if err := json.NewDecoder(file).Decode(&s.tests); err != nil {
|
||||||
return fmt.Errorf("invalid JSON in %s: %v", s.cfg.historyTestFile, err)
|
return fmt.Errorf("invalid JSON in %s: %v", s.cfg.historyTestFile, err)
|
||||||
|
|
@ -65,40 +72,16 @@ func (s *historyTestSuite) loadTests() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *historyTestSuite) allTests() []utesting.Test {
|
func (s *historyTestSuite) allTests() []workloadTest {
|
||||||
return []utesting.Test{
|
return []workloadTest{
|
||||||
{
|
newWorkLoadTest("History/getBlockByHash", s.testGetBlockByHash),
|
||||||
Name: "History/getBlockByHash",
|
newWorkLoadTest("History/getBlockByNumber", s.testGetBlockByNumber),
|
||||||
Fn: s.testGetBlockByHash,
|
newWorkLoadTest("History/getBlockReceiptsByHash", s.testGetBlockReceiptsByHash),
|
||||||
},
|
newWorkLoadTest("History/getBlockReceiptsByNumber", s.testGetBlockReceiptsByNumber),
|
||||||
{
|
newWorkLoadTest("History/getBlockTransactionCountByHash", s.testGetBlockTransactionCountByHash),
|
||||||
Name: "History/getBlockByNumber",
|
newWorkLoadTest("History/getBlockTransactionCountByNumber", s.testGetBlockTransactionCountByNumber),
|
||||||
Fn: s.testGetBlockByNumber,
|
newWorkLoadTest("History/getTransactionByBlockHashAndIndex", s.testGetTransactionByBlockHashAndIndex),
|
||||||
},
|
newWorkLoadTest("History/getTransactionByBlockNumberAndIndex", s.testGetTransactionByBlockNumberAndIndex),
|
||||||
{
|
|
||||||
Name: "History/getBlockReceiptsByHash",
|
|
||||||
Fn: s.testGetBlockReceiptsByHash,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "History/getBlockReceiptsByNumber",
|
|
||||||
Fn: s.testGetBlockReceiptsByNumber,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "History/getBlockTransactionCountByHash",
|
|
||||||
Fn: s.testGetBlockTransactionCountByHash,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "History/getBlockTransactionCountByNumber",
|
|
||||||
Fn: s.testGetBlockTransactionCountByNumber,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "History/getTransactionByBlockHashAndIndex",
|
|
||||||
Fn: s.testGetTransactionByBlockHashAndIndex,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "History/getTransactionByBlockNumberAndIndex",
|
|
||||||
Fn: s.testGetTransactionByBlockNumberAndIndex,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -279,55 +262,3 @@ func (s *historyTestSuite) testGetTransactionByBlockNumberAndIndex(t *utesting.T
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type simpleBlock struct {
|
|
||||||
Number hexutil.Uint64 `json:"number"`
|
|
||||||
Hash common.Hash `json:"hash"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type simpleTransaction struct {
|
|
||||||
Hash common.Hash `json:"hash"`
|
|
||||||
TransactionIndex hexutil.Uint64 `json:"transactionIndex"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) getBlockByHash(ctx context.Context, arg common.Hash, fullTx bool) (*simpleBlock, error) {
|
|
||||||
var r *simpleBlock
|
|
||||||
err := c.RPC.CallContext(ctx, &r, "eth_getBlockByHash", arg, fullTx)
|
|
||||||
return r, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) getBlockByNumber(ctx context.Context, arg uint64, fullTx bool) (*simpleBlock, error) {
|
|
||||||
var r *simpleBlock
|
|
||||||
err := c.RPC.CallContext(ctx, &r, "eth_getBlockByNumber", hexutil.Uint64(arg), fullTx)
|
|
||||||
return r, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) getTransactionByBlockHashAndIndex(ctx context.Context, block common.Hash, index uint64) (*simpleTransaction, error) {
|
|
||||||
var r *simpleTransaction
|
|
||||||
err := c.RPC.CallContext(ctx, &r, "eth_getTransactionByBlockHashAndIndex", block, hexutil.Uint64(index))
|
|
||||||
return r, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) getTransactionByBlockNumberAndIndex(ctx context.Context, block uint64, index uint64) (*simpleTransaction, error) {
|
|
||||||
var r *simpleTransaction
|
|
||||||
err := c.RPC.CallContext(ctx, &r, "eth_getTransactionByBlockNumberAndIndex", hexutil.Uint64(block), hexutil.Uint64(index))
|
|
||||||
return r, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) getBlockTransactionCountByHash(ctx context.Context, block common.Hash) (uint64, error) {
|
|
||||||
var r hexutil.Uint64
|
|
||||||
err := c.RPC.CallContext(ctx, &r, "eth_getBlockTransactionCountByHash", block)
|
|
||||||
return uint64(r), err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) getBlockTransactionCountByNumber(ctx context.Context, block uint64) (uint64, error) {
|
|
||||||
var r hexutil.Uint64
|
|
||||||
err := c.RPC.CallContext(ctx, &r, "eth_getBlockTransactionCountByNumber", hexutil.Uint64(block))
|
|
||||||
return uint64(r), err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) getBlockReceipts(ctx context.Context, arg any) ([]*types.Receipt, error) {
|
|
||||||
var result []*types.Receipt
|
|
||||||
err := c.RPC.CallContext(ctx, &result, "eth_getBlockReceipts", arg)
|
|
||||||
return result, err
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue