5 Star 29 Fork 12

楠木 / etherscan-api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
client_test.go 658 Bytes
一键复制 编辑 原始数据 按行查看 历史
楠木 提交于 2018-07-31 23:00 . [dev] client call is now okay
/*
* Copyright (c) 2018 LI Zhennan
*
* Use of this work is governed by a MIT License.
* You may find a license copy in project root.
*/
package etherscan
import (
"testing"
)
func TestClient_craftURL(t *testing.T) {
c := New(Ropsten, "abc123")
const expected = `https://api-ropsten.etherscan.io/api?action=craftURL&apikey=abc123&four=d&four=e&four=f&module=testing&one=1&three=1&three=2&three=3&two=2`
output := c.craftURL("testing", "craftURL", M{
"one": 1,
"two": "2",
"three": []int{1, 2, 3},
"four": []string{"d", "e", "f"},
})
if output != expected {
t.Fatalf("output != expected, got %s, want %s", output, expected)
}
}
Go
1
https://gitee.com/nanmu42/etherscan-api.git
git@gitee.com:nanmu42/etherscan-api.git
nanmu42
etherscan-api
etherscan-api
master

搜索帮助