-
Notifications
You must be signed in to change notification settings - Fork 0
/
transaction_test.go
22 lines (18 loc) · 1.71 KB
/
transaction_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package kernel
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestTransaction(t *testing.T) {
require := require.New(t)
mn := NewMixinNetwork("https://kernel.mixin.dev")
tx, err := mn.GetTransaction("04f9195917b43461135d54c3cf8e588cbc22299680ec90b80be15f0bc02a026d")
require.Nil(err)
require.NotNil(tx)
require.Equal("2dc0ab2919c77daea5cfc0b37a2beea02142e8fdc4f60409fd40b256bb13ea29", tx.Asset)
require.Equal("04f9195917b43461135d54c3cf8e588cbc22299680ec90b80be15f0bc02a026d", tx.Hash)
tx, err = mn.SendRawTransaction("777700052dc0ab2919c77daea5cfc0b37a2beea02142e8fdc4f60409fd40b256bb13ea29000189ad69cf82654cde83edea88f627f6c5688c647f48d82fbbdc050600856009770000000000000000000200a1000502fe94247c000000000000000000000000000000000000000000000000000000000000000000000000777700f43244644e54484364703445334b556e4376626772516433715573715374727a79653973737734655973577a6d34696d35557863346e514e3836386a456474415a375a3172634a634b7a4b35667851717874526e6473344c70755466726e74767678664450535748684577486556334d34744e593157546a52704d644170476b6d6e4e793237616275713137517961524448464241444b4d3266314648344b6751445a536a575957473741574b437561733746534e6f6e3372385974433642504c33736463456251555051446d693964436b6a3558504538644d587869797878713174617668644c465450554a716655614859417000023131000000034c4b400001366037fab5eccd7dd66ec87d49d223ec259e86c8aebb152d5190c0236996af01e73d935b2ac6c0cc308594dc4110adaa00a76ef990df7300b2536c5d73ad40d50003fffe010000000000000000000100010000e65e7d80c4490426ed460f54242a66b9b61640c27fe77982ce35f343618b30b28e9c10662134c16bda605598936496eb2e89227ef699c96e69a5720c1997a101")
require.Nil(err)
require.NotNil(tx)
require.Equal("04f9195917b43461135d54c3cf8e588cbc22299680ec90b80be15f0bc02a026d", tx.Hash)
}