aboutsummaryrefslogtreecommitdiffstats
path: root/mobile
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-24 16:55:24 +0800
committerGitHub <noreply@github.com>2018-01-24 16:55:24 +0800
commit5c83a4e5dd600fcf19502f7fb083dc0b6393f969 (patch)
tree889e789ef24b36bd1bc2094b1867d71698b2a542 /mobile
parent05ade19302357eba6a24348f31df140ce0eca326 (diff)
parent1bf508b449ebd42653f521ada92c782e8cb664d2 (diff)
downloadgo-tangerine-5c83a4e5dd600fcf19502f7fb083dc0b6393f969.tar
go-tangerine-5c83a4e5dd600fcf19502f7fb083dc0b6393f969.tar.gz
go-tangerine-5c83a4e5dd600fcf19502f7fb083dc0b6393f969.tar.bz2
go-tangerine-5c83a4e5dd600fcf19502f7fb083dc0b6393f969.tar.lz
go-tangerine-5c83a4e5dd600fcf19502f7fb083dc0b6393f969.tar.xz
go-tangerine-5c83a4e5dd600fcf19502f7fb083dc0b6393f969.tar.zst
go-tangerine-5c83a4e5dd600fcf19502f7fb083dc0b6393f969.zip
Merge pull request #15832 from karalabe/abigen-events
accounts/abi/bind: support event filtering in abigen
Diffstat (limited to 'mobile')
-rw-r--r--mobile/android_test.go15
-rw-r--r--mobile/bind.go2
2 files changed, 11 insertions, 6 deletions
diff --git a/mobile/android_test.go b/mobile/android_test.go
index 345e009b4..3d3bd66d0 100644
--- a/mobile/android_test.go
+++ b/mobile/android_test.go
@@ -72,7 +72,7 @@ public class AndroidTest extends InstrumentationTestCase {
Transaction tx = new Transaction(
1, new Address("0x0000000000000000000000000000000000000000"),
- new BigInt(0), new BigInt(0), new BigInt(1), null); // Random empty transaction
+ new BigInt(0), 0, new BigInt(1), null); // Random empty transaction
BigInt chain = new BigInt(1); // Chain identifier of the main net
// Sign a transaction with a single authorization
@@ -164,12 +164,17 @@ func TestAndroid(t *testing.T) {
t.Skip("command gradle not found, skipping")
}
if sdk := os.Getenv("ANDROID_HOME"); sdk == "" {
- t.Skip("ANDROID_HOME environment var not set, skipping")
+ // Android SDK not explicitly given, try to auto-resolve
+ autopath := filepath.Join(os.Getenv("HOME"), "Android", "Sdk")
+ if _, err := os.Stat(autopath); err != nil {
+ t.Skip("ANDROID_HOME environment var not set, skipping")
+ }
+ os.Setenv("ANDROID_HOME", autopath)
}
if _, err := exec.Command("which", "gomobile").CombinedOutput(); err != nil {
t.Log("gomobile missing, installing it...")
- if _, err := exec.Command("go", "install", "golang.org/x/mobile/cmd/gomobile").CombinedOutput(); err != nil {
- t.Fatalf("install failed: %v", err)
+ if out, err := exec.Command("go", "get", "golang.org/x/mobile/cmd/gomobile").CombinedOutput(); err != nil {
+ t.Fatalf("install failed: %v\n%s", err, string(out))
}
t.Log("initializing gomobile...")
start := time.Now()
@@ -239,7 +244,7 @@ const gradleConfig = `buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.5.0'
+ classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
diff --git a/mobile/bind.go b/mobile/bind.go
index 1e861d0bc..7a1bf9e60 100644
--- a/mobile/bind.go
+++ b/mobile/bind.go
@@ -138,7 +138,7 @@ func BindContract(address *Address, abiJSON string, client *EthereumClient) (con
return nil, err
}
return &BoundContract{
- contract: bind.NewBoundContract(address.address, parsed, client.client, client.client),
+ contract: bind.NewBoundContract(address.address, parsed, client.client, client.client, client.client),
address: address.address,
}, nil
}